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