10 sed
-e
's/#VERSION#/$(WVPACKAGE_VERSION)/g' < $< > $@
12 ifeq ("$(enable_testgui)", "no")
16 LIBS
+= $(LIBS_XPLC
) -lm
18 ifeq ($(USE_WVSTREAMS_ARGP
),1)
19 utils
/wvargs.o-CPPFLAGS
+= -Iargp
20 libwvutils.so-LIBS
+= -Largp
-largp
21 libwvstatic.a-LIBS
+= -Largp
-largp
22 libargp_a_SOURCES
= argp-ba.c argp-eexst.c argp-fmtstream.c \
23 argp-help.c argp-parse.c argp-pv.c \
25 argp_Os
=$(patsubst %.c
,%.o
,$(libargp_a_SOURCES
)) \
26 $(shell grep
"^LIBOBJS" argp
/Makefile | cut
-d
" " -f1-3
--complement
)
27 argp_OBJS
=$(patsubst %,argp
/%,$(argp_Os
))
29 # argp does its own dependency checking, so let's call it once per wvstreams
30 # build, in case some system dependencies have changed and argp should be
35 $(argp_OBJS
): .argp-phony
42 # libwvbase: a the minimal code needed to link a wvstreams program.
45 utils
/wvbuffer.o utils
/wvbufferstore.o \
48 streams
/wvfdstream.o \
55 utils
/wvscatterhash.o utils
/wvsorter.o \
57 utils
/wvstring.o utils
/wvstringlist.o \
58 utils
/wvstringmask.o \
62 streams
/wvistreamlist.o \
63 utils
/wvstreamsdebugger.o \
67 uniconf
/uniconfgen.o uniconf
/uniconfkey.o uniconf
/uniconfroot.o \
68 uniconf
/unihashtree.o \
69 uniconf
/unimountgen.o \
70 uniconf
/unitempgen.o \
74 utils
/wvstringcache.o \
76 uniconf
/unigenhack.o \
77 uniconf
/unilistiter.o \
79 streams
/wvstreamclone.o \
80 streams
/wvconstream.o \
82 TARGETS
+= libwvbase.so
83 libwvbase_OBJS
+= $(filter-out uniconf
/unigenhack.o
$(WV_EXCLUDES
),$(BASEOBJS
))
84 libwvbase.so
: $(libwvbase_OBJS
) uniconf
/unigenhack.o
85 libwvbase.so-LIBS
+= $(LIBXPLC
)
88 # libwvutils: handy utility library for C++
90 TARGETS
+= libwvutils.so
91 TESTS
+= $(call tests_cc
,utils
/tests
)
92 libwvutils_OBJS
+= $(filter-out $(BASEOBJS
) $(TESTOBJS
),$(call objects
,utils
))
93 libwvutils.so
: $(libwvutils_OBJS
) $(LIBWVBASE
) $(argp_OBJS
)
94 libwvutils.so-LIBS
+= -lz
-lcrypt
$(LIBS_PAM
)
95 utils
/tests
/%: PRELIBS
+=$(LIBWVSTREAMS
)
98 # libwvstreams: stream/event handling library
100 TARGETS
+= libwvstreams.so
101 TARGETS
+= crypto
/tests
/ssltest ipstreams
/tests
/unixtest
102 TARGETS
+= crypto
/tests
/printcert
103 ifneq ("$(with_readline)", "no")
104 TARGETS
+= ipstreams
/tests
/wsd
105 ipstreams
/tests
/wsd-LIBS
+= -lreadline
107 TEST_SKIP_OBJS
+= ipstreams
/tests
/wsd
109 TESTS
+= $(call tests_cc
,configfile
/tests
)
110 TESTS
+= $(call tests_cc
,streams
/tests
)
111 TESTS
+= $(call tests_cc
,ipstreams
/tests
)
112 TESTS
+= $(call tests_cc
,crypto
/tests
)
113 TESTS
+= $(call tests_cc
,urlget
/tests
)
114 TESTS
+= $(call tests_cc
,linuxstreams
/tests
)
115 libwvstreams_OBJS
+= $(filter-out $(BASEOBJS
), \
116 $(call objects
,configfile crypto ipstreams \
117 $(ARCH_SUBDIRS
) streams urlget
))
118 libwvstreams.so
: $(libwvstreams_OBJS
) $(LIBWVUTILS
)
119 libwvstreams.so-LIBS
+= -lz
-lssl
-lcrypto
$(LIBS_PAM
)
120 configfile
/tests
/% streams
/tests
/% ipstreams
/tests
/% crypto
/tests
/% \
121 urlget
/tests
/% linuxstreams
/tests
/%: PRELIBS
+=$(LIBWVSTREAMS
)
124 # libuniconf: unified configuration system
126 TARGETS
+= libuniconf.so
127 TARGETS
+= uniconf
/daemon
/uniconfd uniconf
/tests
/uni
128 TESTS
+= $(call tests_cc
,uniconf
/tests
) uniconf
/tests
/uni
129 libuniconf_OBJS
+= $(filter-out $(BASEOBJS
) uniconf
/daemon
/uniconfd.o
, \
130 $(call objects
,uniconf uniconf
/daemon
))
131 libuniconf.so
: $(libuniconf_OBJS
) $(LIBWVSTREAMS
)
132 uniconf
/daemon
/uniconfd uniconf
/tests
/uni
: $(LIBUNICONF
)
133 uniconf
/daemon
/uniconfd
: uniconf
/daemon
/uniconfd.o
$(LIBUNICONF
)
134 uniconf
/daemon
/uniconfd
: uniconf
/daemon
/uniconfd.ini \
135 uniconf
/daemon
/uniconfd
.8
136 uniconf
/tests
/%: PRELIBS
+=$(LIBUNICONF
)
139 # libwvdbus: C++ DBus library based on wvstreams
141 ifneq ("$(with_dbus)", "no")
142 TARGETS
+= libwvdbus.so
143 TARGETS
+= dbus
/tests
/wvdbus dbus
/tests
/wvdbusd
144 TESTS
+= $(call tests_cc
,dbus
/tests
)
145 libwvdbus_OBJS
+= $(call objects
,dbus
)
146 libwvdbus.so
: $(libwvdbus_OBJS
) $(LIBWVSTREAMS
)
147 libwvdbus.so-LIBS
+= $(LIBS_DBUS
)
148 dbus
/tests
/%: PRELIBS
+=$(LIBWVDBUS
)
150 TEST_SKIP_OBJS
+= dbus
/t
/%
154 # libwvqt: helper library to make WvStreams work better in Qt event loops
156 ifneq ("$(with_qt)", "no")
157 TARGETS
+= libwvqt.so
158 TESTS
+= $(patsubst %.
cc,%,$(wildcard qt
/tests
/*.
cc))
159 libwvqt_OBJS
+= $(call objects
,qt
)
160 libwvqt.so
: $(libwvqt_OBJS
) $(LIBWVSTREAMS
)
161 libwvqt.so-LIBS
+= $(LIBS_QT
)
162 qt
/tests
/%: PRELIBS
+=$(LIBWVQT
)
164 qt
/wvqtstreamclone.o
: include/wvqtstreamclone.moc
165 qt
/wvqthook.o
: include/wvqthook.moc
169 # libwvstatic.a: all the wvstreams libraries in one static .a file, to make
170 # it easy to link your programs statically to wvstreams.
172 TARGETS
+= libwvstatic.a
176 $(libwvstreams_OBJS
) \
180 uniconf
/unigenhack_s.o \
184 # libwvtest: the WvTest tools for writing C++ unit tests
186 TARGETS
+= wvtestmain.o libwvtest.a
187 TESTOBJS
= utils
/wvtest.o
188 libwvtest.a
: wvtestmain.o
$(TESTOBJS
)
191 # Some example programs
193 TARGETS
+= examples
/wvgrep
/wvgrep examples
/wvgrep
/wvegrep
194 examples
/wvgrep
/wvgrep
: examples
/wvgrep
/wvgrep.o
$(LIBWVSTREAMS
)
195 examples
/wvgrep
/wvegrep
: examples
/wvgrep
/wvgrep
199 TARGETS_SO
= $(filter %.so
,$(TARGETS
))
200 TARGETS_A
= $(filter %.a
,$(TARGETS
))
202 all: $(filter-out $(WV_EXCLUDES
), $(TARGETS
))
206 REAL_TESTS
= $(filter-out $(TEST_SKIP_OBJS
), $(TESTS
))
207 $(addsuffix .o
,$(REAL_TESTS
)):
210 test: all tests qtest
212 qtest
: all wvtestmain
213 LD_LIBRARY_PATH
="$(LD_LIBRARY_PATH):$(WVSTREAMS_LIB)" $(WVTESTRUN
) $(MAKE
) runtests
216 $(VALGRIND
) .
/wvtestmain
'$(TESTNAME)'
217 ifeq ("$(TESTNAME)", "")
218 cd uniconf
/tests
&& DAEMON
=0 .
/unitest.sh
219 cd uniconf
/tests
&& DAEMON
=1 .
/unitest.sh
223 $(filter-out $(TEST_SKIP_OBJS
), $(call objects
, $(filter-out win32
/%, \
224 $(shell find .
-type d
-name t
-printf
"%P\n")))) \
225 $(LIBWVDBUS
) $(LIBUNICONF
) $(LIBWVSTREAMS
) $(LIBWVTEST
)
228 rm -f uniconf
/daemon
/uniconfd
.8 uniconf
/tests
/uni
229 rm -f config.mk config.log config.status \
230 include/wvautoconf.h config.cache reconfigure \
231 stamp-h.in configure
include/wvautoconf.h.in
232 rm -rf autom4te.cache
237 @
rm -fv .junk
$(TARGETS
) uniconf
/daemon
/uniconfd \
238 $(TESTS
) tmp
*.ini uniconf
/daemon
/uniconfd.ini \
240 $(shell find .
-name
'*.o' -o
-name
'.*.d' \
241 -o
-name
'*~' -o
-name
'*.moc')
250 kdoc
-f html
-d Docs
/kdoc-html
--name wvstreams
--strip-h-path
*/*.h
258 install install-shared install-dev
uninstall \