]> mj.ucw.cz Git - libucw.git/blob - lib/Makefile
XML: Backuped unfinished XML parser.
[libucw.git] / lib / Makefile
1 # Makefile for the UCW Library (c) 1997--2007 Martin Mares <mj@ucw.cz>
2
3 DIRS+=lib
4 CONFIGS+=library
5 LIBUCW=$(o)/lib/libucw.pc
6
7 ifdef CONFIG_UCW_DBTOOL
8 PROGS+=$(o)/lib/db-tool
9 endif
10
11 LIBUCW_MODS= \
12         threads \
13         alloc alloc_str realloc bigalloc mempool mempool-str mempool-fmt eltpool \
14         mmap pagecache partmap hashfunc \
15         lists slists simple-lists bitsig \
16         log log-file proctitle \
17         conf-alloc conf-dump conf-input conf-intr conf-journal conf-parse conf-section \
18         ipaccess \
19         profile \
20         fastbuf ff-binary ff-string ff-printf ff-utf8 \
21         fb-file carefulio fb-mem fb-temp fb-mmap fb-limfd fb-buffer fb-grow fb-pool fb-atomic fb-param \
22         str_ctype str_upper str_lower unicode-utf8 stkstring \
23         wildmatch wordsplit ctmatch patimatch patmatch regex \
24         prime primetable random timer randomkey \
25         bit-ffs bit-fls \
26         db \
27         url \
28         mainloop exitstatus runcmd sighandler \
29         lizard lizard-safe adler32 \
30         md5 md5hex \
31         base64 base224 \
32         sync \
33         qache \
34         string \
35         bbuf \
36         getopt \
37         xml
38
39 LIBUCW_INCLUDES= \
40         lib.h config.h threads.h \
41         mempool.h pagecache.h \
42         arraysort.h \
43         lists.h clists.h slists.h simple-lists.h \
44         unaligned.h prefetch.h \
45         bbuf.h gbuf.h bitarray.h bitsig.h \
46         hashfunc.h hashtable.h \
47         heap.h binheap.h binheap-node.h \
48         redblack.h \
49         binsearch.h \
50         bitops.h \
51         conf.h getopt.h ipaccess.h \
52         profile.h \
53         fastbuf.h lfs.h ff-utf8.h ff-binary.h \
54         chartype.h unicode.h stkstring.h \
55         wildmatch.h patmatch.h \
56         db.h \
57         url.h \
58         mainloop.h \
59         lizard.h \
60         md5.h \
61         base64.h base224.h \
62         qache.h \
63         kmp.h kmp-search.h binsearch.h \
64         partmap.h \
65         xml.h
66
67 ifdef CONFIG_UCW_THREADS
68 # Some modules require threading
69 LIBUCW_MODS+=threads-conf workqueue asio fb-direct
70 LIBUCW_INCLUDES+=workqueue.h semaphore.h asio.h
71 endif
72
73 ifdef CONFIG_OWN_REGEX
74 include $(s)/lib/regex/Makefile
75 endif
76
77 ifdef CONFIG_OWN_GETOPT
78 include $(s)/lib/getopt/Makefile
79 endif
80
81 include $(s)/lib/sorter/Makefile
82
83 LIBUCW_MOD_PATHS=$(addprefix $(o)/lib/,$(LIBUCW_MODS))
84
85 $(o)/lib/libucw.a: $(addsuffix .o,$(LIBUCW_MOD_PATHS))
86 $(o)/lib/libucw.so: $(addsuffix .oo,$(LIBUCW_MOD_PATHS))
87
88 $(o)/lib/hashfunc.o $(o)/lib/hashfunc.oo: CFLAGS += -funroll-loops
89 $(o)/lib/lizard.o: CFLAGS += $(COPT2) -funroll-loops
90
91 $(o)/lib/xml.o: $(o)/lib/xml-ucat.h
92 $(o)/lib/xml-ucat.h: $(s)/lib/xml-ucat.pl
93         $(M)GEN $@
94         $(Q)$< >$@
95
96 $(o)/lib/db-test: $(o)/lib/db-test.o $(LIBUCW)
97 $(o)/lib/db-tool: $(o)/lib/db-tool.o $(LIBUCW)
98 $(o)/lib/conf-test: $(o)/lib/conf-test.o $(LIBUCW)
99 $(o)/lib/lfs-test: $(o)/lib/lfs-test.o $(LIBUCW)
100 $(o)/lib/hash-test: $(o)/lib/hash-test.o $(LIBUCW)
101 $(o)/lib/str-test: $(o)/lib/str-test.o $(LIBUCW)
102 $(o)/lib/asort-test: $(o)/lib/asort-test.o $(LIBUCW)
103 $(o)/lib/redblack-test: $(o)/lib/redblack-test.o $(LIBUCW)
104 $(o)/lib/binheap-test: $(o)/lib/binheap-test.o $(LIBUCW)
105 $(o)/lib/lizard-test: $(o)/lib/lizard-test.o $(LIBUCW)
106 $(o)/lib/kmp-test: $(o)/lib/kmp-test.o $(LIBUCW) $(LIBCHARSET)
107 $(o)/lib/ipaccess-test: $(o)/lib/ipaccess-test.o $(LIBUCW)
108
109 TESTS+=$(addprefix $(o)/lib/,regex.test unicode-utf8.test hash-test.test mempool.test stkstring.test \
110     slists.test kmp-test.test bbuf.test getopt.test fastbuf.test eltpool.test)
111
112 $(o)/lib/regex.test: $(o)/lib/regex-t
113 $(o)/lib/unicode-utf8.test: $(o)/lib/unicode-utf8-t
114 $(o)/lib/hash-test.test: $(o)/lib/hash-test
115 $(o)/lib/mempool.test: $(o)/lib/mempool-t $(o)/lib/mempool-fmt-t $(o)/lib/mempool-str-t
116 $(o)/lib/stkstring.test: $(o)/lib/stkstring-t
117 $(o)/lib/bitops.test: $(o)/lib/bit-ffs-t $(o)/lib/bit-fls-t
118 $(o)/lib/slists.test: $(o)/lib/slists-t
119 $(o)/lib/kmp-test.test: $(o)/lib/kmp-test
120 $(o)/lib/bbuf.test: $(o)/lib/bbuf-t
121 $(o)/lib/getopt.test: $(o)/lib/getopt-t
122 $(o)/lib/fastbuf.test: $(o)/lib/fb-file-t $(o)/lib/fb-grow-t $(o)/lib/fb-pool-t
123 $(o)/lib/eltpool.test: $(o)/lib/eltpool-t
124
125 ifdef CONFIG_UCW_THREADS
126 TESTS+=$(addprefix $(o)/lib/,asio.test)
127 $(o)/lib/asio.test: $(o)/lib/asio-t
128 endif
129
130 API_LIBS+=libucw
131 API_INCLUDES+=$(o)/lib/.include-stamp
132 $(o)/lib/.include-stamp: $(addprefix $(s)/lib/,$(LIBUCW_INCLUDES)) obj/autoconf.h
133         $(Q)$(s)/build/install-includes $(<D) run/include/lib $(LIBUCW_INCLUDES)
134         $(Q)$(s)/build/install-includes obj run/include/lib autoconf.h
135         $(Q)touch $@
136 run/lib/pkgconfig/libucw.pc: $(o)/lib/libucw.pc
137
138 ifdef CONFIG_UCW_PERL
139 include $(s)/lib/perl/Makefile
140 endif
141
142 ifdef CONFIG_UCW_SHELL_UTILS
143 include $(s)/lib/shell/Makefile
144 endif