Makefile.am 4.29 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
DISTCHECK_LOG4CPLUS_CONFIGURE_FLAG=@DISTCHECK_LOG4CPLUS_CONFIGURE_FLAG@
DISTCHECK_KEA_SHELL_CONFIGURE_FLAG=@DISTCHECK_KEA_SHELL_CONFIGURE_FLAG@
15

16 17
DISTCLEANFILES = config.report

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

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

24 25 26
# Keep the crypto backend config
DISTCHECK_CONFIGURE_FLAGS += $(DISTCHECK_CRYPTO_CONFIGURE_FLAG)

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

30 31 32 33 34 35
# Keep the log4cplus path too
DISTCHECK_CONFIGURE_FLAGS += $(DISTCHECK_LOG4CPLUS_CONFIGURE_FLAG)

# Keep kea-shell if enabled
DISTCHECK_CONFIGURE_FLAGS += $(DISTCHECK_KEA_SHELL_CONFIGURE_FLAG)

36 37
dist_doc_DATA = AUTHORS COPYING ChangeLog README

38 39 40 41 42 43 44 45 46 47 48 49
.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
50
	@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=" \
51 52 53 54 55
	make -C $(abs_top_builddir) check
else
	@echo "*** Valgrind is required for check-valgrind-suppress ***"; exit 1;
endif

56
clean-cpp-coverage:
57 58
	@if [ $(USE_LCOV) = yes ] ; then \
		$(LCOV) --directory . --zerocounters; \
59
		rm -rf $(abs_top_srcdir)/coverage-cpp-html/; \
60
	else \
61 62
		echo "C++ code coverage not enabled at configuration time." ; \
		echo "Use: ./configure --with-lcov" ; \
63 64 65 66
	fi

perform-coverage: check

67
report-cpp-coverage:
68 69 70
	@if [ $(USE_LCOV) = yes ] ; then \
		$(LCOV) --capture --directory . --output-file all.info ; \
		$(LCOV) --remove all.info \
71 72 73 74 75
			c++/4.4\*/\* \
			c++/4.4\*/backward/\* \
			c++/4.4\*/bits/\* \
			c++/4.4\*/ext/\* \
			c++/4.4\*/\*-\*/bits/\* \
76
			boost/\* \
77
if HAVE_BOTAN
78
			botan/\* \
79
endif
80
			ext/coroutine/\* \
81
			gtest/\* \
82
			include/\* \
83 84 85 86
			log4cplus/\* \
if HAVE_OPENSSL
			openssl/\* \
endif
87 88 89 90
			unittests/\* \
			\*_unittests.cc \
			\*_unittest.cc \
			\*_unittests.h \
91
			--output report.info ; \
92 93
		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 ; \
94
		echo "Generated C++ Code Coverage report in HTML at $(abs_top_builddir)/coverage-cpp-html" ; \
95 96 97 98
	else \
		echo "C++ code coverage not enabled at configuration time." ; \
		echo "Use: ./configure --with-lcov" ; \
	fi
99

100
# for c++ test coverage
101
coverage: clean-coverage perform-coverage report-coverage
102

103
clean-coverage: clean-cpp-coverage
104

105
report-coverage: report-cpp-coverage
106

107 108
# for static C++ check using cppcheck (when available)
cppcheck:
109
	cppcheck -I./src/lib -I./src/bin --enable=all --suppressions \
110
		src/cppcheck-suppress.lst --inline-suppr \
111 112 113 114
		--quiet --error-exitcode=1 \
		--template '{file}:{line}: check_fail: {message} ({severity},{id})' \
		src

Tomek Mrugalski's avatar
Tomek Mrugalski committed
115 116 117
# These steps are necessary during installation
install-exec-hook:
	mkdir -p $(DESTDIR)${localstatedir}/log/
118
	mkdir -p $(DESTDIR)${localstatedir}/run/${PACKAGE_NAME}
Tomek Mrugalski's avatar
Tomek Mrugalski committed
119

Francis Dupont's avatar
Francis Dupont committed
120
EXTRA_DIST  = tools/path_replacer.sh
121
EXTRA_DIST += tools/mk_cfgrpt.sh
122

123
#### include external sources in the distributed tarball:
124
EXTRA_DIST += ext/coroutine/coroutine.h
125 126 127

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

129
CLEANFILES = $(abs_top_builddir)/logger_lockfile
130

131 132 133
# 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