Makefile

Wed, 23 Feb 2000 08:47:59 +0100

author
tuomov
date
Wed, 23 Feb 2000 08:47:59 +0100
changeset 2
e14a1aba4c56
parent 1
6e704fc09528
child 3
b1fbfab67908
permissions
-rw-r--r--

trunk: changeset 5
Error tolerant config file parsing mode

#
# libtu Makefile
#

# Where to install? ($PREFIX/lib/libtu.a, $PREFIX/include/libtu/)
#
PREFIX=/usr/local

# Any extra defines needed
#
#DEFINES=

# Any extra include paths needed
#
#INCLUDES=

######################################

WARN=	-W -Wimplicit -Wreturn-type -Wswitch -Wcomment \
	-Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized \
	-Wparentheses -pedantic-errors

CC_FLAGS=-g -O2 -ansi $(DEFINES) $(INCLUDES) $(WARN)
CC=gcc
AR=ar
AR_FLAGS=crs

INSTALL=install
MODE=644

######################################

OBJS= misc.o output.o util.o optparser.o parser.o tokenizer.o
	
DEPEND= .depend

LIBDIR=$(PREFIX)/lib
INCDIR=$(PREFIX)/include/libtu

TARGETS=libtu.a
TESTERS=tester tester2 tester3

######################################

all: $(TARGETS)

testers: $(TESTERS)

libtu.a: $(OBJS)
	$(AR) $(AR_FLAGS) $@ $+

%: %.c libtu.a
	$(CC) $(CC_FLAGS) $+ -L. -ltu -lm -o $@

%.o: %.c
	$(CC) $(CC_FLAGS) -c $< -o $@

clean:
	rm -f $(OBJS) $(DEPEND)

realclean: clean
	rm -f $(TARGETS)

depend:
	$(CC) -M $(CC_FLAGS) *.c > $(DEPEND)

install:
	$(INSTALL) -d $(LIBDIR)
	$(INSTALL) -d $(INCDIR)
	$(INSTALL) -m $(MODE) libtu.a $(LIBDIR)
	$(INSTALL) -m $(MODE) include/* $(INCDIR)

ifeq ($(DEPEND),$(wildcard $(DEPEND)))
include $(DEPEND)
endif

mercurial