]> mj.ucw.cz Git - libucw.git/blob - lib/Makefile
Added s-fixint module (internal sorter for small fixed-size records).
[libucw.git] / lib / Makefile
1 # Makefile for the UCW Library (c) 1997--2007 Martin Mares <mj@ucw.cz>
2
3 DIRS+=lib
4 LIBUCW=$(o)/lib/libucw.$(LS)
5
6 ifdef CONFIG_UCW_DBTOOL
7 PROGS+=$(o)/lib/db-tool
8 endif
9
10 LIBUCW_MODS= \
11         threads \
12         alloc alloc_str realloc bigalloc mempool mempool-str mempool-fmt \
13         mmap pagecache partmap hashfunc \
14         lists slists simple-lists sorter bitsig \
15         log log-file proctitle \
16         conf-alloc conf-dump conf-input conf-intr conf-journal conf-parse conf-section \
17         ipaccess \
18         profile \
19         fastbuf ff-binary ff-string ff-printf ff-utf8 \
20         fb-file carefulio fb-mem fb-temp fb-mmap fb-limfd fb-buffer fb-grow fb-atomic \
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         string \
34         bbuf
35
36 LIBUCW_INCLUDES= \
37         lib.h config.h threads.h math.h \
38         mempool.h pagecache.h \
39         sorter.h arraysort.h \
40         lists.h clists.h \
41         unaligned.h prefetch.h \
42         bbuf.h gbuf.h bitarray.h bitsig.h \
43         hashfunc.h hashtable.h \
44         heap.h binheap.h binheap-node.h \
45         redblack.h \
46         conf.h getopt.h ipaccess.h \
47         profile.h \
48         fastbuf.h lfs.h ff-utf8.h \
49         chartype.h unicode.h stkstring.h \
50         wildmatch.h patmatch.h \
51         db.h \
52         url.h \
53         mainloop.h \
54         lizard.h \
55         md5.h \
56         base64.h base224.h \
57         qache.h
58
59 ifdef CONFIG_UCW_THREADS
60 # Some modules require threading
61 LIBS+=-lpthread
62 LIBUCW_MODS+=threads-conf workqueue asio fb-direct
63 LIBUCW_INCLUDES+=workqueue.h asio.h
64 endif
65
66 ifdef CONFIG_OWN_REGEX
67 include $(s)/lib/regex/Makefile
68 endif
69
70 include $(s)/lib/sorter/Makefile
71
72 LIBUCW_MOD_PATHS=$(addprefix $(o)/lib/,$(LIBUCW_MODS))
73
74 $(o)/lib/libucw.a: $(addsuffix .o,$(LIBUCW_MOD_PATHS))
75 $(o)/lib/libucw.so: $(addsuffix .oo,$(LIBUCW_MOD_PATHS))
76
77 $(o)/lib/hashfunc.o $(o)/lib/hashfunc.oo: CFLAGS += -funroll-loops
78 $(o)/lib/lizard.o: CFLAGS += $(COPT2) -funroll-loops
79
80 $(o)/lib/db-test: $(o)/lib/db-test.o $(LIBUCW)
81 $(o)/lib/db-tool: $(o)/lib/db-tool.o $(LIBUCW)
82 $(o)/lib/conf-test: $(o)/lib/conf-test.o $(LIBUCW)
83 $(o)/lib/sort-test: $(o)/lib/sort-test.o $(LIBUCW)
84 $(o)/lib/lfs-test: $(o)/lib/lfs-test.o $(LIBUCW)
85 $(o)/lib/hash-test: $(o)/lib/hash-test.o $(LIBUCW)
86 $(o)/lib/str-test: $(o)/lib/str-test.o $(LIBUCW)
87 $(o)/lib/asort-test: $(o)/lib/asort-test.o $(LIBUCW)
88 $(o)/lib/redblack-test: $(o)/lib/redblack-test.o $(LIBUCW)
89 $(o)/lib/binheap-test: $(o)/lib/binheap-test.o $(LIBUCW)
90 $(o)/lib/lizard-test: $(o)/lib/lizard-test.o $(LIBUCW)
91 $(o)/lib/kmp-test: $(o)/lib/kmp-test.o $(LIBUCW) $(LIBCHARSET)
92 $(o)/lib/ipaccess-test: $(o)/lib/ipaccess-test.o $(LIBUCW)
93
94 TESTS+=$(addprefix $(o)/lib/,regex.test unicode-utf8.test hash-test.test mempool.test stkstring.test slists.test kmp-test.test bbuf.test)
95 $(o)/lib/regex.test: $(o)/lib/regex-t
96 $(o)/lib/unicode-utf8.test: $(o)/lib/unicode-utf8-t
97 $(o)/lib/hash-test.test: $(o)/lib/hash-test
98 $(o)/lib/mempool.test: $(o)/lib/mempool-fmt-t $(o)/lib/mempool-str-t
99 $(o)/lib/stkstring.test: $(o)/lib/stkstring-t
100 $(o)/lib/bitops.test: $(o)/lib/bit-ffs-t $(o)/lib/bit-fls-t
101 $(o)/lib/slists.test: $(o)/lib/slists-t
102 $(o)/lib/kmp-test.test: $(o)/lib/kmp-test
103 $(o)/lib/bbuf.test: $(o)/lib/bbuf-t
104
105 ifdef CONFIG_UCW_THREADS
106 TESTS+=$(addprefix $(o)/lib/,asio.test)
107 $(o)/lib/asio.test: $(o)/lib/asio-t
108 endif
109
110 INCLUDES+=$(o)/lib/.include-stamp
111 $(o)/lib/.include-stamp: $(addprefix $(s)/lib/,$(LIBUCW_INCLUDES))
112         $(s)/build/install-includes $(s)/lib run/include/lib $(?F)
113         $(s)/build/install-includes $(o)/lib run/include/lib autoconf.h
114         touch $(o)/lib/.include-stamp
115
116 ifdef CONFIG_UCW_PERL
117 include $(s)/lib/perl/Makefile
118 endif
119
120 ifdef CONFIG_UCW_SHELL_UTILS
121 include $(s)/lib/shell/Makefile
122 endif