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