]> mj.ucw.cz Git - libucw.git/blob - lib/Makefile
significant simplifications of the interface
[libucw.git] / lib / Makefile
1 # Makefile for the UCW Library (c) 1997--2006 Martin Mares <mj@ucw.cz>
2
3 DIRS+=lib
4
5 ifdef CONFIG_UCW_DBTOOL
6 PROGS+=$(o)/lib/db-tool
7 endif
8
9 # hey dude, I'm Robert!
10 PROGS+=$(o)/lib/conf2-test
11
12 LIBUCW_MODS= \
13         alloc alloc_str realloc mempool mempool-str mempool-fmt \
14         mmap pagecache partmap hashfunc \
15         lists slists sorter bitsig kmp \
16         log log-file proctitle \
17         conf ipaccess \
18         profile \
19         fastbuf ff-printf ff-utf8 \
20         fb-file carefulio fb-mem fb-temp fb-mmap fb-limfd fb-buffer fb-grow \
21         str_ctype str_upper str_lower unicode-utf8 stkstring \
22         wildmatch wordsplit ctmatch patimatch patmatch regex \
23         prime primetable random timer randomkey \
24         bit-ffs bit-fls \
25         db \
26         url \
27         mainloop exitstatus runcmd sighandler \
28         lizard lizard-safe adler32 \
29         md5 md5hex \
30         base64 base224 \
31         sync \
32         qache
33
34 LIBUCW_INCLUDES= \
35         lib.h config.h math.h \
36         mempool.h pagecache.h \
37         sorter.h arraysort.h \
38         lists.h clists.h \
39         unaligned.h prefetch.h \
40         bbuf.h gbuf.h bitarray.h bitsig.h \
41         hashfunc.h hashtable.h \
42         heap.h binheap.h binheap-node.h \
43         redblack.h \
44         conf.h ipaccess.h \
45         profile.h \
46         fastbuf.h lfs.h ff-utf8.h \
47         chartype.h unicode.h stkstring.h \
48         wildmatch.h patmatch.h \
49         db.h \
50         url.h \
51         mainloop.h \
52         lizard.h \
53         md5.h \
54         base64.h base224.h \
55         qache.h
56
57 ifdef CONFIG_OWN_REGEX
58 include $(s)/lib/regex/Makefile
59 endif
60
61 LIBUCW=$(o)/lib/libucw.$(LS)
62 LIBUCW_MOD_PATHS=$(addprefix $(o)/lib/,$(LIBUCW_MODS))
63
64 $(o)/lib/libucw.a: $(addsuffix .o,$(LIBUCW_MOD_PATHS))
65 $(o)/lib/libucw.so: $(addsuffix .oo,$(LIBUCW_MOD_PATHS))
66
67 $(o)/lib/hashfunc.o $(o)/lib/hashfunc.oo: CFLAGS += -funroll-loops
68 $(o)/lib/lizard.o: CFLAGS += $(COPT2) -funroll-loops
69
70 $(o)/lib/db-test: $(o)/lib/db-test.o $(LIBUCW)
71 $(o)/lib/db-tool: $(o)/lib/db-tool.o $(LIBUCW)
72 $(o)/lib/conf-test: $(o)/lib/conf-test.o $(LIBUCW)
73 $(o)/lib/conf2-test: $(o)/lib/conf2-test.o $(LIBUCW)
74 $(o)/lib/sort-test: $(o)/lib/sort-test.o $(LIBUCW)
75 $(o)/lib/lfs-test: $(o)/lib/lfs-test.o $(LIBUCW)
76 $(o)/lib/hash-test: $(o)/lib/hash-test.o $(LIBUCW)
77 $(o)/lib/str-test: $(o)/lib/str-test.o $(LIBUCW)
78 $(o)/lib/asort-test: $(o)/lib/asort-test.o $(LIBUCW)
79 $(o)/lib/redblack-test: $(o)/lib/redblack-test.o $(LIBUCW)
80 $(o)/lib/binheap-test: $(o)/lib/binheap-test.o $(LIBUCW)
81 $(o)/lib/lizard-test: $(o)/lib/lizard-test.o $(LIBUCW)
82 $(o)/lib/kmp-test: $(o)/lib/kmp-test.o $(LIBUCW) $(LIBCHARSET)
83
84 TESTS+=$(addprefix $(o)/lib/,regex.test unicode-utf8.test hash-test.test mempool.test stkstring.test slists.test)
85 $(o)/lib/regex.test: $(o)/lib/regex-t
86 $(o)/lib/unicode-utf8.test: $(o)/lib/unicode-utf8-t
87 $(o)/lib/hash-test.test: $(o)/lib/hash-test
88 $(o)/lib/mempool.test: $(o)/lib/mempool-fmt-t $(o)/lib/mempool-str-t
89 $(o)/lib/stkstring.test: $(o)/lib/stkstring-t
90 $(o)/lib/bitops.test: $(o)/lib/bit-ffs-t $(o)/lib/bit-fls-t
91 $(o)/lib/slists.test: $(o)/lib/slists-t
92
93 INCLUDES+=$(o)/lib/.include-stamp
94 $(o)/lib/.include-stamp: $(addprefix $(s)/lib/,$(LIBUCW_INCLUDES))
95         $(s)/build/install-includes $(s)/lib run/include/lib $(?F)
96         touch $(o)/lib/.include-stamp
97
98 ifdef CONFIG_UCW_PERL
99 include $(s)/lib/perl/Makefile
100 endif
101
102 ifdef CONFIG_UCW_SHELL_UTILS
103 include $(s)/lib/shell/Makefile
104 endif