Makefile.am 3.7 KB

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