Makefile.am 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. ACLOCAL_AMFLAGS = -I m4macros ${ACLOCAL_FLAGS}
  2. # ^^^^^^^^ This has to be the first line and cannot come later in this
  3. # Makefile.am due to some bork in some versions of autotools.
  4. SUBDIRS = compatcheck tools doc . ext src m4macros @PREMIUM_DIR@
  5. USE_LCOV=@USE_LCOV@
  6. LCOV=@LCOV@
  7. GENHTML=@GENHTML@
  8. DISTCHECK_GTEST_CONFIGURE_FLAG=@DISTCHECK_GTEST_CONFIGURE_FLAG@
  9. DISTCHECK_CRYPTO_CONFIGURE_FLAG=@DISTCHECK_CRYPTO_CONFIGURE_FLAG@
  10. DISTCHECK_BOOST_CONFIGURE_FLAG=@DISTCHECK_BOOST_CONFIGURE_FLAG@
  11. DISTCHECK_LOG4CPLUS_CONFIGURE_FLAG=@DISTCHECK_LOG4CPLUS_CONFIGURE_FLAG@
  12. DISTCHECK_KEA_SHELL_CONFIGURE_FLAG=@DISTCHECK_KEA_SHELL_CONFIGURE_FLAG@
  13. DISTCLEANFILES = config.report
  14. # When running distcheck target, do not install the configurations
  15. DISTCHECK_CONFIGURE_FLAGS = --disable-install-configurations
  16. # Use same --with-gtest flag if set
  17. DISTCHECK_CONFIGURE_FLAGS += $(DISTCHECK_GTEST_CONFIGURE_FLAG)
  18. # Keep the crypto backend config
  19. DISTCHECK_CONFIGURE_FLAGS += $(DISTCHECK_CRYPTO_CONFIGURE_FLAG)
  20. # Keep the Boost configuration which becomes sensible
  21. DISTCHECK_CONFIGURE_FLAGS += $(DISTCHECK_BOOST_CONFIGURE_FLAG)
  22. # Keep the log4cplus path too
  23. DISTCHECK_CONFIGURE_FLAGS += $(DISTCHECK_LOG4CPLUS_CONFIGURE_FLAG)
  24. # Keep kea-shell if enabled
  25. DISTCHECK_CONFIGURE_FLAGS += $(DISTCHECK_KEA_SHELL_CONFIGURE_FLAG)
  26. dist_doc_DATA = AUTHORS COPYING ChangeLog README
  27. .PHONY: check-valgrind check-valgrind-suppress
  28. check-valgrind:
  29. if HAVE_VALGRIND
  30. @VALGRIND_COMMAND="$(VALGRIND) -q --gen-suppressions=all --track-origins=yes --num-callers=48 --leak-check=full --fullpath-after=" \
  31. make -C $(abs_top_builddir) check
  32. else
  33. @echo "*** Valgrind is required for check-valgrind ***"; exit 1;
  34. endif
  35. check-valgrind-suppress:
  36. if HAVE_VALGRIND
  37. @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=" \
  38. make -C $(abs_top_builddir) check
  39. else
  40. @echo "*** Valgrind is required for check-valgrind-suppress ***"; exit 1;
  41. endif
  42. clean-cpp-coverage:
  43. @if [ $(USE_LCOV) = yes ] ; then \
  44. $(LCOV) --directory . --zerocounters; \
  45. rm -rf $(abs_top_srcdir)/coverage-cpp-html/; \
  46. else \
  47. echo "C++ code coverage not enabled at configuration time." ; \
  48. echo "Use: ./configure --with-lcov" ; \
  49. fi
  50. perform-coverage: check
  51. report-cpp-coverage:
  52. @if [ $(USE_LCOV) = yes ] ; then \
  53. $(LCOV) --capture --directory . --output-file all.info ; \
  54. $(LCOV) --remove all.info \
  55. c++/4.4\*/\* \
  56. c++/4.4\*/backward/\* \
  57. c++/4.4\*/bits/\* \
  58. c++/4.4\*/ext/\* \
  59. c++/4.4\*/\*-\*/bits/\* \
  60. boost/\* \
  61. if HAVE_BOTAN
  62. botan/\* \
  63. endif
  64. ext/coroutine/\* \
  65. gtest/\* \
  66. include/\* \
  67. log4cplus/\* \
  68. if HAVE_OPENSSL
  69. openssl/\* \
  70. endif
  71. unittests/\* \
  72. \*_unittests.cc \
  73. \*_unittest.cc \
  74. \*_unittests.h \
  75. --output report.info ; \
  76. sed -e "s|$(abs_top_srcdir)|$(abs_top_builddir)|g" < report.info > report.info.2 ; \
  77. $(GENHTML) --legend -o $(abs_top_builddir)/coverage-cpp-html report.info.2 ; \
  78. echo "Generated C++ Code Coverage report in HTML at $(abs_top_builddir)/coverage-cpp-html" ; \
  79. else \
  80. echo "C++ code coverage not enabled at configuration time." ; \
  81. echo "Use: ./configure --with-lcov" ; \
  82. fi
  83. # for c++ test coverage
  84. coverage: clean-coverage perform-coverage report-coverage
  85. clean-coverage: clean-cpp-coverage
  86. report-coverage: report-cpp-coverage
  87. # for static C++ check using cppcheck (when available)
  88. cppcheck:
  89. cppcheck -I./src/lib -I./src/bin --enable=all --suppressions \
  90. src/cppcheck-suppress.lst --inline-suppr \
  91. --quiet --error-exitcode=1 \
  92. --template '{file}:{line}: check_fail: {message} ({severity},{id})' \
  93. src
  94. # These steps are necessary during installation
  95. install-exec-hook:
  96. mkdir -p $(DESTDIR)${localstatedir}/log/
  97. mkdir -p $(DESTDIR)${localstatedir}/run/${PACKAGE_NAME}
  98. EXTRA_DIST = tools/path_replacer.sh
  99. EXTRA_DIST += tools/mk_cfgrpt.sh
  100. #### include external sources in the distributed tarball:
  101. EXTRA_DIST += ext/coroutine/coroutine.h
  102. pkgconfigdir = $(libdir)/pkgconfig
  103. pkgconfig_DATA = dns++.pc
  104. CLEANFILES = $(abs_top_builddir)/logger_lockfile
  105. # config.h may be included by headers supplied for building user-written
  106. # hooks libraries, so we need to include it in the distribution.
  107. pkginclude_HEADERS = config.h