]> mj.ucw.cz Git - libucw.git/blob - ucw/Makefile
Configure: Fixed a bug in error handling.
[libucw.git] / ucw / Makefile
1 # Makefile for the UCW Library (c) 1997--2008 Martin Mares <mj@ucw.cz>
2
3 DIRS+=ucw
4 LIBUCW=$(o)/ucw/libucw.pc
5
6 PROGS+=$(o)/ucw/basecode
7
8 LIBUCW_MODS= \
9         threads \
10         alloc alloc_str realloc bigalloc mempool mempool-str mempool-fmt eltpool \
11         mmap partmap hashfunc \
12         slists simple-lists 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-unicode ff-stkstring \
18         fb-file carefulio fb-mem fb-temp tempfile fb-mmap fb-limfd fb-buffer fb-grow fb-pool fb-atomic fb-param fb-socket \
19         char-cat char-upper char-lower unicode stkstring \
20         wildmatch regex \
21         prime primetable random timer randomkey \
22         bit-ffs bit-fls \
23         url \
24         mainloop exitstatus runcmd sighandler \
25         lizard lizard-safe adler32 \
26         md5 sha1 sha1-hmac \
27         base64 base224 \
28         sync \
29         qache \
30         string str-esc str-split str-match str-imatch str-hex \
31         bbuf \
32         getopt
33
34 LIBUCW_INCLUDES= \
35         lib.h config.h threads.h \
36         mempool.h \
37         arraysort.h \
38         clists.h slists.h simple-lists.h \
39         string.h stkstring.h unicode.h chartype.h regex.h \
40         wildmatch.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         binsearch.h prime.h \
47         bitops.h \
48         conf.h getopt.h ipaccess.h \
49         profile.h \
50         fastbuf.h lfs.h ff-unicode.h ff-binary.h \
51         url.h \
52         mainloop.h \
53         lizard.h \
54         md5.h \
55         base64.h base224.h \
56         qache.h \
57         kmp.h kmp-search.h binsearch.h \
58         partmap.h
59
60 ifdef CONFIG_UCW_THREADS
61 # Some modules require threading
62 LIBUCW_MODS+=threads-conf workqueue asio fb-direct
63 LIBUCW_INCLUDES+=workqueue.h semaphore.h asio.h
64 endif
65
66 ifdef CONFIG_OWN_GETOPT
67 include $(s)/ucw/getopt/Makefile
68 endif
69
70 include $(s)/ucw/sorter/Makefile
71 include $(s)/ucw/doc/Makefile
72
73 LIBUCW_MOD_PATHS=$(addprefix $(o)/ucw/,$(LIBUCW_MODS))
74
75 $(o)/ucw/libucw.a: $(addsuffix .o,$(LIBUCW_MOD_PATHS))
76 $(o)/ucw/libucw.so: $(addsuffix .oo,$(LIBUCW_MOD_PATHS))
77
78 $(o)/ucw/hashfunc.o $(o)/ucw/hashfunc.oo: CFLAGS += -funroll-loops
79 $(o)/ucw/lizard.o: CFLAGS += $(COPT2) -funroll-loops
80
81 $(o)/ucw/conf-test: $(o)/ucw/conf-test.o $(LIBUCW)
82 $(o)/ucw/lfs-test: $(o)/ucw/lfs-test.o $(LIBUCW)
83 $(o)/ucw/hash-test: $(o)/ucw/hash-test.o $(LIBUCW)
84 $(o)/ucw/hashfunc-test: $(o)/ucw/hashfunc-test.o $(LIBUCW)
85 $(o)/ucw/asort-test: $(o)/ucw/asort-test.o $(LIBUCW)
86 $(o)/ucw/redblack-test: $(o)/ucw/redblack-test.o $(LIBUCW)
87 $(o)/ucw/binheap-test: $(o)/ucw/binheap-test.o $(LIBUCW)
88 $(o)/ucw/lizard-test: $(o)/ucw/lizard-test.o $(LIBUCW)
89 $(o)/ucw/kmp-test: $(o)/ucw/kmp-test.o $(LIBUCW) $(LIBCHARSET)
90 $(o)/ucw/ipaccess-test: $(o)/ucw/ipaccess-test.o $(LIBUCW)
91 $(o)/ucw/trie-test: $(o)/ucw/trie-test.o $(LIBUCW)
92 $(o)/ucw/basecode: $(o)/ucw/basecode.o $(LIBUCW)
93
94 TESTS+=$(addprefix $(o)/ucw/,regex.test unicode.test hash-test.test mempool.test stkstring.test \
95     slists.test kmp-test.test bbuf.test getopt.test ff-unicode.test eltpool.test \
96     fb-socket.test trie-test.test string.test sha1.test asort-test.test binheap-test.test \
97     redblack-test.test basecode.test fb-file.test fb-grow.test fb-pool.test fb-atomic.test \
98     fb-limfd.test fb-temp.test fb-mem.test fb-buffer.test fb-mmap.test url.test)
99
100 $(o)/ucw/regex.test: $(o)/ucw/regex-t
101 $(o)/ucw/unicode.test: $(o)/ucw/unicode-t
102 $(o)/ucw/hash-test.test: $(o)/ucw/hash-test
103 $(o)/ucw/mempool.test: $(o)/ucw/mempool-t $(o)/ucw/mempool-fmt-t $(o)/ucw/mempool-str-t
104 $(o)/ucw/stkstring.test: $(o)/ucw/stkstring-t
105 $(o)/ucw/bitops.test: $(o)/ucw/bit-ffs-t $(o)/ucw/bit-fls-t
106 $(o)/ucw/slists.test: $(o)/ucw/slists-t
107 $(o)/ucw/kmp-test.test: $(o)/ucw/kmp-test
108 $(o)/ucw/bbuf.test: $(o)/ucw/bbuf-t
109 $(o)/ucw/getopt.test: $(o)/ucw/getopt-t
110 $(o)/ucw/ff-unicode.test: $(o)/ucw/ff-unicode-t
111 $(o)/ucw/eltpool.test: $(o)/ucw/eltpool-t
112 $(o)/ucw/string.test: $(o)/ucw/str-hex-t $(o)/ucw/str-esc-t
113 $(o)/ucw/sha1.test: $(o)/ucw/sha1-t $(o)/ucw/sha1-hmac-t
114 $(o)/ucw/trie-test.test: $(o)/ucw/trie-test
115 $(o)/ucw/asort-test.test: $(o)/ucw/asort-test
116 $(o)/ucw/binheap-test.test: $(o)/ucw/binheap-test
117 $(o)/ucw/redblack-test.test: $(o)/ucw/redblack-test
118 $(o)/ucw/basecode.test: $(o)/ucw/basecode
119 $(addprefix $(o)/ucw/fb-,file.test grow.test pool.test socket.test atomic.test \
120         limfd.test temp.test mem.test buffer.test mmap.test): %.test: %-t
121 $(o)/ucw/fb-atomic-tt.o: CFLAGS += -DFB_ATOMIC_TRACE
122 $(o)/ucw/url.test: $(o)/ucw/url-t
123
124 ifdef CONFIG_UCW_THREADS
125 TESTS+=$(addprefix $(o)/ucw/,asio.test)
126 $(o)/ucw/asio.test: $(o)/ucw/asio-t
127 endif
128
129 API_LIBS+=libucw
130 API_INCLUDES+=$(o)/ucw/.include-stamp
131 $(o)/ucw/.include-stamp: $(addprefix $(s)/ucw/,$(LIBUCW_INCLUDES)) obj/autoconf.h
132         $(Q)$(s)/build/install-includes $(<D) run/include/ucw $(LIBUCW_INCLUDES)
133         $(Q)$(s)/build/install-includes obj run/include/ucw autoconf.h
134         $(Q)touch $@
135 run/lib/pkgconfig/libucw.pc: $(o)/ucw/libucw.pc
136
137 ifdef CONFIG_UCW_PERL
138 include $(s)/ucw/perl/Makefile
139 endif
140
141 ifdef CONFIG_UCW_SHELL_UTILS
142 include $(s)/ucw/shell/Makefile
143 endif