[letor] Fix to use correct XAPIAN_LDFLAGS
[xapian.git] / xapian-letor / tests / Makefile.am
blobf76f59956dd4add4b31cfe980a01bd4d9db36b22
1 ## Process this file with automake to produce Makefile.in
3 AUTOMAKE_OPTIONS = 1.12.2 serial-tests subdir-objects
5 if MAINTAINER_MODE
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
9 endif
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)
15 CLEANFILES =
17 TESTS_ENVIRONMENT = ./runtest
19 .PHONY: up remove-cached-databases
21 up:
22         cd .. && $(MAKE)
24 ## Test programs to be run
25 TESTS = apitest$(EXEEXT)
27 ## Programs to build
28 check_PROGRAMS = \
29         apitest
31 # Make sure runtest is up to date before running tests
32 check_SCRIPTS = runtest
34 ## Sources:
36 noinst_HEADERS = apitest.h
38 collated_apitest_sources = \
39  api_generated.cc
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
47 BUILT_SOURCES =
49 if MAINTAINER_MODE
50 BUILT_SOURCES += api_all.h api_collated.h $(collated_apitest_sources:.cc=.h) \
51  api_generated.cc
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; \
62           else \
63             while test -d api_collated.lock; do sleep 1; done; \
64             test -f api_collated.stamp; exit $$?; \
65           fi; \
66         fi
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)
69         touch $@
71 api_generated.cc: generate-api_generated
72         $(PERL) "$(srcdir)/generate-api_generated" > api_generated.ccT
73         mv api_generated.ccT api_generated.cc
74 endif
76 EXTRA_DIST = collate-test generate-api_generated api_all.h api_collated.h \
77         $(collated_apitest_sources:.cc=.h)
79 ## Distribute test data:
80 EXTRA_DIST +=\
81         runtest.in \
82         valgrind.supp \
83         testdata/apitest_rset.txt \
84         testdata/apitest_phrase.txt \
85         testdata/apitest_allterms4.txt
87 remove-cached-databases:
88         rm -rf .letor-db
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
99 if USE_ZLIB_VG
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
105 endif
107 .PHONY: check-syntax
109 check-syntax:
110         $(CXXCOMPILE) -fsyntax-only -gstabs+ $(CHK_SOURCES)