Makefile

Fri, 27 Oct 2000 15:41:36 +0200

author
tuomov
date
Fri, 27 Oct 2000 15:41:36 +0200
changeset 26
ebc92fce5a3c
parent 25
9d41e3611050
child 27
228f64ffb422
permissions
-rw-r--r--

trunk: changeset 29
oops

##
## 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

ifndef HAS_SYSTEM_ASPRINTF
OBJS += ../snprintf_2.2/snprintf.o
else
CFLAGS += -DHAS_SYSTEM_ASPRINTF
endif

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

TARGETS=libtu.a
TESTERS=tester tester2 tester3

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

include rules.mk

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

testers: $(TESTERS)

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

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)
	$(INSTALL) -m $(DATA_MODE) libtu.a $(LIBDIR)
	for i in include/libtu/*.h; do \
		$(INSTALL) -m $(DATA_MODE) $$i $(INCDIR); \
	done

mercurial