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