Makefile.am 3.9 KB

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