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
6 # "foreign" means we don't follow GNU package layout standards
7 # 1.9 means we require automake vesion 1.9
8 AUTOMAKE_OPTIONS = foreign 1.9 subdir-objects
10 ACLOCAL_AMFLAGS = -I m4
22 AM_CFLAGS = @TOR_SYSTEMD_CFLAGS@
23 include src/include.am
24 include doc/include.am
25 include contrib/include.am
36 TEST_CFLAGS=-fno-inline -fprofile-arcs -ftest-coverage
42 # $(INSTALL) -m 755 -d $(LOCALSTATEDIR)/lib/tor
44 # Allows to override rpmbuild with rpmbuild-md5 from fedora-packager so that
45 # building for EL5 won't fail on https://bugzilla.redhat.com/show_bug.cgi?id=490613
48 # Use automake's dist-gzip target to build the tarball
50 TIMESTAMP=$$(date +"%Y-%m-%d_%H.%M.%S"); \
51 RPM_BUILD_DIR=$$(mktemp -d "/tmp/tor-rpm-build-$$TIMESTAMP-XXXX"); \
52 mkdir -p "$$RPM_BUILD_DIR"/{BUILD,RPMS,SOURCES/"tor-$(VERSION)",SPECS,SRPMS}; \
53 cp -fa "$(distdir).tar.gz" "$$RPM_BUILD_DIR"/SOURCES/; \
54 LIBS=-lrt $(RPMBUILD) -ba --define "_topdir $$RPM_BUILD_DIR" tor.spec; \
55 cp -fa "$$RPM_BUILD_DIR"/SRPMS/* .; \
56 cp -fa "$$RPM_BUILD_DIR"/RPMS/* .; \
57 rm -rf "$$RPM_BUILD_DIR"; \
58 echo "RPM build finished"; \
64 doxygen && cd doc/doxygen/latex && make
69 # Note that test-network requires a copy of Chutney in $CHUTNEY_PATH.
70 # Chutney can be cloned from https://git.torproject.org/chutney.git .
72 ./src/test/test-network.sh
74 test-stem: $(TESTING_TOR_BINARY)
75 @if test -d "$$STEM_SOURCE_DIR"; then \
76 $(PYTHON) "$$STEM_SOURCE_DIR"/run_tests.py --tor $(TESTING_TOR_BINARY) --all --log notice --target RUN_ALL; \
78 echo '$$STEM_SOURCE_DIR was not set.'; echo; \
79 echo "To run these tests, git clone https://git.torproject.org/stem.git/ ; export STEM_SOURCE_DIR=\`pwd\`/stem"; \
84 rm -f src/*/*.gcda src/*/*/*.gcda
86 HTML_COVER_DIR=./coverage_html
88 test -e "`which lcov`" || (echo "lcov must be installed. See <http://ltp.sourceforge.net/coverage/lcov.php>." && false)
89 test -d "$(HTML_COVER_DIR)" || mkdir -p "$(HTML_COVER_DIR)"
90 lcov --rc lcov_branch_coverage=1 --directory ./src --zerocounters
93 lcov --capture --rc lcov_branch_coverage=1 --no-external --directory . --output-file "$(HTML_COVER_DIR)/lcov.tmp"
94 lcov --remove "$(HTML_COVER_DIR)/lcov.tmp" --rc lcov_branch_coverage=1 'test/*' 'ext/tinytest*' '/usr/*' --output-file "$(HTML_COVER_DIR)/lcov.info"
95 genhtml --branch-coverage -o "$(HTML_COVER_DIR)" "$(HTML_COVER_DIR)/lcov.info"
97 # Avoid strlcpy.c, strlcat.c, aes.c, OpenBSD_malloc_Linux.c, sha256.c,
98 # eventdns.[hc], tinytest*.[ch]
100 ./scripts/maint/checkSpace.pl -C \
105 src/tools/tor-fw-helper/*.[ch]
108 ./scripts/maint/checkOptionDocs.pl
111 ./scripts/maint/checkLogs.pl \
112 src/*/*.[ch] | sort -n
115 @echo "Tor @VERSION@"
116 @if test -d "$(top_srcdir)/.git" && test -x "`which git 2>&1;true`"; then \
118 (cd "$(top_srcdir)" && git rev-parse --short=16 HEAD); \
122 rm -f src/*/*.gc{da,no} src/*/*/*.gc{da,no}