Makefile.am 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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 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. clean-python-coverage:
  45. @if [ $(USE_PYCOVERAGE) = yes ] ; then \
  46. rm -f $(abs_top_srcdir)/.coverage ; \
  47. rm -rf $(abs_top_srcdir)/py-coverage-html ; \
  48. else \
  49. echo "Python code coverage not enabled at configuration time." ; \
  50. echo "Use: ./configure --with-pycoverage" ; \
  51. fi
  52. perform-coverage: check
  53. report-cpp-coverage:
  54. @if [ $(USE_LCOV) = yes ] ; then \
  55. $(LCOV) --capture --directory . --output-file all.info ; \
  56. $(LCOV) --remove all.info \
  57. c++/4.4\*/\* \
  58. c++/4.4\*/backward/\* \
  59. c++/4.4\*/bits/\* \
  60. c++/4.4\*/ext/\* \
  61. c++/4.4\*/\*-\*/bits/\* \
  62. boost/\* \
  63. if HAVE_BOTAN
  64. botan/\* \
  65. endif
  66. ext/coroutine/\* \
  67. gtest/\* \
  68. include/\* \
  69. log4cplus/\* \
  70. if HAVE_OPENSSL
  71. openssl/\* \
  72. endif
  73. unittests/\* \
  74. \*_unittests.cc \
  75. \*_unittest.cc \
  76. \*_unittests.h \
  77. --output report.info ; \
  78. sed -e "s|$(abs_top_srcdir)|$(abs_top_builddir)|g" < report.info > report.info.2 ; \
  79. $(GENHTML) --legend -o $(abs_top_builddir)/coverage-cpp-html report.info.2 ; \
  80. echo "Generated C++ Code Coverage report in HTML at $(abs_top_builddir)/coverage-cpp-html" ; \
  81. else \
  82. echo "C++ code coverage not enabled at configuration time." ; \
  83. echo "Use: ./configure --with-lcov" ; \
  84. fi
  85. report-python-coverage:
  86. @if [ $(USE_PYCOVERAGE) = yes ] ; then \
  87. $(PYCOVERAGE) html -d $(abs_top_builddir)/coverage-python-html --omit=src/bin/bind10/tests/,src/bin/bindctl/tests/,src/bin/cfgmgr/tests/,src/bin/cmdctl/tests/,src/bin/loadzone/tests/,src/bin/msgq/tests/,src/bin/stats/tests/,src/bin/tests/,src/bin/xfrin/tests/,src/bin/xfrout/tests/,src/bin/zonemgr/tests/,src/lib/dns/python/tests/,src/lib/dns/tests/,src/lib/python/isc/cc/tests/,src/lib/python/isc/config/tests/,src/lib/python/isc/datasrc/tests/,src/lib/python/isc/log/tests/,src/lib/python/isc/net/tests/,src/lib/python/isc/notify/tests/,src/lib/python/isc/util/tests/ ; \
  88. echo "Generated Python Code Coverage report in HTML at $(abs_top_builddir)/coverage-python-html" ; \
  89. else \
  90. echo "Python code coverage not enabled at configuration time." ; \
  91. echo "Use: ./configure --with-pycoverage" ; \
  92. fi
  93. # for python and c++ test coverage
  94. coverage: clean-coverage perform-coverage report-coverage
  95. clean-coverage: clean-cpp-coverage clean-python-coverage
  96. report-coverage: report-cpp-coverage report-python-coverage
  97. # for static C++ check using cppcheck (when available)
  98. cppcheck:
  99. cppcheck -I./src/lib -I./src/bin --enable=all --suppressions \
  100. src/cppcheck-suppress.lst --inline-suppr \
  101. --quiet --error-exitcode=1 \
  102. --template '{file}:{line}: check_fail: {message} ({severity},{id})' \
  103. src
  104. # These steps are necessary during installation
  105. install-exec-hook:
  106. mkdir -p $(DESTDIR)${localstatedir}/log/
  107. mkdir -p $(DESTDIR)${localstatedir}/run/${PACKAGE_NAME}
  108. ### include tool to generate documentation from log message specifications
  109. ### in the distributed tarball:
  110. EXTRA_DIST = tools/system_messages.py
  111. EXTRA_DIST += tools/path_replacer.sh
  112. EXTRA_DIST += tools/mk_cfgrpt.sh
  113. #### include external sources in the distributed tarball:
  114. EXTRA_DIST += ext/coroutine/coroutine.h
  115. pkgconfigdir = $(libdir)/pkgconfig
  116. pkgconfig_DATA = dns++.pc
  117. CLEANFILES = $(abs_top_builddir)/logger_lockfile
  118. # config.h may be included by headers supplied for building user-written
  119. # hooks libraries, so we need to include it in the distribution.
  120. pkginclude_HEADERS = config.h