Makefile.am 3.96 KB
Newer Older
1
ACLOCAL_AMFLAGS = -I m4macros ${ACLOCAL_FLAGS}
2 3 4
# ^^^^^^^^ This has to be the first line and cannot come later in this
# Makefile.am due to some bork in some versions of autotools.

5 6
SUBDIRS = compatcheck tools doc . ext src m4macros @PREMIUM_DIR@

7 8 9
USE_LCOV=@USE_LCOV@
LCOV=@LCOV@
GENHTML=@GENHTML@
10
DISTCHECK_GTEST_CONFIGURE_FLAG=@DISTCHECK_GTEST_CONFIGURE_FLAG@
11
DISTCHECK_CRYPTO_CONFIGURE_FLAG=@DISTCHECK_CRYPTO_CONFIGURE_FLAG@
12
DISTCHECK_BOOST_CONFIGURE_FLAG=@DISTCHECK_BOOST_CONFIGURE_FLAG@
13

14 15
DISTCLEANFILES = config.report

16
# When running distcheck target, do not install the configurations
17
DISTCHECK_CONFIGURE_FLAGS = --disable-install-configurations
18

19 20 21
# Use same --with-gtest flag if set
DISTCHECK_CONFIGURE_FLAGS += $(DISTCHECK_GTEST_CONFIGURE_FLAG)

22 23 24
# Keep the crypto backend config
DISTCHECK_CONFIGURE_FLAGS += $(DISTCHECK_CRYPTO_CONFIGURE_FLAG)

25 26 27
# Keep the Boost configuration which becomes sensible
DISTCHECK_CONFIGURE_FLAGS += $(DISTCHECK_BOOST_CONFIGURE_FLAG)

28 29
dist_doc_DATA = AUTHORS COPYING ChangeLog README

30 31 32 33 34 35 36 37 38 39 40 41
.PHONY: check-valgrind check-valgrind-suppress

check-valgrind:
if HAVE_VALGRIND
	@VALGRIND_COMMAND="$(VALGRIND) -q --gen-suppressions=all --track-origins=yes --num-callers=48 --leak-check=full --fullpath-after=" \
	make -C $(abs_top_builddir) check
else
	@echo "*** Valgrind is required for check-valgrind ***"; exit 1;
endif

check-valgrind-suppress:
if HAVE_VALGRIND
42
	@VALGRIND_COMMAND="$(VALGRIND) -q --gen-suppressions=all --track-origins=yes --error-exitcode=1 --suppressions=$(abs_top_srcdir)/src/valgrind-suppressions --suppressions=$(abs_top_srcdir)/src/valgrind-suppressions.revisit --num-callers=48 --leak-check=full --fullpath-after=" \
43 44 45 46 47
	make -C $(abs_top_builddir) check
else
	@echo "*** Valgrind is required for check-valgrind-suppress ***"; exit 1;
endif

48
clean-cpp-coverage:
49 50
	@if [ $(USE_LCOV) = yes ] ; then \
		$(LCOV) --directory . --zerocounters; \
51
		rm -rf $(abs_top_srcdir)/coverage-cpp-html/; \
52
	else \
53 54
		echo "C++ code coverage not enabled at configuration time." ; \
		echo "Use: ./configure --with-lcov" ; \
55 56 57 58
	fi

perform-coverage: check

59
report-cpp-coverage:
60 61 62
	@if [ $(USE_LCOV) = yes ] ; then \
		$(LCOV) --capture --directory . --output-file all.info ; \
		$(LCOV) --remove all.info \
63 64 65 66 67
			c++/4.4\*/\* \
			c++/4.4\*/backward/\* \
			c++/4.4\*/bits/\* \
			c++/4.4\*/ext/\* \
			c++/4.4\*/\*-\*/bits/\* \
68
			boost/\* \
69
if HAVE_BOTAN
70
			botan/\* \
71
endif
72
			ext/coroutine/\* \
73
			gtest/\* \
74
			include/\* \
75 76 77 78
			log4cplus/\* \
if HAVE_OPENSSL
			openssl/\* \
endif
79 80 81 82
			unittests/\* \
			\*_unittests.cc \
			\*_unittest.cc \
			\*_unittests.h \
83
			--output report.info ; \
84 85
		sed -e "s|$(abs_top_srcdir)|$(abs_top_builddir)|g" < report.info > report.info.2 ; \
		$(GENHTML) --legend -o $(abs_top_builddir)/coverage-cpp-html report.info.2 ; \
86
		echo "Generated C++ Code Coverage report in HTML at $(abs_top_builddir)/coverage-cpp-html" ; \
87 88 89 90
	else \
		echo "C++ code coverage not enabled at configuration time." ; \
		echo "Use: ./configure --with-lcov" ; \
	fi
91

92
# for c++ test coverage
93
coverage: clean-coverage perform-coverage report-coverage
94

95
clean-coverage: clean-cpp-coverage
96

97
report-coverage: report-cpp-coverage
98

99 100
# for static C++ check using cppcheck (when available)
cppcheck:
101
	cppcheck -I./src/lib -I./src/bin --enable=all --suppressions \
102
		src/cppcheck-suppress.lst --inline-suppr \
103 104 105 106
		--quiet --error-exitcode=1 \
		--template '{file}:{line}: check_fail: {message} ({severity},{id})' \
		src

Tomek Mrugalski's avatar
Tomek Mrugalski committed
107 108 109
# These steps are necessary during installation
install-exec-hook:
	mkdir -p $(DESTDIR)${localstatedir}/log/
110
	mkdir -p $(DESTDIR)${localstatedir}/run/${PACKAGE_NAME}
Tomek Mrugalski's avatar
Tomek Mrugalski committed
111

Francis Dupont's avatar
Francis Dupont committed
112
EXTRA_DIST  = tools/path_replacer.sh
113
EXTRA_DIST += tools/mk_cfgrpt.sh
114

115
#### include external sources in the distributed tarball:
116
EXTRA_DIST += ext/coroutine/coroutine.h
117 118 119

pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = dns++.pc
120

121
CLEANFILES = $(abs_top_builddir)/logger_lockfile
122

123 124 125
# config.h may be included by headers supplied for building user-written
# hooks libraries, so we need to include it in the distribution.
pkginclude_HEADERS = config.h