Note that ccache 3.0 works with coverage options
[xapian.git] / xapian-core / Makefile.am
blob0dbb41221596f0b86612d5a00dff34f319e1a5de
1 ## Process this file with automake to produce Makefile.in
3 AUTOMAKE_OPTIONS = 1.5 subdir-objects
4 ACLOCAL_AMFLAGS = -I m4
6 if MAINTAINER_MODE
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
10 endif
12 AM_CPPFLAGS = -I$(top_srcdir)/common -I$(top_srcdir)/include
13 if VPATH_BUILD
14 # Needed for the generated files include/xapian/version.h
15 # include/xapian/error.h and include/xapian/errordispatch.h
16 AM_CPPFLAGS += -I'$(top_builddir)/include'
17 endif
19 # Order is relevant: when building, tests must be after ".".
20 SUBDIRS = . docs tests
22 noinst_HEADERS =
23 BUILT_SOURCES =
24 noinst_LTLIBRARIES =
25 CLEANFILES =
26 DISTCLEANFILES =
27 MAINTAINERCLEANFILES =
28 bin_PROGRAMS =
29 EXTRA_PROGRAMS =
31 .PHONY: coverage-reconfigure coverage-reconfigure-maintainer-mode coverage-check
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:
36 #   cd tests ; make check-FOO
38 # So the pain of maintaining a huge list of target forwarding rules here isn't
39 # worth it.
41 # Note: We use @PERCENT@ here instead of a literal % to suppress an automake
42 # portability warning.
43 check-@PERCENT@:
44         cd tests && $(MAKE) $(AM_MAKEFLAGS) $@
46 ## --disable-shared as shared builds fail for me on x86-64 Debian etch.
47 ## CCACHE_DISABLE as ccache 2.4 doesn't handle the .gcno files.  This looks
48 ## like it was fixed in ccache 3.0, but only by not caching, so disabling
49 ## explicitly here is harmless.  If ccache starts to support --coverage
50 ## (3.3.3 doesn't) then we could reasonably just require ccache >= 3.0 is
51 ## used, as 3.0 was released on 2010-06-20.
52 COVERAGE_CONFIGURE = \
53     $(srcdir)/configure CXXFLAGS='-O0 --coverage' \
54     --enable-quiet --disable-shared CCACHE_DISABLE=1 VALGRIND=
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 "`pwd`" -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 noinst_SCRIPTS = xapian-config
76 install-exec-local: xapian-config
77         $(MKDIR_P) "$(DESTDIR)$(bindir)"
78         $(SED) '/##UNINSTONLYBEGIN/,/##UNINSTONLYEND/d' xapian-config > tmp.xc
79         $(INSTALL_SCRIPT) tmp.xc "$(DESTDIR)$(bindir)$$dir/`echo xapian-config|$(SED) -e '$(transform)'`"
80         rm -f tmp.xc
82 uninstall-local:
83         rm -f "$(DESTDIR)$(bindir)$$dir/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.m4
102 # Install the pkg-config file containing the correct compiler options.
103 pkgconfigdir = $(libdir)/pkgconfig
104 nodist_pkgconfig_DATA = pkgconfig/xapian-core.pc
105 DISTCLEANFILES += pkgconfig/xapian-core.pc
107 libxapian_la = libxapian.la
108 lib_LTLIBRARIES = libxapian.la
109 libxapian_la_SOURCES = $(lib_src)
110 libxapian_la_LIBADD = $(XAPIAN_LIBS)
111 libxapian_la_LDFLAGS = \
112     $(XAPIAN_LDFLAGS) $(NO_UNDEFINED) -version-info $(LIBRARY_VERSION_INFO)
114 lib_src =
116 if !MAINTAINER_NO_DOCS
117 dist_man_MANS = xapian-config.1
118 endif
120 include api/Makefile.mk
121 include bin/Makefile.mk
122 include backends/Makefile.mk
123 include common/Makefile.mk
124 include examples/Makefile.mk
125 include expand/Makefile.mk
126 include geospatial/Makefile.mk
127 include include/Makefile.mk
128 include languages/Makefile.mk
129 include matcher/Makefile.mk
130 include net/Makefile.mk
131 include queryparser/Makefile.mk
132 include unicode/Makefile.mk
133 include weight/Makefile.mk
135 xapianinclude_HEADERS += include/xapian/error.h
137 # If these files change, we need to rerun configure to reprocess them -
138 # making them dependencies of config.status achieves that.
139 CONFIG_STATUS_DEPENDENCIES = include/xapian/version_h.cc
141 if MAINTAINER_MODE
142 BUILT_SOURCES += include/xapian/error.h include/xapian/errordispatch.h
144 include/xapian/error.h include/xapian/errordispatch.h: generate-exceptions exception_data.pm
145         $(PERL) -w -I"$(srcdir)" "$(srcdir)/generate-exceptions"
146 endif
148 if !MAINTAINER_NO_DOCS
149 MAINTAINERCLEANFILES += $(dist_man_MANS)
150 endif
152 if DOCUMENTATION_RULES
153 xapian-config.1: xapian-config makemanpage
154         ./makemanpage ./xapian-config xapian-config xapian-config.1
155 endif
157 MAINTAINERCLEANFILES += $(BUILT_SOURCES)
159 .PHONY: check-syntax
161 check-syntax:
162         $(CXXCOMPILE) -fsyntax-only -gstabs+ $(check_sources)