Sat, 04 Nov 2000 21:29:33 +0100
trunk: changeset 31
fix
3 | 1 | ## |
2 | ## libtu Makefile | |
3 | ## | |
0 | 4 | |
3 | 5 | # System-specific configuration is in system.mk |
6 | include system.mk | |
0 | 7 | |
8 | ###################################### | |
9 | ||
5 | 10 | INCLUDES += -I./include |
16 | 11 | CFLAGS += $(POSIX_SOURCE) |
5 | 12 | |
0 | 13 | OBJS= misc.o output.o util.o optparser.o parser.o tokenizer.o |
14 | ||
27 | 15 | ifdef LIBTU_NO_ERRMSG |
28 | 16 | DEFINES += -DLIBTU_NO_ERRMSG |
27 | 17 | else |
25 | 18 | ifndef HAS_SYSTEM_ASPRINTF |
19 | OBJS += ../snprintf_2.2/snprintf.o | |
20 | else | |
28 | 21 | DEFINES += -DHAS_SYSTEM_ASPRINTF |
25 | 22 | endif |
27 | 23 | endif |
25 | 24 | |
0 | 25 | LIBDIR=$(PREFIX)/lib |
26 | INCDIR=$(PREFIX)/include/libtu | |
27 | ||
28 | TARGETS=libtu.a | |
29 | TESTERS=tester tester2 tester3 | |
30 | ||
31 | ###################################### | |
32 | ||
3 | 33 | include rules.mk |
34 | ||
35 | ###################################### | |
0 | 36 | |
37 | testers: $(TESTERS) | |
38 | ||
39 | libtu.a: $(OBJS) | |
9 | 40 | $(AR) $(ARFLAGS) $@ $+ |
0 | 41 | |
8 | 42 | tester: tester.c libtu.a |
9 | 43 | $(CC) $(CFLAGS) $< -L. -ltu -lm -o $@ |
8 | 44 | |
45 | tester2: tester2.c libtu.a | |
9 | 46 | $(CC) $(CFLAGS) $< -L. -ltu -lm -o $@ |
8 | 47 | |
48 | tester3: tester3.c libtu.a | |
9 | 49 | $(CC) $(CFLAGS) $< -L. -ltu -lm -o $@ |
0 | 50 | |
3 | 51 | _install: |
23 | 52 | $(INSTALLDIR) $(LIBDIR) |
53 | $(INSTALLDIR) $(INCDIR) | |
3 | 54 | $(INSTALL) -m $(DATA_MODE) libtu.a $(LIBDIR) |
8 | 55 | for i in include/libtu/*.h; do \ |
56 | $(INSTALL) -m $(DATA_MODE) $$i $(INCDIR); \ | |
57 | done |