1 # Makefile for the UCW Library (c) 1997--2006 Martin Mares <mj@ucw.cz>
6 ifdef CONFIG_UCW_DBTOOL
7 PROGS+=$(o)/lib/db-tool
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 \
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 \
27 mainloop exitstatus runcmd sighandler \
28 lizard lizard-safe adler32 \
38 lib.h config.h threads.h \
39 mempool.h pagecache.h \
40 sorter.h sorter-globals.h arraysort.h \
41 lists.h clists.h slists.h simple-lists.h \
42 unaligned.h prefetch.h \
43 bbuf.h gbuf.h bitarray.h bitsig.h \
44 hashfunc.h hashtable.h \
45 heap.h binheap.h binheap-node.h \
49 conf.h getopt.h ipaccess.h \
51 fastbuf.h lfs.h ff-utf8.h ff-binary.h \
52 chartype.h unicode.h stkstring.h \
53 wildmatch.h patmatch.h \
64 ifdef CONFIG_UCW_THREADS
65 # Some modules require threading
66 LIBUCW_MODS+=threads-conf workqueue
67 LIBUCW_INCLUDES+=workqueue.h semaphore.h
70 ifdef CONFIG_OWN_REGEX
71 include $(s)/lib/regex/Makefile
74 ifdef CONFIG_OWN_GETOPT
75 include $(s)/lib/getopt/Makefile
78 LIBUCW=$(o)/lib/libucw.pc
79 LIBUCW_MOD_PATHS=$(addprefix $(o)/lib/,$(LIBUCW_MODS))
81 $(o)/lib/libucw.a: $(addsuffix .o,$(LIBUCW_MOD_PATHS))
82 $(o)/lib/libucw.so: $(addsuffix .oo,$(LIBUCW_MOD_PATHS))
84 $(o)/lib/hashfunc.o $(o)/lib/hashfunc.oo: CFLAGS += -funroll-loops
85 $(o)/lib/lizard.o: CFLAGS += $(COPT2) -funroll-loops
87 $(o)/lib/db-test: $(o)/lib/db-test.o $(LIBUCW)
88 $(o)/lib/db-tool: $(o)/lib/db-tool.o $(LIBUCW)
89 $(o)/lib/conf-test: $(o)/lib/conf-test.o $(LIBUCW)
90 $(o)/lib/sort-test: $(o)/lib/sort-test.o $(LIBUCW)
91 $(o)/lib/lfs-test: $(o)/lib/lfs-test.o $(LIBUCW)
92 $(o)/lib/hash-test: $(o)/lib/hash-test.o $(LIBUCW)
93 $(o)/lib/str-test: $(o)/lib/str-test.o $(LIBUCW)
94 $(o)/lib/asort-test: $(o)/lib/asort-test.o $(LIBUCW)
95 $(o)/lib/redblack-test: $(o)/lib/redblack-test.o $(LIBUCW)
96 $(o)/lib/binheap-test: $(o)/lib/binheap-test.o $(LIBUCW)
97 $(o)/lib/lizard-test: $(o)/lib/lizard-test.o $(LIBUCW)
98 $(o)/lib/kmp-test: $(o)/lib/kmp-test.o $(LIBUCW) $(LIBCHARSET)
99 $(o)/lib/ipaccess-test: $(o)/lib/ipaccess-test.o $(LIBUCW)
101 TESTS+=$(addprefix $(o)/lib/,regex.test unicode-utf8.test hash-test.test mempool.test stkstring.test \
102 slists.test kmp-test.test bbuf.test getopt.test)
104 $(o)/lib/regex.test: $(o)/lib/regex-t
105 $(o)/lib/unicode-utf8.test: $(o)/lib/unicode-utf8-t
106 $(o)/lib/hash-test.test: $(o)/lib/hash-test
107 $(o)/lib/mempool.test: $(o)/lib/mempool-t $(o)/lib/mempool-fmt-t $(o)/lib/mempool-str-t
108 $(o)/lib/stkstring.test: $(o)/lib/stkstring-t
109 $(o)/lib/bitops.test: $(o)/lib/bit-ffs-t $(o)/lib/bit-fls-t
110 $(o)/lib/slists.test: $(o)/lib/slists-t
111 $(o)/lib/kmp-test.test: $(o)/lib/kmp-test
112 $(o)/lib/bbuf.test: $(o)/lib/bbuf-t
113 $(o)/lib/getopt.test: $(o)/lib/getopt-t
116 API_INCLUDES+=$(o)/lib/.include-stamp
117 $(o)/lib/.include-stamp: $(addprefix $(s)/lib/,$(LIBUCW_INCLUDES))
118 $(Q)$(s)/build/install-includes $(<D) run/include/lib $(?F)
119 # XXX: We do not have a dependency on autoconf.h, but it is generated by configure
120 # before make ever starts, so this is safe.
121 $(Q)$(s)/build/install-includes obj run/include/lib autoconf.h
123 run/lib/pkgconfig/libucw.pc: $(o)/lib/libucw.pc
125 ifdef CONFIG_UCW_PERL
126 include $(s)/lib/perl/Makefile
129 ifdef CONFIG_UCW_SHELL_UTILS
130 include $(s)/lib/shell/Makefile