]> mj.ucw.cz Git - libucw.git/blob - lib/Makefile
Merge with git+ssh://cvs.ucw.cz/projects/sherlock/GIT/sherlock.git
[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 LIBUCW_MODS= \
10         alloc alloc_str realloc bigalloc mempool mempool-str mempool-fmt \
11         mmap pagecache partmap hashfunc \
12         lists slists simple-lists sorter bitsig \
13         log log-file proctitle \
14         conf-alloc conf-dump conf-input conf-intr conf-journal conf-parse conf-section \
15         ipaccess \
16         profile \
17         fastbuf ff-binary ff-string ff-printf ff-utf8 \
18         fb-file carefulio fb-mem fb-temp fb-mmap fb-limfd fb-buffer fb-grow fb-atomic \
19         str_ctype str_upper str_lower unicode-utf8 stkstring \
20         wildmatch wordsplit ctmatch patimatch patmatch regex \
21         prime primetable random timer randomkey \
22         bit-ffs bit-fls \
23         db \
24         url \
25         mainloop exitstatus runcmd sighandler \
26         lizard lizard-safe adler32 \
27         md5 md5hex \
28         base64 base224 \
29         sync \
30         qache \
31         string \
32         bbuf \
33         workqueue asio
34
35 LIBUCW_INCLUDES= \
36         lib.h config.h math.h \
37         mempool.h pagecache.h \
38         sorter.h arraysort.h \
39         lists.h clists.h \
40         unaligned.h prefetch.h \
41         bbuf.h gbuf.h bitarray.h bitsig.h \
42         hashfunc.h hashtable.h \
43         heap.h binheap.h binheap-node.h \
44         redblack.h \
45         conf.h getopt.h ipaccess.h \
46         profile.h \
47         fastbuf.h lfs.h ff-utf8.h \
48         chartype.h unicode.h stkstring.h \
49         wildmatch.h patmatch.h \
50         db.h \
51         url.h \
52         mainloop.h \
53         lizard.h \
54         md5.h \
55         base64.h base224.h \
56         qache.h \
57         workqueue.h asio.h
58
59 ifdef CONFIG_OWN_REGEX
60 include $(s)/lib/regex/Makefile
61 endif
62
63 LIBUCW=$(o)/lib/libucw.$(LS)
64 LIBUCW_MOD_PATHS=$(addprefix $(o)/lib/,$(LIBUCW_MODS))
65
66 $(o)/lib/libucw.a: $(addsuffix .o,$(LIBUCW_MOD_PATHS))
67 $(o)/lib/libucw.so: $(addsuffix .oo,$(LIBUCW_MOD_PATHS))
68
69 $(o)/lib/hashfunc.o $(o)/lib/hashfunc.oo: CFLAGS += -funroll-loops
70 $(o)/lib/lizard.o: CFLAGS += $(COPT2) -funroll-loops
71
72 $(o)/lib/db-test: $(o)/lib/db-test.o $(LIBUCW)
73 $(o)/lib/db-tool: $(o)/lib/db-tool.o $(LIBUCW)
74 $(o)/lib/conf-test: $(o)/lib/conf-test.o $(LIBUCW)
75 $(o)/lib/sort-test: $(o)/lib/sort-test.o $(LIBUCW)
76 $(o)/lib/lfs-test: $(o)/lib/lfs-test.o $(LIBUCW)
77 $(o)/lib/hash-test: $(o)/lib/hash-test.o $(LIBUCW)
78 $(o)/lib/str-test: $(o)/lib/str-test.o $(LIBUCW)
79 $(o)/lib/asort-test: $(o)/lib/asort-test.o $(LIBUCW)
80 $(o)/lib/redblack-test: $(o)/lib/redblack-test.o $(LIBUCW)
81 $(o)/lib/binheap-test: $(o)/lib/binheap-test.o $(LIBUCW)
82 $(o)/lib/lizard-test: $(o)/lib/lizard-test.o $(LIBUCW)
83 $(o)/lib/kmp-test: $(o)/lib/kmp-test.o $(LIBUCW) $(LIBCHARSET)
84 $(o)/lib/ipaccess-test: $(o)/lib/ipaccess-test.o $(LIBUCW)
85
86 $(o)/lib/workqueue-t: LIBS+=-lpthread  # FIXME
87 $(o)/lib/asio-t: LIBS+=-lpthread  # FIXME
88
89 TESTS+=$(addprefix $(o)/lib/,regex.test unicode-utf8.test hash-test.test mempool.test stkstring.test slists.test kmp-test.test bbuf.test asio.test)
90 $(o)/lib/regex.test: $(o)/lib/regex-t
91 $(o)/lib/unicode-utf8.test: $(o)/lib/unicode-utf8-t
92 $(o)/lib/hash-test.test: $(o)/lib/hash-test
93 $(o)/lib/mempool.test: $(o)/lib/mempool-fmt-t $(o)/lib/mempool-str-t
94 $(o)/lib/stkstring.test: $(o)/lib/stkstring-t
95 $(o)/lib/bitops.test: $(o)/lib/bit-ffs-t $(o)/lib/bit-fls-t
96 $(o)/lib/slists.test: $(o)/lib/slists-t
97 $(o)/lib/kmp-test.test: $(o)/lib/kmp-test
98 $(o)/lib/bbuf.test: $(o)/lib/bbuf-t
99 $(o)/lib/asio.test: $(o)/lib/asio-t
100
101 INCLUDES+=$(o)/lib/.include-stamp
102 $(o)/lib/.include-stamp: $(addprefix $(s)/lib/,$(LIBUCW_INCLUDES))
103         $(s)/build/install-includes $(s)/lib run/include/lib $(?F)
104         $(s)/build/install-includes $(o)/lib run/include/lib autoconf.h
105         touch $(o)/lib/.include-stamp
106
107 ifdef CONFIG_UCW_PERL
108 include $(s)/lib/perl/Makefile
109 endif
110
111 ifdef CONFIG_UCW_SHELL_UTILS
112 include $(s)/lib/shell/Makefile
113 endif