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