Wed, 20 Dec 2000 20:34:02 +0100
trunk: changeset 32
Use 'ranlib' instead of 'ar s'.
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) $@ $+ |
29 | 41 | $(RANLIB) $@ |
42 | ||
8 | 43 | tester: tester.c libtu.a |
9 | 44 | $(CC) $(CFLAGS) $< -L. -ltu -lm -o $@ |
8 | 45 | |
46 | tester2: tester2.c libtu.a | |
9 | 47 | $(CC) $(CFLAGS) $< -L. -ltu -lm -o $@ |
8 | 48 | |
49 | tester3: tester3.c libtu.a | |
9 | 50 | $(CC) $(CFLAGS) $< -L. -ltu -lm -o $@ |
0 | 51 | |
3 | 52 | _install: |
23 | 53 | $(INSTALLDIR) $(LIBDIR) |
54 | $(INSTALLDIR) $(INCDIR) | |
3 | 55 | $(INSTALL) -m $(DATA_MODE) libtu.a $(LIBDIR) |
8 | 56 | for i in include/libtu/*.h; do \ |
57 | $(INSTALL) -m $(DATA_MODE) $$i $(INCDIR); \ | |
58 | done |