1 ## Process this file with automake to produce Makefile.in
3 AUTOMAKE_OPTIONS = 1.12.2 serial-tests subdir-objects
6 # Export these so that we run the locally installed autotools when building
7 # from a bootstrapped git tree.
8 export ACLOCAL AUTOCONF AUTOHEADER AUTOM4TE AUTOMAKE
11 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/common -I$(top_srcdir)/include \
12 -I$(top_srcdir)/include -I$(srcdir)/harness
13 AM_CXXFLAGS = $(XAPIAN_CXXFLAGS)
17 TESTS_ENVIRONMENT = ./runtest
19 .PHONY: up remove-cached-databases
24 ## Test programs to be run
25 TESTS = apitest$(EXEEXT)
31 # Make sure runtest is up to date before running tests
32 check_SCRIPTS = runtest
36 noinst_HEADERS = apitest.h
38 collated_apitest_sources = \
41 apitest_SOURCES = apitest.cc $(collated_apitest_sources) \
42 api_all.h api_collated.h $(testharness_sources)
44 apitest_LDFLAGS = $(NO_INSTALL) $(XAPIAN_LDFLAGS)
45 apitest_LDADD = ../libgetopt.la $(XAPIAN_LIBS) ../libxapianletor.la
50 BUILT_SOURCES += api_all.h api_collated.h $(collated_apitest_sources:.cc=.h) \
53 api_all.h api_collated.h $(collated_apitest_sources:.cc=.h): api_collated.stamp
54 ## Recover from the removal of $@. A full explanation of these rules is in the
55 ## automake manual under the heading "Multiple Outputs".
56 @if test -f $@; then :; else \
57 trap 'rm -rf api_collated.lock api_collated.stamp' 1 2 13 15; \
58 if mkdir api_collated.lock 2>/dev/null; then \
59 rm -f api_collated.stamp; \
60 $(MAKE) $(AM_MAKEFLAGS) api_collated.stamp; \
61 rmdir api_collated.lock; \
63 while test -d api_collated.lock; do sleep 1; done; \
64 test -f api_collated.stamp; exit $$?; \
67 api_collated.stamp: $(collated_apitest_sources) collate-test Makefile.am
68 $(PERL) "$(srcdir)/collate-test" "$(srcdir)" api_collated.h api_all.h $(collated_apitest_sources)
71 api_generated.cc: generate-api_generated
72 $(PERL) "$(srcdir)/generate-api_generated" > api_generated.ccT
73 mv api_generated.ccT api_generated.cc
76 EXTRA_DIST = collate-test generate-api_generated api_all.h api_collated.h \
77 $(collated_apitest_sources:.cc=.h)
79 ## Distribute test data:
83 testdata/apitest_rset.txt \
84 testdata/apitest_phrase.txt \
85 testdata/apitest_allterms4.txt
87 remove-cached-databases:
90 clean-local: remove-cached-databases
92 # Remove the cached databases before "make check" to avoid issues with missing
93 # bugs in database creation when we reuse databases from a previous test run.
94 check: remove-cached-databases
96 include harness/Makefile.mk
98 EXTRA_DIST += zlib-vg.c
100 check_SCRIPTS += zlib-vg.so
101 CLEANFILES += zlib-vg.so
103 zlib-vg.so: zlib-vg.c
104 $(CC) -fPIC -shared -o zlib-vg.so $(srcdir)/zlib-vg.c -ldl
110 $(CXXCOMPILE) -fsyntax-only -gstabs+ $(CHK_SOURCES)