Minor testcase improvements
[xapian.git] / xapian-core / Makefile.am
blobde66afcc067e5be6b5121562b3619db45694aaa7
1 ## Process this file with automake to produce Makefile.in
3 AUTOMAKE_OPTIONS = 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)/common -I$(top_srcdir)/include
12 if VPATH_BUILD
13 # Needed for the generated files include/xapian/version.h
14 # include/xapian/error.h and include/xapian/errordispatch.h
15 AM_CPPFLAGS += -I'$(top_builddir)/include'
16 endif
18 # Order is relevant: when building, tests must be after ".".
19 SUBDIRS = . docs tests
21 noinst_HEADERS =
22 BUILT_SOURCES =
23 noinst_LTLIBRARIES =
24 CLEANFILES =
25 DISTCLEANFILES =
26 MAINTAINERCLEANFILES =
27 bin_PROGRAMS =
28 EXTRA_PROGRAMS =
30 .PHONY: coverage-reconfigure coverage-reconfigure-maintainer-mode coverage-check
32 # This relies on GNU make (for the pattern rule) but it's just a convenience
33 # as you can run these check-* targets with any make using:
35 #   cd tests ; make check-FOO
37 # So the pain of maintaining a huge list of target forwarding rules here isn't
38 # worth it.
40 # Note: We use @PERCENT@ here instead of a literal % to suppress an automake
41 # portability warning.
42 check-@PERCENT@:
43         cd tests && $(MAKE) $(AM_MAKEFLAGS) $@
45 ## --disable-shared as shared builds fail for me on x86-64 Debian etch.
46 ## If you're using ccache, you need ccache >= 3.0, released 2010-06-20 (older
47 ## versions don't handle --coverage properly).  You need ccache >= 3.2.2 to
48 ## actually cache compilations with --coverage - older 3.x just disables
49 ## caching for them.
50 COVERAGE_CONFIGURE = \
51     $(srcdir)/configure CXXFLAGS='-O0 --coverage' --disable-shared VALGRIND=
53 coverage-reconfigure: distclean
54         $(COVERAGE_CONFIGURE)
56 coverage-reconfigure-maintainer-mode: distclean
57         $(COVERAGE_CONFIGURE) --enable-maintainer-mode
59 coverage-check:
60         ## GNU find specific.
61         find . -name '*.gcda' -delete
62         ## Don't run under valgrind even if configure was run by hand.
63         $(MAKE) $(AM_MAKEFLAGS) check VALGRIND=
64         rm -f xapian-core.lcov
65         lcov --capture -d . --quiet --rc 'lcov_branch_coverage=1' --no-external -o xapian-core.lcov
66         rm -rf lcov
67         genhtml --demangle-cpp --branch-coverage $(GENHTML_ARGS) -q -p "`pwd`" -t "Test Coverage for xapian-core `git log -n1 --abbrev-commit --format=%h`" -o lcov xapian-core.lcov
69 # We want to clean out build tree paths from the copy of xapian-config we
70 # install, mostly in the interests of facilitating reproducible builds.
71 bin_SCRIPTS = installable/xapian-config
73 # Create the installable version in a subdirectory.  It's not made executable
74 # until install time, which hopefully should avoid people trying to use it when
75 # building against an uninstalled xapian-core.
76 installable/xapian-config: xapian-config
77         $(MKDIR_P) installable
78         $(SED) '/##UNINSTONLYBEGIN/,/##UNINSTONLYEND/d' xapian-config > installable/xapian-config.tmp
79         mv installable/xapian-config.tmp installable/xapian-config
81 CLEANFILES += installable/xapian-config
83 noinst_SCRIPTS = xapian-config
85 DISTCLEANFILES += xapian-config
87 EXTRA_DIST = ChangeLog ChangeLog.0 ChangeLog.examples HACKING PLATFORMS \
88  xapian-core.spec include/xapian/error.h include/xapian/errordispatch.h \
89  generate-exceptions exception_data.pm preautoreconf
91 cmakedir = $(libdir)/cmake/xapian
92 cmake_DATA = cmake/xapian-config.cmake cmake/xapian-config-version.cmake
94 # docsource.mk is generated by preautoreconf, run by bootstrap prior to
95 # it running autoreconf.
96 include docsource.mk
98 # Install the m4 file containing the XO_LIB_XAPIAN autoconf macro.
99 m4datadir = $(datadir)/aclocal
100 dist_m4data_DATA = m4-macros/xapian-1.5.m4
102 # Install the pkg-config file containing the correct compiler options.
103 pkgconfigdir = $(libdir)/pkgconfig
104 nodist_pkgconfig_DATA = pkgconfig/xapian-core-1.5.pc
105 DISTCLEANFILES += pkgconfig/xapian-core-1.5.pc
107 libxapian_la = libxapian-1.5.la
108 lib_LTLIBRARIES = libxapian-1.5.la
109 libxapian_1_5_la_SOURCES = $(lib_src)
110 libxapian_1_5_la_LIBADD = $(XAPIAN_LIBS)
111 libxapian_1_5_la_LDFLAGS = \
112     $(XAPIAN_LDFLAGS) $(NO_UNDEFINED) -version-info $(LIBRARY_VERSION_INFO) $(lib_ldflags)
114 lib_src =
115 lib_ldflags =
117 if !MAINTAINER_NO_DOCS
118 dist_man_MANS = xapian-config.1
119 endif
121 include api/Makefile.mk
122 include bin/Makefile.mk
123 include backends/Makefile.mk
124 include cluster/Makefile.mk
125 include common/Makefile.mk
126 include examples/Makefile.mk
127 include expand/Makefile.mk
128 include geospatial/Makefile.mk
129 include include/Makefile.mk
130 include languages/Makefile.mk
131 include matcher/Makefile.mk
132 include net/Makefile.mk
133 include queryparser/Makefile.mk
134 include unicode/Makefile.mk
135 include weight/Makefile.mk
137 xapianinclude_HEADERS += include/xapian/error.h
139 # If these files change, we need to rerun configure to reprocess them -
140 # making them dependencies of config.status achieves that.
141 CONFIG_STATUS_DEPENDENCIES = include/xapian/version_h.cc
143 if MAINTAINER_MODE
144 BUILT_SOURCES += include/xapian/error.h include/xapian/errordispatch.h
146 include/xapian/error.h include/xapian/errordispatch.h: generate-exceptions exception_data.pm
147         $(PERL) -w -I"$(srcdir)" "$(srcdir)/generate-exceptions"
148 endif
150 if !MAINTAINER_NO_DOCS
151 MAINTAINERCLEANFILES += $(dist_man_MANS)
152 endif
154 if DOCUMENTATION_RULES
155 xapian-config.1: xapian-config makemanpage
156         ./makemanpage ./xapian-config xapian-config xapian-config.1
157 endif
159 MAINTAINERCLEANFILES += $(BUILT_SOURCES)
161 .PHONY: check-syntax
163 check-syntax:
164         $(CXXCOMPILE) -fsyntax-only -gstabs+ $(check_sources)