Makefile

Sat, 19 Jan 2002 19:14:36 +0100

author
tuomov
date
Sat, 19 Jan 2002 19:14:36 +0100
changeset 35
5a71d53d0228
parent 34
828f3afd5c76
child 44
71d5a2dee8dc
permissions
-rw-r--r--

trunk: changeset 38
Warning callbacks (thanks to Lukas Schroeder). libtu now depends on
the asprintf functions and one implementation is included in
snprintf_2.2/.

##
## libtu Makefile
##

# System-specific configuration is in system.mk
include system.mk

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

INCLUDES += -I./include
CFLAGS += $(POSIX_SOURCE)

OBJS= misc.o output.o util.o optparser.o parser.o tokenizer.o map.o

ifdef LIBTU_NO_ERRMSG
DEFINES += -DLIBTU_NO_ERRMSG
else
ifndef HAS_SYSTEM_ASPRINTF
OBJS += snprintf_2.2/snprintf.o
else
DEFINES += -DHAS_SYSTEM_ASPRINTF
endif
endif

TARGETS=libtu.a
TESTERS=tester tester2 tester3

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

include rules.mk

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

testers: $(TESTERS)

libtu.a: $(OBJS)
	$(AR) $(ARFLAGS) $@ $+
	$(RANLIB) $@
	
tester: tester.c libtu.a
	$(CC) $(CFLAGS) $< -L. -ltu -lm -o $@

tester2: tester2.c libtu.a
	$(CC) $(CFLAGS) $< -L. -ltu -lm -o $@

tester3: tester3.c libtu.a
	$(CC) $(CFLAGS) $< -L. -ltu -lm -o $@

_install:
	$(INSTALLDIR) $(LIBDIR)
	$(INSTALLDIR) $(INCDIR)/libtu
	$(INSTALL) -m $(DATA_MODE) libtu.a $(LIBDIR)
	for i in include/libtu/*.h; do \
		$(INSTALL) -m $(DATA_MODE) $$i $(INCDIR)/libtu; \
	done

mercurial