1 ## Process this file with automake to produce Makefile.in
3 AUTOMAKE_OPTIONS = subdir-objects
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
11 AM_CPPFLAGS = -I$(top_srcdir)/common -I$(top_srcdir)/include
13 # Needed for the generated files
14 # include/xapian-letor/letor_{error,errordispatch}.h
15 AM_CPPFLAGS += -I'$(top_builddir)/include'
18 AM_CXXFLAGS += $(WERROR)
20 AM_CXXFLAGS += $(XAPIAN_CXXFLAGS)
22 # Order is relevant: when building, tests must be after ".".
23 SUBDIRS = . docs tests
30 MAINTAINERCLEANFILES =
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
44 # Note: We use @PERCENT@ here instead of a literal % to suppress an automake
45 # portability warning.
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
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-letor.lcov
68 lcov --capture -d . --quiet --rc 'lcov_branch_coverage=1' --no-external -o xapian-letor.lcov
70 genhtml --demangle-cpp --branch-coverage $(GENHTML_ARGS) -q -p '$(abs_builddir)' -t "Test Coverage for xapian-letor `git log -n1 --abbrev-commit --format=%h`" -o lcov xapian-letor.lcov
72 # We want to clean out build tree paths from the copy of xapianletor-config we
73 # install, mostly in the interests of facilitating reproducible builds.
74 bin_SCRIPTS = installable/xapianletor-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-letor.
79 installable/xapianletor-config: xapianletor-config
80 $(MKDIR_P) installable
81 $(SED) '/##UNINSTONLYBEGIN/,/##UNINSTONLYEND/d' xapianletor-config > installable/xapianletor-config.tmp
82 mv installable/xapianletor-config.tmp installable/xapianletor-config
84 CLEANFILES += installable/xapianletor-config
86 noinst_SCRIPTS = xapianletor-config
88 DISTCLEANFILES += xapianletor-config
90 EXTRA_DIST = ChangeLog include/xapian-letor/letor_error.h \
91 include/xapian-letor/letor_errordispatch.h generate-exceptions exception_data.pm
93 cmakedir = $(libdir)/cmake/xapian-letor
94 cmake_DATA = cmake/xapianletor-config.cmake cmake/xapianletor-config-version.cmake
96 # Install the m4 file containing the XO_LIB_XAPIANLETOR autoconf macro.
97 m4datadir = $(datadir)/aclocal
98 dist_m4data_DATA = m4-macros/xapianletor.m4
100 lib_LTLIBRARIES = libxapianletor.la
101 libxapianletor_la_SOURCES = $(lib_src)
102 libxapianletor_la_LDFLAGS = \
103 $(XAPIANLETOR_LDFLAGS) $(NO_UNDEFINED) -version-info $(LIBRARY_VERSION_INFO)
105 libxapianletor_la_LIBADD = $(XAPIAN_LIBS) libcommon_str.la
109 if !MAINTAINER_NO_DOCS
113 include api/Makefile.mk
114 include bin/Makefile.mk
115 include include/Makefile.mk
116 include feature/Makefile.mk
117 include ranker/Makefile.mk
118 include scorer/Makefile.mk
120 noinst_LTLIBRARIES += libcommon_str.la libgetopt.la
121 libcommon_str_la_SOURCES = common/str.cc
122 libgetopt_la_SOURCES = common/getopt.cc
124 xapianletorinclude_HEADERS += include/xapian-letor/letor_error.h
127 BUILT_SOURCES += include/xapian-letor/letor_error.h include/xapian-letor/letor_errordispatch.h
129 include/xapian-letor/letor_error.h include/xapian-letor/letor_errordispatch.h: generate-exceptions exception_data.pm
130 $(PERL) -w -I"$(srcdir)" "$(srcdir)/generate-exceptions"
133 MAINTAINERCLEANFILES += $(BUILT_SOURCES)
136 common/alignment_cast.h\
137 common/append_filename_arg.h\
139 common/errno_to_string.h\
143 common/negate_unsigned.h\
151 common/safesysexits.h\
152 common/safesyssocket.h\
153 common/safesysstat.h\
155 common/safewindows.h\
157 common/stringutils.h\
160 DISTCHECK_CONFIGURE_FLAGS = "XAPIAN_CONFIG=$(XAPIAN_CONFIG)"