]> granicus.if.org Git - apache/blob - Makefile.in
Follow up to r1835845 and r1839571: CHANGES entry.
[apache] / Makefile.in
1
2 SUBDIRS = srclib os server modules support
3 CLEAN_SUBDIRS = test
4
5 PROGRAM_NAME         = $(progname)
6 PROGRAM_SOURCES      = modules.c
7 PROGRAM_LDADD        = buildmark.o $(HTTPD_LDFLAGS) $(PROGRAM_DEPENDENCIES) $(HTTPD_LIBS) $(EXTRA_LIBS) $(AP_LIBS) $(LIBS)
8 PROGRAM_PRELINK      = $(COMPILE) -c $(top_srcdir)/server/buildmark.c
9 PROGRAM_DEPENDENCIES = \
10   $(BUILTIN_LIBS) \
11   $(MPM_LIB) \
12   server/libmain.la \
13   os/$(OS_DIR)/libos.la
14
15 sbin_PROGRAMS   = $(PROGRAM_NAME)
16 TARGETS         = $(sbin_PROGRAMS) $(shared_build) $(other_targets)
17 INSTALL_TARGETS = install-conf install-htdocs install-error install-icons \
18         install-other install-cgi install-include install-suexec install-build \
19         install-man
20
21 CLEAN_TARGETS  = check/bin/* check/build/config_vars.mk \
22         check/conf/$(PROGRAM_NAME).conf check/conf/magic check/conf/mime.types \
23         check/conf/extra/* check/include/* $(testcase_OBJECTS) $(testcase_STUBS) \
24         test/httpdunit.cases test/unit/*.o
25 DISTCLEAN_TARGETS  = include/ap_config_auto.h include/ap_config_layout.h \
26         include/apache_probes.h \
27         modules.c config.cache config.log config.status build/config_vars.mk \
28         build/rules.mk docs/conf/httpd.conf docs/conf/extra/*.conf shlibtool \
29         build/pkg/pkginfo build/config_vars.sh bsd_converted
30 EXTRACLEAN_TARGETS = configure include/ap_config_auto.h.in generated_lists \
31         httpd.spec
32 PHONY_TARGETS := check check-conf check-dirs check-include unittest-objdir
33
34 TESTS = 
35
36 include $(top_builddir)/build/rules.mk
37 include $(top_srcdir)/build/program.mk
38
39 install-conf:
40         @echo Installing configuration files
41         @$(MKINSTALLDIRS) $(DESTDIR)$(sysconfdir) $(DESTDIR)$(sysconfdir)/extra
42         @$(MKINSTALLDIRS) $(DESTDIR)$(sysconfdir)/original/extra
43         @cd $(top_srcdir)/docs/conf; \
44         for i in mime.types magic; do \
45             if test ! -f $(DESTDIR)$(sysconfdir)/$$i; then \
46                 $(INSTALL_DATA) $$i $(DESTDIR)$(sysconfdir); \
47             fi; \
48         done; \
49         for j in $(top_srcdir)/docs/conf $(top_builddir)/docs/conf ; do \
50             cd $$j ; \
51             for i in httpd.conf extra/*.conf; do \
52                 if [ -f $$i ] ; then \
53                 ( \
54                         n_lm=`awk 'BEGIN {n=0} /@@LoadModule@@/ {n+=1} END {print n}' < $$i`; \
55                         if test $$n_lm -eq 0 -o "x$(MPM_MODULES)$(DSO_MODULES)" = "x"; then \
56                                 sed -e 's#@@ServerRoot@@#$(prefix)#g' \
57                                         -e 's#@@Port@@#$(PORT)#g' \
58                                         -e 's#@@SSLPort@@#$(SSLPORT)#g' \
59                                         -e '/@@LoadModule@@/d' \
60                                         < $$i; \
61                         else \
62                                 sed -n -e '/@@LoadModule@@/q' \
63                                         -e 's#@@ServerRoot@@#$(prefix)#g' \
64                                         -e 's#@@Port@@#$(PORT)#g' \
65                                         -e 's#@@SSLPort@@#$(SSLPORT)#g' \
66                                         -e 'p' \
67                                         < $$i; \
68                                 if echo " $(DSO_MODULES) "|$(EGREP) " cgi " > /dev/null ; then \
69                                         have_cgi="1"; \
70                                 else \
71                                         have_cgi="0"; \
72                                 fi; \
73                                 if echo " $(DSO_MODULES) "|$(EGREP) " cgid " > /dev/null ; then \
74                                         have_cgid="1"; \
75                                 else \
76                                         have_cgid="0"; \
77                                 fi; \
78                                 for j in $(MPM_MODULES) "^EOL^"; do \
79                                         if test $$j != "^EOL^"; then \
80                                                 if echo ",$(ENABLED_MPM_MODULE),"|$(EGREP) ",$$j," > /dev/null ; then \
81                                                         loading_disabled=""; \
82                                                 else \
83                                                         loading_disabled="#"; \
84                                                 fi; \
85                                                 echo "$${loading_disabled}LoadModule $${j}_module $(rel_libexecdir)/mod_$${j}.so"; \
86                                         fi; \
87                                 done; \
88                                 for j in $(DSO_MODULES) "^EOL^"; do \
89                                         if test $$j != "^EOL^"; then \
90                                                 if echo ",$(ENABLED_DSO_MODULES),"|$(EGREP) ",$$j," > /dev/null ; then \
91                                                         loading_disabled=""; \
92                                                 else \
93                                                         loading_disabled="#"; \
94                                                         if test "$(LOAD_ALL_MODULES)" = "yes"; then \
95                                                                 loading_disabled=""; \
96                                                         fi; \
97                                                 fi; \
98                                                 if test $$j = "cgid" -a "$$have_cgi" = "1"; then \
99                                                         echo "<IfModule !mpm_prefork_module>"; \
100                                                         echo "  $${loading_disabled}LoadModule $${j}_module $(rel_libexecdir)/mod_$${j}.so"; \
101                                                         echo "</IfModule>"; \
102                                                 elif test $$j = "cgi" -a "$$have_cgid" = "1"; then \
103                                                         echo "<IfModule mpm_prefork_module>"; \
104                                                         echo "  $${loading_disabled}LoadModule $${j}_module $(rel_libexecdir)/mod_$${j}.so"; \
105                                                         echo "</IfModule>"; \
106                                                 else \
107                                                         echo "$${loading_disabled}LoadModule $${j}_module $(rel_libexecdir)/mod_$${j}.so"; \
108                                                 fi; \
109                                         fi; \
110                                 done; \
111                                 sed -e '1,/@@LoadModule@@/d' \
112                                         -e '/@@LoadModule@@/d' \
113                                         -e 's#@@ServerRoot@@#$(prefix)#g' \
114                                         -e 's#@@Port@@#$(PORT)#g' \
115                                         -e 's#@@SSLPort@@#$(SSLPORT)#g' \
116                                         < $$i; \
117                         fi \
118                 ) > $(DESTDIR)$(sysconfdir)/original/$$i; \
119                 chmod 0644 $(DESTDIR)$(sysconfdir)/original/$$i; \
120                 file=$$i; \
121                 if [ "$$i" = "httpd.conf" ]; then \
122                         file=`echo $$i|sed s/.*.conf/$(PROGRAM_NAME).conf/`; \
123                 fi; \
124                 if test ! -f $(DESTDIR)$(sysconfdir)/$$file; then \
125                         $(INSTALL_DATA) $(DESTDIR)$(sysconfdir)/original/$$i $(DESTDIR)$(sysconfdir)/$$file; \
126                 fi; \
127                 fi; \
128             done ; \
129         done ; \
130         if test -f "$(builddir)/envvars-std"; then \
131             cp -p envvars-std $(DESTDIR)$(sbindir); \
132             if test ! -f $(DESTDIR)$(sbindir)/envvars; then \
133                 cp -p envvars-std $(DESTDIR)$(sbindir)/envvars ; \
134             fi ; \
135         fi
136
137 # Create a sanitized config_vars.mk
138 build/config_vars.out: build/config_vars.mk build/config_vars.sh
139         @$(SHELL) build/config_vars.sh < build/config_vars.mk > build/config_vars.out
140
141 install-build: build/config_vars.out
142         @echo Installing build system files
143         @$(MKINSTALLDIRS) $(DESTDIR)$(installbuilddir)
144         @$(INSTALL_DATA) $(top_srcdir)/build/*.mk build/*.mk \
145                 $(DESTDIR)$(installbuilddir)
146         @$(INSTALL_PROGRAM) $(top_builddir)/config.nice \
147                 $(top_srcdir)/build/mkdir.sh \
148                 $(top_srcdir)/build/instdso.sh \
149                 $(DESTDIR)$(installbuilddir)
150         @$(INSTALL_DATA) build/config_vars.out $(DESTDIR)$(installbuilddir)/config_vars.mk
151         @rm build/config_vars.out
152
153 htdocs-srcdir = $(top_srcdir)/docs/docroot
154
155 docs:
156         @if test -d $(top_srcdir)/docs/manual/build; then \
157             cd $(top_srcdir)/docs/manual/build && ./build.sh all; \
158         else \
159             echo 'For details on generating the docs, please read:'; \
160             echo '  http://httpd.apache.org/docs-project/docsformat.html'; \
161         fi
162
163 validate-xml:
164         @if test -d $(top_srcdir)/docs/manual/build; then \
165             cd $(top_srcdir)/docs/manual/build && ./build.sh validate-xml; \
166         else \
167             echo 'For details on generating the docs, please read:'; \
168             echo '  http://httpd.apache.org/docs-project/docsformat.html'; \
169         fi
170
171 dox:
172         doxygen $(top_srcdir)/docs/doxygen.conf
173
174 install-htdocs:
175         -@if [ -d $(DESTDIR)$(htdocsdir) ]; then \
176            echo "[PRESERVING EXISTING HTDOCS SUBDIR: $(DESTDIR)$(htdocsdir)]"; \
177         else \
178             echo Installing HTML documents ; \
179             $(MKINSTALLDIRS) $(DESTDIR)$(htdocsdir) ; \
180             if test -d $(htdocs-srcdir) && test "x$(RSYNC)" != "x" && test -x $(RSYNC) ; then \
181                 $(RSYNC) --exclude .svn -rlpt --numeric-ids $(htdocs-srcdir)/ $(DESTDIR)$(htdocsdir)/; \
182             else \
183                 test -d $(htdocs-srcdir) && (cd $(htdocs-srcdir) && cp -rp * $(DESTDIR)$(htdocsdir)) ; \
184                 cd $(DESTDIR)$(htdocsdir) && find . -name ".svn" -type d -print | xargs rm -rf 2>/dev/null || true; \
185             fi; \
186         fi
187
188 install-error:
189         -@if [ -d $(DESTDIR)$(errordir) ]; then \
190            echo "[PRESERVING EXISTING ERROR SUBDIR: $(DESTDIR)$(errordir)]"; \
191         else \
192             echo Installing error documents ; \
193             $(MKINSTALLDIRS) $(DESTDIR)$(errordir) ; \
194             cd $(top_srcdir)/docs/error && cp -rp * $(DESTDIR)$(errordir) ; \
195             test "x$(errordir)" != "x" && cd $(DESTDIR)$(errordir) && find . -name ".svn" -type d -print | xargs rm -rf 2>/dev/null || true; \
196         fi
197
198 install-icons:
199         -@if [ -d $(DESTDIR)$(iconsdir) ]; then \
200            echo "[PRESERVING EXISTING ICONS SUBDIR: $(DESTDIR)$(iconsdir)]"; \
201         else \
202             echo Installing icons ; \
203             $(MKINSTALLDIRS) $(DESTDIR)$(iconsdir) ; \
204             cd $(top_srcdir)/docs/icons && cp -rp * $(DESTDIR)$(iconsdir) ; \
205             test "x$(iconsdir)" != "x" && cd $(DESTDIR)$(iconsdir) && find . -name ".svn" -type d -print | xargs rm -rf 2>/dev/null || true; \
206         fi
207
208 install-cgi:
209         -@if [ -d $(DESTDIR)$(cgidir) ];then \
210             echo "[PRESERVING EXISTING CGI SUBDIR: $(DESTDIR)$(cgidir)]"; \
211         else \
212            echo Installing CGIs ; \
213            $(MKINSTALLDIRS) $(DESTDIR)$(cgidir) ; \
214            cd $(top_srcdir)/docs/cgi-examples && cp -rp * $(DESTDIR)$(cgidir) ; \
215            test "x$(cgidir)" != "x" && cd $(DESTDIR)$(cgidir) && find . -name ".svn" -type d -print | xargs rm -rf 2>/dev/null || true; \
216         fi
217
218 install-other:
219         @test -d $(DESTDIR)$(logfiledir) || $(MKINSTALLDIRS) $(DESTDIR)$(logfiledir)
220         @test -d $(DESTDIR)$(runtimedir) || $(MKINSTALLDIRS) $(DESTDIR)$(runtimedir)
221         @for ext in dll x; do \
222                 file=apachecore.$$ext; \
223                 if test -f $$file; then \
224                         cp -p $$file $(DESTDIR)$(libdir); \
225                 fi; \
226         done; \
227         file=httpd.dll; \
228         if test -f $$file; then \
229                 cp -p $$file $(DESTDIR)$(bindir); \
230         fi;
231
232 INSTALL_HEADERS = \
233         include/*.h \
234         $(srcdir)/include/*.h \
235         $(srcdir)/os/$(OS_DIR)/os.h \
236         $(srcdir)/modules/arch/unix/mod_unixd.h \
237         $(srcdir)/modules/core/mod_so.h \
238         $(srcdir)/modules/core/mod_watchdog.h \
239         $(srcdir)/modules/cache/mod_cache.h \
240         $(srcdir)/modules/cache/cache_common.h \
241         $(srcdir)/modules/database/mod_dbd.h \
242         $(srcdir)/modules/dav/main/mod_dav.h \
243         $(srcdir)/modules/http2/mod_http2.h \
244         $(srcdir)/modules/filters/mod_include.h \
245         $(srcdir)/modules/filters/mod_xml2enc.h \
246         $(srcdir)/modules/generators/mod_cgi.h \
247         $(srcdir)/modules/generators/mod_status.h \
248         $(srcdir)/modules/loggers/mod_log_config.h \
249         $(srcdir)/modules/mappers/mod_rewrite.h \
250         $(srcdir)/modules/proxy/mod_proxy.h \
251         $(srcdir)/modules/proxy/mod_serf.h \
252         $(srcdir)/modules/session/mod_session.h \
253         $(srcdir)/modules/ssl/mod_ssl.h \
254         $(srcdir)/modules/ssl/mod_ssl_openssl.h \
255         $(srcdir)/os/$(OS_DIR)/*.h
256
257 install-include:
258         @echo Installing header files
259         @$(MKINSTALLDIRS) $(DESTDIR)$(includedir)
260         @$(INSTALL_DATA) $(INSTALL_HEADERS) $(DESTDIR)$(includedir)
261
262 install-man:
263         @echo Installing man pages and online manual
264         @test -d $(DESTDIR)$(mandir)      || $(MKINSTALLDIRS) $(DESTDIR)$(mandir)
265         @test -d $(DESTDIR)$(mandir)/man1 || $(MKINSTALLDIRS) $(DESTDIR)$(mandir)/man1
266         @test -d $(DESTDIR)$(mandir)/man8 || $(MKINSTALLDIRS) $(DESTDIR)$(mandir)/man8
267         @test -d $(DESTDIR)$(manualdir)   || $(MKINSTALLDIRS) $(DESTDIR)$(manualdir)
268         @cp -p $(top_srcdir)/docs/man/*.1 $(DESTDIR)$(mandir)/man1
269         @cp -p $(top_srcdir)/docs/man/*.8 $(DESTDIR)$(mandir)/man8
270         @if test "x$(RSYNC)" != "x" && test -x $(RSYNC) ; then \
271           $(RSYNC) --exclude .svn -rlpt --numeric-ids $(top_srcdir)/docs/manual/ $(DESTDIR)$(manualdir)/; \
272         else \
273           cd $(top_srcdir)/docs/manual && cp -rp * $(DESTDIR)$(manualdir); \
274           cd $(DESTDIR)$(manualdir) && find . -name ".svn" -type d -print | xargs rm -rf 2>/dev/null || true; \
275         fi
276
277 install-suexec: install-suexec-$(INSTALL_SUEXEC)
278
279 install-suexec-binary:
280         @if test -f $(builddir)/support/suexec; then \
281             test -d $(DESTDIR)$(sbindir) || $(MKINSTALLDIRS) $(DESTDIR)$(sbindir); \
282             $(INSTALL_PROGRAM) $(top_builddir)/support/suexec $(DESTDIR)$(sbindir); \
283         fi
284
285 install-suexec-setuid: install-suexec-binary
286         @if test -f $(builddir)/support/suexec; then \
287             chmod 4755 $(DESTDIR)$(sbindir)/suexec; \
288         fi
289
290 install-suexec-caps: install-suexec-binary
291         @if test -f $(builddir)/support/suexec; then \
292             setcap 'cap_setuid,cap_setgid+pe' $(DESTDIR)$(sbindir)/suexec; \
293         fi
294
295 suexec:
296         cd support && $(MAKE) suexec
297
298 x-local-distclean:
299         @rm -rf autom4te.cache
300
301 update-log-tags update-log-msg-tags:
302         find server modules os -name \*.c|xargs perl \
303                 docs/log-message-tags/update-log-msg-tags
304
305 # XXX: This looks awfully platform-specific [read: bad form and style]
306 include $(top_srcdir)/os/os2/core.mk
307
308 #
309 # In-tree Testing
310 #
311
312 # Installs the include/ header files into the ./check/ directory so we can use
313 # them during `make check`.
314 check-include: override includedir:=$(top_builddir)/check/include
315 check-include: install-include
316
317 # This is basically the same as install-conf, but we only care about the files
318 # necessary to run the test suite, and the LoadModule lines point back to the
319 # build tree. Configuration files will be installed to ./check/conf and pointed
320 # to by ./check/apxs.
321 check-conf:
322         @mkdir -p check/conf/extra; \
323         cd $(top_srcdir)/docs/conf; \
324         for i in mime.types magic; do \
325             $(INSTALL_DATA) $$i $(top_builddir)/check/conf; \
326         done; \
327         for j in $(top_srcdir)/docs/conf $(top_builddir)/docs/conf ; do \
328             cd $$j ; \
329             for i in httpd.conf extra/*.conf; do \
330                 if [ -f $$i ] ; then \
331                 ( \
332                     n_lm=`awk 'BEGIN {n=0} /@@LoadModule@@/ {n+=1} END {print n}' < $$i`; \
333                     if test $$n_lm -eq 0 -o "x$(MPM_MODULES)$(DSO_MODULES)" = "x"; then \
334                         sed -e 's#@@ServerRoot@@#$(top_builddir)/check#g' \
335                             -e 's#@@Port@@#$(PORT)#g' \
336                             -e 's#@@SSLPort@@#$(SSLPORT)#g' \
337                             -e 's#$(prefix)#$(top_builddir)/check#g' \
338                             -e 's/^#ServerName /ServerName /' \
339                             -e '/@@LoadModule@@/d' \
340                             < $$i; \
341                     else \
342                         sed -n -e '/@@LoadModule@@/q' \
343                             -e 's#@@ServerRoot@@#$(top_builddir)/check#g' \
344                             -e 's#@@Port@@#$(PORT)#g' \
345                             -e 's#@@SSLPort@@#$(SSLPORT)#g' \
346                             -e 's#$(prefix)#$(top_builddir)/check#g' \
347                             -e 's/^#ServerName /ServerName /' \
348                             -e 'p' \
349                             < $$i; \
350                         if echo " $(DSO_MODULES) "|$(EGREP) " cgi " > /dev/null ; then \
351                             have_cgi="1"; \
352                         else \
353                             have_cgi="0"; \
354                         fi; \
355                         if echo " $(DSO_MODULES) "|$(EGREP) " cgid " > /dev/null ; then \
356                             have_cgid="1"; \
357                         else \
358                             have_cgid="0"; \
359                         fi; \
360                         for j in $(MPM_MODULES) "^EOL^"; do \
361                             path=$$(find "$(top_builddir)/server" -name "mod_$$j.so"); \
362                             if test $$j != "^EOL^"; then \
363                                 if echo ",$(ENABLED_MPM_MODULE),"|$(EGREP) ",$$j," > /dev/null ; then \
364                                     loading_disabled=""; \
365                                 else \
366                                     loading_disabled="#"; \
367                                 fi; \
368                             echo "$${loading_disabled}LoadModule $${j}_module $${path}"; \
369                         fi; \
370                         done; \
371                         for j in $(DSO_MODULES) "^EOL^"; do \
372                             path=$$(find "$(top_builddir)/modules" -name "mod_$$j.so"); \
373                             if test $$j != "^EOL^"; then \
374                                 if test $$j = "cgid" -a "$$have_cgi" = "1"; then \
375                                     echo "<IfModule !mpm_prefork_module>"; \
376                                     echo "      LoadModule $${j}_module $${path}"; \
377                                     echo "</IfModule>"; \
378                                 elif test $$j = "cgi" -a "$$have_cgid" = "1"; then \
379                                     echo "<IfModule mpm_prefork_module>"; \
380                                     echo "      LoadModule $${j}_module $${path}"; \
381                                     echo "</IfModule>"; \
382                                 else \
383                                     echo "LoadModule $${j}_module $${path}"; \
384                                 fi; \
385                             fi; \
386                         done; \
387                         sed -e '1,/@@LoadModule@@/d' \
388                             -e '/@@LoadModule@@/d' \
389                             -e 's#@@ServerRoot@@#$(top_builddir)/check#g' \
390                             -e 's#@@Port@@#$(PORT)#g' \
391                             -e 's#@@SSLPort@@#$(SSLPORT)#g' \
392                             -e 's#$(prefix)#$(top_builddir)/check#g' \
393                             -e 's/^#ServerName /ServerName /' \
394                             < $$i; \
395                     fi \
396                 ) > $(top_builddir)/check/conf/$$i; \
397                 chmod 0644 $(top_builddir)/check/conf/$$i; \
398                 if [ "$$i" = "httpd.conf" ]; then \
399                     mv "$(top_builddir)/check/conf/$$i" "$(top_builddir)/check/conf/$(PROGRAM_NAME).conf"; \
400                 fi; \
401                 fi; \
402             done ; \
403         done ;
404
405 # Sometimes (e.g. when MPM DSOs are enabled) the test suite runs a full
406 # configuration check on our in-tree build. To pass, we have to have all of the
407 # correct directories, even though they won't be used.
408 check-dirs:
409         @mkdir -p check/htdocs check/logs check/bin
410
411 check-binaries: check/bin/apxs check/bin/httpd check/bin/ab
412
413 check/bin/httpd:
414         ln -s $(top_builddir)/httpd check/bin/httpd
415
416 check/bin/ab:
417         ln -s $(top_builddir)/support/ab check/bin/ab
418
419 # A version of apxs with the PREFIX overridden to point inside the install root
420 check/bin/apxs:
421         mkdir -p check
422         sed -e 's#$(prefix)#$(top_builddir)/check#g' support/apxs > $@
423         chmod +x $@
424
425 # A version of config_vars.mk with PREFIX and SBINDIR and BINDIR overridden.
426 check/build/config_vars.mk: build/config_vars.out
427         mkdir -p check/build
428         cp $< $@
429         echo "prefix = $(top_builddir)/check" >> $@
430         echo "sbindir = $(top_builddir)/check/bin" >> $@
431         echo "bindir = $(top_builddir)/check/bin" >> $@
432
433 # Generate config & modules etc from scratch any time a header file is
434 # touched, so e.g. we don't get MMN mismatch against the modules built
435 # in .../c-modules.
436 $(TEST_SUITE_LOCATION)/Makefile: $(TEST_SUITE_LOCATION)/Makefile.PL $(INSTALL_HEADERS)
437         cd "$(TEST_SUITE_LOCATION)" && \
438             perl Makefile.PL -apxs "$(top_builddir)/check/bin/apxs" && \
439             ./t/TEST -clean && \
440             ./t/TEST -config
441
442 check-make: $(TEST_SUITE_LOCATION)/Makefile
443
444 check-no:
445         @echo 'Re-run configure with the --with-test-suite option to enable in-tree tests.'
446         @false
447
448 check-yes: check-include check-dirs check-conf check/build/config_vars.mk \
449         check-binaries $(TEST_SUITE_LOCATION)/Makefile
450         cd $(TEST_SUITE_LOCATION) && ./t/TEST $(TESTS)
451
452 # Run the Apache::Test suite if it has been configured with --with-test-suite.
453 check: check-$(WITH_TEST_SUITE)
454
455 #
456 # Unit Test Suite
457 #
458
459 # Make sure the object subdirectories we use exist in the build directory during
460 # VPATH builds.
461 unittest-objdir:
462         @mkdir -p test/unit
463
464 # Normally I don't like wildcard sources, but for tests, autodiscovery is the
465 # way to go.
466 testcase_SOURCES := $(patsubst $(top_srcdir)/%,%,$(wildcard $(top_srcdir)/test/unit/*.c))
467 testcase_OBJECTS := $(testcase_SOURCES:%.c=%.lo)
468 testcase_STUBS   := $(testcase_SOURCES:%.c=%.tests)
469
470 # Each testcase depends on the source file as well as the autogenerated .tests
471 # stub.
472 $(testcase_OBJECTS): %.lo: %.c %.tests | unittest-objdir
473
474 $(testcase_STUBS): %.tests: %.c
475         $(top_srcdir)/build/httpdunit_gen_stubs.pl < "$<" > "$@"
476
477 test/httpdunit.cases: $(testcase_SOURCES) | unittest-objdir
478         cat $^ | $(top_srcdir)/build/httpdunit_gen_cases.pl --declaration > $@
479         cat $^ | $(top_srcdir)/build/httpdunit_gen_cases.pl >> $@
480
481 test/httpdunit.lo: test/httpdunit.c test/httpdunit.cases | unittest-objdir
482
483 # httpdunit is only added to $(other_targets) if configure detects a working
484 # libcheck on the system.
485 httpdunit_OBJECTS := test/httpdunit.lo $(testcase_OBJECTS)
486 $(httpdunit_OBJECTS): override LTCFLAGS += $(UNITTEST_CFLAGS)
487 test/httpdunit: $(httpdunit_OBJECTS) $(PROGRAM_DEPENDENCIES) $(PROGRAM_OBJECTS)
488         $(LINK) $(httpdunit_OBJECTS) $(PROGRAM_OBJECTS) $(UNITTEST_LIBS) $(PROGRAM_LDADD)