git-tag-release: Fix bashism
[xapian.git] / xapian-core / Makefile.am
blobde1a63f2ca87c40202b0b60be2afba73a147a05e
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_CXXFLAGS += $(WERROR)
13 AM_CPPFLAGS = -I$(top_srcdir)/common -I$(top_srcdir)/include
14 if VPATH_BUILD
15 # Needed for the generated files include/xapian/version.h
16 # include/xapian/error.h and include/xapian/errordispatch.h
17 AM_CPPFLAGS += -I'$(top_builddir)/include'
18 endif
19 AM_CPPFLAGS += $(ICU_CPPFLAGS)
20 AM_CXXFLAGS += $(ICU_CFLAGS)
22 # Order is relevant: when building, tests must be after ".".
23 SUBDIRS = . docs tests
25 noinst_HEADERS =
26 BUILT_SOURCES =
27 noinst_LTLIBRARIES =
28 CLEANFILES =
29 DISTCLEANFILES =
30 MAINTAINERCLEANFILES =
31 bin_PROGRAMS =
32 EXTRA_PROGRAMS =
34 .PHONY: coverage-reconfigure coverage-reconfigure-maintainer-mode coverage-check
36 # This relies on GNU make (for the pattern rule) but it's just a convenience
37 # as you can run these check-* targets with any make using:
39 #   cd tests ; make check-FOO
41 # So the pain of maintaining a huge list of target forwarding rules here isn't
42 # worth it.
44 # Note: We use @PERCENT@ here instead of a literal % to suppress an automake
45 # portability warning.
46 check-@PERCENT@:
47         cd tests && $(MAKE) $(AM_MAKEFLAGS) $@
49 ## -O0 - optimisation can result in confusing coverage reports.
50 ## --coverage - inserts code to generate coverage data
51 ## VALGRIND= - generating coverage data is slow enough by itself.
52 COVERAGE_CONFIGURE = \
53     $(srcdir)/configure CXXFLAGS='-O0 --coverage' VALGRIND= \
54         $(COVERAGE_CONFIGURE_ARGS)
56 coverage-reconfigure: distclean
57         $(COVERAGE_CONFIGURE)
59 coverage-reconfigure-maintainer-mode: distclean
60         $(COVERAGE_CONFIGURE) --enable-maintainer-mode
62 coverage-check:
63         ## GNU find specific.
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
69         rm -rf 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  include/xapian/error.h include/xapian/errordispatch.h \
92  generate-exceptions exception_data.pm preautoreconf
94 EXTRA_DIST += \
95  emscripten/README.md \
96  emscripten/xapianjstest.cc
98 cmakedir = $(libdir)/cmake/xapian
99 cmake_DATA = cmake/xapian-config.cmake cmake/xapian-config-version.cmake
101 # docsource.mk is generated by preautoreconf, run by bootstrap prior to
102 # it running autoreconf.
103 include docsource.mk
105 # Install the m4 file containing the XO_LIB_XAPIAN autoconf macro.
106 m4datadir = $(datadir)/aclocal
107 dist_m4data_DATA = m4-macros/xapian-1.5.m4
109 # Install the pkg-config file containing the correct compiler options.
110 pkgconfigdir = $(libdir)/pkgconfig
111 nodist_pkgconfig_DATA = pkgconfig/xapian-core-1.5.pc
112 DISTCLEANFILES += pkgconfig/xapian-core-1.5.pc
114 libxapian_la = libxapian-1.5.la
115 lib_LTLIBRARIES = libxapian-1.5.la
116 libxapian_1_5_la_SOURCES = $(lib_src)
117 libxapian_1_5_la_LIBADD = $(XAPIAN_LIBS) $(ICU_LIBS)
118 libxapian_1_5_la_LDFLAGS = \
119     $(XAPIAN_LDFLAGS) $(NO_UNDEFINED) -version-info $(LIBRARY_VERSION_INFO) $(lib_ldflags)
121 lib_src =
122 lib_ldflags =
124 if !MAINTAINER_NO_DOCS
125 dist_man_MANS = xapian-config.1
126 endif
128 include api/Makefile.mk
129 include bin/Makefile.mk
130 include backends/Makefile.mk
131 include cluster/Makefile.mk
132 include common/Makefile.mk
133 include diversify/Makefile.mk
134 include examples/Makefile.mk
135 include expand/Makefile.mk
136 include geospatial/Makefile.mk
137 include include/Makefile.mk
138 include languages/Makefile.mk
139 include matcher/Makefile.mk
140 include net/Makefile.mk
141 include queryparser/Makefile.mk
142 include unicode/Makefile.mk
143 include weight/Makefile.mk
145 xapianinclude_HEADERS += include/xapian/error.h
147 # If these files change, we need to rerun configure to reprocess them -
148 # making them dependencies of config.status achieves that.
149 CONFIG_STATUS_DEPENDENCIES = include/xapian/version_h.cc
151 if MAINTAINER_MODE
152 BUILT_SOURCES += include/xapian/error.h include/xapian/errordispatch.h
154 include/xapian/error.h include/xapian/errordispatch.h: generate-exceptions exception_data.pm
155         $(PERL) -w -I"$(srcdir)" "$(srcdir)/generate-exceptions"
156 endif
158 if !MAINTAINER_NO_DOCS
159 MAINTAINERCLEANFILES += $(dist_man_MANS)
160 endif
162 if DOCUMENTATION_RULES
163 xapian-config.1: xapian-config makemanpage
164         ./makemanpage ./xapian-config xapian-config xapian-config.1
165 endif
167 MAINTAINERCLEANFILES += $(BUILT_SOURCES)
169 .PHONY: check-syntax
171 check-syntax:
172         $(CXXCOMPILE) -fsyntax-only -gstabs+ $(check_sources)