1 # Makefile for the UCW Library (c) 1997--2006 Martin Mares <mj@ucw.cz>
5 ifdef CONFIG_UCW_DBTOOL
6 PROGS+=$(o)/lib/db-tool
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 \
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 \
25 mainloop exitstatus runcmd sighandler \
26 lizard lizard-safe adler32 \
35 lib.h config.h math.h \
36 mempool.h pagecache.h \
37 sorter.h arraysort.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 \
44 conf.h getopt.h ipaccess.h \
46 fastbuf.h lfs.h ff-utf8.h \
47 chartype.h unicode.h stkstring.h \
48 wildmatch.h patmatch.h \
57 ifdef CONFIG_UCW_THREADS
58 # Some modules require threading
60 LIBUCW_MODS+=workqueue asio
61 LIBUCW_INCLUDES+=workqueue.h asio.h
64 ifdef CONFIG_OWN_REGEX
65 include $(s)/lib/regex/Makefile
68 LIBUCW=$(o)/lib/libucw.$(LS)
69 LIBUCW_MOD_PATHS=$(addprefix $(o)/lib/,$(LIBUCW_MODS))
71 $(o)/lib/libucw.a: $(addsuffix .o,$(LIBUCW_MOD_PATHS))
72 $(o)/lib/libucw.so: $(addsuffix .oo,$(LIBUCW_MOD_PATHS))
74 $(o)/lib/hashfunc.o $(o)/lib/hashfunc.oo: CFLAGS += -funroll-loops
75 $(o)/lib/lizard.o: CFLAGS += $(COPT2) -funroll-loops
77 $(o)/lib/db-test: $(o)/lib/db-test.o $(LIBUCW)
78 $(o)/lib/db-tool: $(o)/lib/db-tool.o $(LIBUCW)
79 $(o)/lib/conf-test: $(o)/lib/conf-test.o $(LIBUCW)
80 $(o)/lib/sort-test: $(o)/lib/sort-test.o $(LIBUCW)
81 $(o)/lib/lfs-test: $(o)/lib/lfs-test.o $(LIBUCW)
82 $(o)/lib/hash-test: $(o)/lib/hash-test.o $(LIBUCW)
83 $(o)/lib/str-test: $(o)/lib/str-test.o $(LIBUCW)
84 $(o)/lib/asort-test: $(o)/lib/asort-test.o $(LIBUCW)
85 $(o)/lib/redblack-test: $(o)/lib/redblack-test.o $(LIBUCW)
86 $(o)/lib/binheap-test: $(o)/lib/binheap-test.o $(LIBUCW)
87 $(o)/lib/lizard-test: $(o)/lib/lizard-test.o $(LIBUCW)
88 $(o)/lib/kmp-test: $(o)/lib/kmp-test.o $(LIBUCW) $(LIBCHARSET)
89 $(o)/lib/ipaccess-test: $(o)/lib/ipaccess-test.o $(LIBUCW)
91 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)
92 $(o)/lib/regex.test: $(o)/lib/regex-t
93 $(o)/lib/unicode-utf8.test: $(o)/lib/unicode-utf8-t
94 $(o)/lib/hash-test.test: $(o)/lib/hash-test
95 $(o)/lib/mempool.test: $(o)/lib/mempool-fmt-t $(o)/lib/mempool-str-t
96 $(o)/lib/stkstring.test: $(o)/lib/stkstring-t
97 $(o)/lib/bitops.test: $(o)/lib/bit-ffs-t $(o)/lib/bit-fls-t
98 $(o)/lib/slists.test: $(o)/lib/slists-t
99 $(o)/lib/kmp-test.test: $(o)/lib/kmp-test
100 $(o)/lib/bbuf.test: $(o)/lib/bbuf-t
101 $(o)/lib/asio.test: $(o)/lib/asio-t
103 INCLUDES+=$(o)/lib/.include-stamp
104 $(o)/lib/.include-stamp: $(addprefix $(s)/lib/,$(LIBUCW_INCLUDES))
105 $(s)/build/install-includes $(s)/lib run/include/lib $(?F)
106 $(s)/build/install-includes $(o)/lib run/include/lib autoconf.h
107 touch $(o)/lib/.include-stamp
109 ifdef CONFIG_UCW_PERL
110 include $(s)/lib/perl/Makefile
113 ifdef CONFIG_UCW_SHELL_UTILS
114 include $(s)/lib/shell/Makefile