Makefile.am 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. # Copyright (c) 2001-2004, Roger Dingledine
  2. # Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson
  3. # Copyright (c) 2007-2015, The Tor Project, Inc.
  4. # See LICENSE for licensing information
  5. # "foreign" means we don't follow GNU package layout standards
  6. # 1.9 means we require automake vesion 1.9
  7. AUTOMAKE_OPTIONS = foreign 1.9 subdir-objects
  8. ACLOCAL_AMFLAGS = -I m4
  9. noinst_LIBRARIES=
  10. EXTRA_DIST=
  11. noinst_HEADERS=
  12. bin_PROGRAMS=
  13. CLEANFILES=
  14. TESTS=
  15. noinst_PROGRAMS=
  16. DISTCLEANFILES=
  17. bin_SCRIPTS=
  18. AM_CPPFLAGS=
  19. AM_CFLAGS = @TOR_SYSTEMD_CFLAGS@
  20. SHELL = @SHELL@
  21. include src/include.am
  22. include doc/include.am
  23. include contrib/include.am
  24. EXTRA_DIST+= \
  25. ChangeLog \
  26. INSTALL \
  27. LICENSE \
  28. Makefile.nmake \
  29. README \
  30. ReleaseNotes
  31. if COVERAGE_ENABLED
  32. TEST_CFLAGS=-fno-inline -fprofile-arcs -ftest-coverage
  33. else
  34. TEST_CFLAGS=
  35. endif
  36. #install-data-local:
  37. # $(INSTALL) -m 755 -d $(LOCALSTATEDIR)/lib/tor
  38. # Allows to override rpmbuild with rpmbuild-md5 from fedora-packager so that
  39. # building for EL5 won't fail on https://bugzilla.redhat.com/show_bug.cgi?id=490613
  40. RPMBUILD ?= rpmbuild
  41. # Use automake's dist-gzip target to build the tarball
  42. dist-rpm: dist-gzip
  43. TIMESTAMP=$$(date +"%Y-%m-%d_%H.%M.%S"); \
  44. RPM_BUILD_DIR=$$(mktemp -d "/tmp/tor-rpm-build-$$TIMESTAMP-XXXX"); \
  45. mkdir -p "$$RPM_BUILD_DIR"/{BUILD,RPMS,SOURCES/"tor-$(VERSION)",SPECS,SRPMS}; \
  46. cp -fa "$(distdir).tar.gz" "$$RPM_BUILD_DIR"/SOURCES/; \
  47. LIBS=-lrt $(RPMBUILD) -ba --define "_topdir $$RPM_BUILD_DIR" tor.spec; \
  48. cp -fa "$$RPM_BUILD_DIR"/SRPMS/* .; \
  49. cp -fa "$$RPM_BUILD_DIR"/RPMS/* .; \
  50. rm -rf "$$RPM_BUILD_DIR"; \
  51. echo "RPM build finished"; \
  52. #end of dist-rpm
  53. dist: check
  54. doxygen:
  55. doxygen && cd doc/doxygen/latex && make
  56. test: all
  57. $(top_builddir)/src/test/test
  58. # Note that test-network requires a copy of Chutney in $CHUTNEY_PATH.
  59. # Chutney can be cloned from https://git.torproject.org/chutney.git .
  60. test-network: all
  61. $(top_srcdir)/src/test/test-network.sh
  62. test-stem: $(TESTING_TOR_BINARY)
  63. @if test -d "$$STEM_SOURCE_DIR"; then \
  64. $(PYTHON) "$$STEM_SOURCE_DIR"/run_tests.py --tor $(TESTING_TOR_BINARY) --all --log notice --target RUN_ALL; \
  65. else \
  66. echo '$$STEM_SOURCE_DIR was not set.'; echo; \
  67. echo "To run these tests, git clone https://git.torproject.org/stem.git/ ; export STEM_SOURCE_DIR=\`pwd\`/stem"; \
  68. fi
  69. reset-gcov:
  70. rm -f $(top_builddir)/src/*/*.gcda $(top_builddir)/src/*/*/*.gcda
  71. HTML_COVER_DIR=$(top_builddir)/coverage_html
  72. coverage-html: all
  73. test -e "`which lcov`" || (echo "lcov must be installed. See <http://ltp.sourceforge.net/coverage/lcov.php>." && false)
  74. test -d "$(HTML_COVER_DIR)" || $(MKDIR_P) "$(HTML_COVER_DIR)"
  75. lcov --rc lcov_branch_coverage=1 --directory $(top_builddir)/src --zerocounters
  76. $(MAKE) reset-gcov
  77. $(MAKE) check
  78. lcov --capture --rc lcov_branch_coverage=1 --no-external --directory $(top_builddir) --base-directory $(top_srcdir) --output-file "$(HTML_COVER_DIR)/lcov.tmp"
  79. lcov --remove "$(HTML_COVER_DIR)/lcov.tmp" --rc lcov_branch_coverage=1 'test/*' 'ext/tinytest*' '/usr/*' --output-file "$(HTML_COVER_DIR)/lcov.info"
  80. genhtml --branch-coverage -o "$(HTML_COVER_DIR)" "$(HTML_COVER_DIR)/lcov.info"
  81. # Avoid strlcpy.c, strlcat.c, aes.c, OpenBSD_malloc_Linux.c, sha256.c,
  82. # eventdns.[hc], tinytest*.[ch]
  83. check-spaces:
  84. $(top_srcdir)/scripts/maint/checkSpace.pl -C \
  85. $(top_srcdir)/src/common/*.[ch] \
  86. $(top_srcdir)/src/or/*.[ch] \
  87. $(top_srcdir)/src/test/*.[ch] \
  88. $(top_srcdir)/src/tools/*.[ch] \
  89. $(top_srcdir)/src/tools/tor-fw-helper/*.[ch]
  90. check-docs:
  91. $(top_srcdir)/scripts/maint/checkOptionDocs.pl
  92. check-logs:
  93. $(top_srcdir)/scripts/maint/checkLogs.pl \
  94. $(top_srcdir)/src/*/*.[ch] | sort -n
  95. .PHONY: check-changes
  96. check-changes:
  97. @if test -d "$(top_srcdir)/changes"; then \
  98. $(PYTHON) $(top_srcdir)/scripts/maint/lintChanges.py $(top_srcdir)/changes/*; \
  99. fi
  100. version:
  101. @echo "Tor @VERSION@"
  102. @if test -d "$(top_srcdir)/.git" && test -x "`which git 2>&1;true`"; then \
  103. echo -n "git: " ;\
  104. (cd "$(top_srcdir)" && git rev-parse --short=16 HEAD); \
  105. fi
  106. mostlyclean-local:
  107. rm -f $(top_builddir)/src/*/*.gc{da,no} $(top_builddir)/src/*/*/*.gc{da,no}
  108. rm -rf $(HTML_COVER_DIR)
  109. rm -rf $(top_builddir)/doc/doxygen