diff options
Diffstat (limited to 'Makefile.am')
-rw-r--r-- | Makefile.am | 83 |
1 files changed, 71 insertions, 12 deletions
diff --git a/Makefile.am b/Makefile.am index e4be3f26f9..c58140ae74 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,6 @@ # Copyright (c) 2001-2004, Roger Dingledine # Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson -# Copyright (c) 2007-2015, The Tor Project, Inc. +# Copyright (c) 2007-2017, The Tor Project, Inc. # See LICENSE for licensing information ACLOCAL_AMFLAGS = -I m4 @@ -9,13 +9,14 @@ noinst_LIBRARIES= EXTRA_DIST= noinst_HEADERS= bin_PROGRAMS= +EXTRA_PROGRAMS= CLEANFILES= TESTS= noinst_PROGRAMS= DISTCLEANFILES= bin_SCRIPTS= AM_CPPFLAGS= -AM_CFLAGS=@TOR_SYSTEMD_CFLAGS@ @CFLAGS_BUGTRAP@ +AM_CFLAGS=@TOR_SYSTEMD_CFLAGS@ @CFLAGS_BUGTRAP@ @TOR_LZMA_CFLAGS@ @TOR_ZSTD_CFLAGS@ SHELL=@SHELL@ if COVERAGE_ENABLED @@ -24,17 +25,27 @@ else TESTING_TOR_BINARY=$(top_builddir)/src/or/tor$(EXEEXT) endif +if USE_RUST +## this MUST be $(), otherwise am__DEPENDENCIES will not track it +rust_ldadd=$(top_builddir)/$(TOR_RUST_LIB_PATH) \ + $(TOR_RUST_EXTRA_LIBS) +else +rust_ldadd= +endif + include src/include.am include doc/include.am include contrib/include.am EXTRA_DIST+= \ ChangeLog \ + CONTRIBUTING \ INSTALL \ LICENSE \ Makefile.nmake \ README \ - ReleaseNotes + ReleaseNotes \ + scripts/maint/checkSpace.pl ## This tells etags how to find mockable function definitions. AM_ETAGSFLAGS=--regex='{c}/MOCK_IMPL([^,]+,\W*\([a-zA-Z0-9_]+\)\W*,/\1/s' @@ -42,16 +53,22 @@ AM_ETAGSFLAGS=--regex='{c}/MOCK_IMPL([^,]+,\W*\([a-zA-Z0-9_]+\)\W*,/\1/s' if COVERAGE_ENABLED TEST_CFLAGS=-fno-inline -fprofile-arcs -ftest-coverage if DISABLE_ASSERTS_IN_UNIT_TESTS -TEST_CPPFLAGS=-DTOR_UNIT_TESTS -DTOR_COVERAGE -DDISABLE_ASSERTS_IN_UNIT_TESTS +TEST_CPPFLAGS=-DTOR_UNIT_TESTS -DTOR_COVERAGE -DDISABLE_ASSERTS_IN_UNIT_TESTS @TOR_MODULES_ALL_ENABLED@ else -TEST_CPPFLAGS=-DTOR_UNIT_TESTS -DTOR_COVERAGE +TEST_CPPFLAGS=-DTOR_UNIT_TESTS -DTOR_COVERAGE @TOR_MODULES_ALL_ENABLED@ endif TEST_NETWORK_FLAGS=--coverage --hs-multi-client 1 else TEST_CFLAGS= -TEST_CPPFLAGS=-DTOR_UNIT_TESTS +TEST_CPPFLAGS=-DTOR_UNIT_TESTS @TOR_MODULES_ALL_ENABLED@ TEST_NETWORK_FLAGS=--hs-multi-client 1 endif +TEST_NETWORK_WARNING_FLAGS=--quiet --only-warnings + +if LIBFUZZER_ENABLED +TEST_CFLAGS += -fsanitize-coverage=trace-pc-guard,trace-cmp,trace-div +# not "edge" +endif TEST_NETWORK_ALL_LOG_DIR=$(top_builddir)/test_network_log TEST_NETWORK_ALL_DRIVER_FLAGS=--color-tests yes @@ -82,6 +99,8 @@ doxygen: test: all $(top_builddir)/src/test/test +check-local: check-spaces check-changes + need-chutney-path: @if test ! -d "$$CHUTNEY_PATH"; then \ echo '$$CHUTNEY_PATH was not set.'; \ @@ -101,18 +120,20 @@ test-network: need-chutney-path $(TESTING_TOR_BINARY) src/tools/tor-gencert # Run all available tests using automake's test-driver # only run IPv6 tests if we can ping6 ::1 (localhost) +# only run IPv6 tests if we can ping ::1 (localhost) # some IPv6 tests will fail without an IPv6 DNS server (see #16971 and #17011) # only run mixed tests if we have a tor-stable binary -# Try both the BSD and the Linux ping6 syntax, because they're incompatible +# Try the syntax for BSD ping6, Linux ping6, and Linux ping -6, +# because they're incompatible test-network-all: need-chutney-path test-driver $(TESTING_TOR_BINARY) src/tools/tor-gencert mkdir -p $(TEST_NETWORK_ALL_LOG_DIR) rm -f $(TEST_NETWORK_ALL_LOG_DIR)/*.log $(TEST_NETWORK_ALL_LOG_DIR)/*.trs @flavors="$(TEST_CHUTNEY_FLAVORS)"; \ - if ping6 -q -c 1 -o ::1 >/dev/null 2>&1 || ping6 -q -c 1 -W 1 ::1 >/dev/null 2>&1; then \ - echo "ping6 ::1 succeeded, running IPv6 flavors: $(TEST_CHUTNEY_FLAVORS_IPV6)."; \ + if ping6 -q -c 1 -o ::1 >/dev/null 2>&1 || ping6 -q -c 1 -W 1 ::1 >/dev/null 2>&1 || ping -6 -c 1 -W 1 ::1 >/dev/null 2>&1; then \ + echo "ping6 ::1 or ping ::1 succeeded, running IPv6 flavors: $(TEST_CHUTNEY_FLAVORS_IPV6)."; \ flavors="$$flavors $(TEST_CHUTNEY_FLAVORS_IPV6)"; \ else \ - echo "ping6 ::1 failed, skipping IPv6 flavors: $(TEST_CHUTNEY_FLAVORS_IPV6)."; \ + echo "ping6 ::1 and ping ::1 failed, skipping IPv6 flavors: $(TEST_CHUTNEY_FLAVORS_IPV6)."; \ skip_flavors="$$skip_flavors $(TEST_CHUTNEY_FLAVORS_IPV6)"; \ fi; \ if command -v tor-stable >/dev/null 2>&1; then \ @@ -127,6 +148,7 @@ test-network-all: need-chutney-path test-driver $(TESTING_TOR_BINARY) src/tools/ done; \ for f in $$flavors; do \ $(SHELL) $(top_srcdir)/test-driver --test-name $$f --log-file $(TEST_NETWORK_ALL_LOG_DIR)/$$f.log --trs-file $(TEST_NETWORK_ALL_LOG_DIR)/$$f.trs $(TEST_NETWORK_ALL_DRIVER_FLAGS) $(top_srcdir)/src/test/test-network.sh --flavor $$f $(TEST_NETWORK_FLAGS); \ + $(top_srcdir)/src/test/test-network.sh $(TEST_NETWORK_WARNING_FLAGS); \ done; \ echo "Log and result files are available in $(TEST_NETWORK_ALL_LOG_DIR)."; \ ! grep -q FAIL $(TEST_NETWORK_ALL_LOG_DIR)/*.trs @@ -182,11 +204,14 @@ coverage-html-full: all # Avoid strlcpy.c, strlcat.c, aes.c, OpenBSD_malloc_Linux.c, sha256.c, # tinytest*.[ch] check-spaces: - $(top_srcdir)/scripts/maint/checkSpace.pl -C \ +if USE_PERL + $(PERL) $(top_srcdir)/scripts/maint/checkSpace.pl -C \ $(top_srcdir)/src/common/*.[ch] \ $(top_srcdir)/src/or/*.[ch] \ $(top_srcdir)/src/test/*.[ch] \ + $(top_srcdir)/src/test/*/*.[ch] \ $(top_srcdir)/src/tools/*.[ch] +endif check-docs: all $(PERL) $(top_builddir)/scripts/maint/checkOptionDocs.pl @@ -195,16 +220,42 @@ check-logs: $(top_srcdir)/scripts/maint/checkLogs.pl \ $(top_srcdir)/src/*/*.[ch] | sort -n +.PHONY: check-typos +check-typos: + @if test -x "`which misspell 2>&1;true`"; then \ + echo "Checking for Typos ..."; \ + (misspell \ + $(top_srcdir)/src/[^e]*/*.[ch] \ + $(top_srcdir)/doc \ + $(top_srcdir)/contrib \ + $(top_srcdir)/scripts \ + $(top_srcdir)/README \ + $(top_srcdir)/ChangeLog \ + $(top_srcdir)/INSTALL \ + $(top_srcdir)/ReleaseNotes \ + $(top_srcdir)/LICENSE); \ + else \ + echo "Tor can use misspell to check for typos."; \ + echo "It seems that you don't have misspell installed."; \ + echo "You can install the latest version of misspell here: https://github.com/client9/misspell#install"; \ + fi + .PHONY: check-changes check-changes: +if USEPYTHON @if test -d "$(top_srcdir)/changes"; then \ - $(PYTHON) $(top_srcdir)/scripts/maint/lintChanges.py $(top_srcdir)/changes/*; \ + $(PYTHON) $(top_srcdir)/scripts/maint/lintChanges.py $(top_srcdir)/changes; \ fi +endif .PHONY: update-versions update-versions: $(PERL) $(top_builddir)/scripts/maint/updateVersions.pl +.PHONY: callgraph +callgraph: + $(top_builddir)/scripts/maint/run_calltool.sh + version: @echo "Tor @VERSION@" @if test -d "$(top_srcdir)/.git" && test -x "`which git 2>&1;true`"; then \ @@ -218,6 +269,14 @@ mostlyclean-local: rm -rf $(top_builddir)/doc/doxygen rm -rf $(TEST_NETWORK_ALL_LOG_DIR) +clean-local: + rm -rf $(top_builddir)/src/rust/target + rm -rf $(top_builddir)/src/rust/.cargo/registry + +if USE_RUST +distclean-local: distclean-rust +endif + # This relies on some internal details of how automake implements # distcheck. We check two directories because automake-1.15 changed # from $(distdir)/_build to $(distdir)/_build/sub. |