Thu, 20 Dec 2007 19:04:14 +0100
Added prefix stuff
3 | 1 | ## |
2 | ## libtu Makefile | |
3 | ## | |
0 | 4 | |
3 | 5 | # System-specific configuration is in system.mk |
50 | 6 | TOPDIR=. |
103 | 7 | include $(TOPDIR)/build/system-inc.mk |
0 | 8 | |
9 | ###################################### | |
10 | ||
57 | 11 | CFLAGS += $(C89_SOURCE) $(POSIX_SOURCE) |
5 | 12 | |
60 | 13 | SOURCES=misc.c output.c util.c optparser.c parser.c tokenizer.c \ |
90 | 14 | map.c obj.c objlist.c errorlog.c ptrlist.c rb.c \ |
113 | 15 | stringstore.c iterable.c setparam.c prefix.c |
0 | 16 | |
27 | 17 | ifdef LIBTU_NO_ERRMSG |
28 | 18 | DEFINES += -DLIBTU_NO_ERRMSG |
27 | 19 | else |
25 | 20 | ifndef HAS_SYSTEM_ASPRINTF |
48 | 21 | SOURCES += snprintf_2.2/snprintf.c |
72 | 22 | DEFINES += -DHAVE_SNPRINTF |
25 | 23 | else |
28 | 24 | DEFINES += -DHAS_SYSTEM_ASPRINTF |
25 | 25 | endif |
27 | 26 | endif |
25 | 27 | |
0 | 28 | TARGETS=libtu.a |
29 | TESTERS=tester tester2 tester3 | |
30 | ||
31 | ###################################### | |
32 | ||
102 | 33 | include $(TOPDIR)/build/rules.mk |
3 | 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) |
30 | 54 | $(INSTALLDIR) $(INCDIR)/libtu |
3 | 55 | $(INSTALL) -m $(DATA_MODE) libtu.a $(LIBDIR) |
60 | 56 | for i in *.h; do \ |
30 | 57 | $(INSTALL) -m $(DATA_MODE) $$i $(INCDIR)/libtu; \ |
8 | 58 | done |