2006-02-09 06:46:49 +01:00
|
|
|
# Copyright (c) 2001-2004, Roger Dingledine
|
2008-02-07 06:31:47 +01:00
|
|
|
# Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson
|
2019-01-16 18:33:22 +01:00
|
|
|
# Copyright (c) 2007-2019, The Tor Project, Inc.
|
2005-04-01 22:15:56 +02:00
|
|
|
# See LICENSE for licensing information
|
|
|
|
|
2013-02-07 22:23:48 +01:00
|
|
|
ACLOCAL_AMFLAGS = -I m4
|
|
|
|
|
2012-08-02 15:31:43 +02:00
|
|
|
noinst_LIBRARIES=
|
|
|
|
EXTRA_DIST=
|
|
|
|
noinst_HEADERS=
|
|
|
|
bin_PROGRAMS=
|
2016-12-14 01:15:26 +01:00
|
|
|
EXTRA_PROGRAMS=
|
2012-08-02 15:31:43 +02:00
|
|
|
CLEANFILES=
|
|
|
|
TESTS=
|
|
|
|
noinst_PROGRAMS=
|
|
|
|
DISTCLEANFILES=
|
2020-09-18 18:17:02 +02:00
|
|
|
MOSTLYCLEANFILES=
|
2012-08-02 15:31:43 +02:00
|
|
|
bin_SCRIPTS=
|
2018-06-20 15:25:50 +02:00
|
|
|
AM_CPPFLAGS=\
|
|
|
|
-I$(top_srcdir)/src \
|
|
|
|
-I$(top_srcdir)/src/ext \
|
2018-06-20 15:35:05 +02:00
|
|
|
-I$(top_srcdir)/src/ext/trunnel \
|
|
|
|
-I$(top_srcdir)/src/trunnel
|
2018-06-20 15:25:50 +02:00
|
|
|
|
2019-12-04 18:21:53 +01:00
|
|
|
AM_CFLAGS= \
|
|
|
|
@TOR_SYSTEMD_CFLAGS@ \
|
|
|
|
@CFLAGS_BUGTRAP@ \
|
|
|
|
@TOR_LZMA_CFLAGS@ \
|
|
|
|
@TOR_ZSTD_CFLAGS@
|
|
|
|
|
2016-04-13 00:59:40 +02:00
|
|
|
SHELL=@SHELL@
|
2015-09-25 16:39:11 +02:00
|
|
|
|
|
|
|
if COVERAGE_ENABLED
|
2018-07-05 22:04:32 +02:00
|
|
|
TESTING_TOR_BINARY=$(top_builddir)/src/app/tor-cov$(EXEEXT)
|
2015-09-25 16:39:11 +02:00
|
|
|
else
|
2018-07-05 22:04:32 +02:00
|
|
|
TESTING_TOR_BINARY=$(top_builddir)/src/app/tor$(EXEEXT)
|
2015-09-25 16:39:11 +02:00
|
|
|
endif
|
|
|
|
|
2018-06-21 16:34:29 +02:00
|
|
|
# "Common" libraries used to link tor's utility code.
|
|
|
|
TOR_UTIL_LIBS = \
|
2018-09-27 16:26:01 +02:00
|
|
|
src/lib/libtor-geoip.a \
|
2018-06-28 19:40:21 +02:00
|
|
|
src/lib/libtor-process.a \
|
2018-11-07 00:05:14 +01:00
|
|
|
src/lib/libtor-buf.a \
|
2019-06-14 14:42:24 +02:00
|
|
|
src/lib/libtor-confmgt.a \
|
2019-01-15 15:01:41 +01:00
|
|
|
src/lib/libtor-pubsub.a \
|
2019-01-12 02:17:04 +01:00
|
|
|
src/lib/libtor-dispatch.a \
|
2018-06-28 19:40:21 +02:00
|
|
|
src/lib/libtor-time.a \
|
|
|
|
src/lib/libtor-fs.a \
|
|
|
|
src/lib/libtor-encoding.a \
|
|
|
|
src/lib/libtor-sandbox.a \
|
2018-06-26 18:13:23 +02:00
|
|
|
src/lib/libtor-container.a \
|
2018-06-27 02:42:47 +02:00
|
|
|
src/lib/libtor-net.a \
|
2018-06-28 19:40:21 +02:00
|
|
|
src/lib/libtor-thread.a \
|
|
|
|
src/lib/libtor-memarea.a \
|
2018-06-28 18:24:45 +02:00
|
|
|
src/lib/libtor-math.a \
|
2018-07-01 15:37:28 +02:00
|
|
|
src/lib/libtor-meminfo.a \
|
2018-06-29 16:37:35 +02:00
|
|
|
src/lib/libtor-osinfo.a \
|
2018-06-28 19:40:21 +02:00
|
|
|
src/lib/libtor-log.a \
|
|
|
|
src/lib/libtor-lock.a \
|
|
|
|
src/lib/libtor-fdio.a \
|
|
|
|
src/lib/libtor-string.a \
|
2018-06-29 16:50:05 +02:00
|
|
|
src/lib/libtor-term.a \
|
2018-06-28 19:40:21 +02:00
|
|
|
src/lib/libtor-smartlist-core.a \
|
2018-06-21 21:17:54 +02:00
|
|
|
src/lib/libtor-malloc.a \
|
2018-06-28 19:40:21 +02:00
|
|
|
src/lib/libtor-wallclock.a \
|
|
|
|
src/lib/libtor-err.a \
|
2018-11-01 17:33:22 +01:00
|
|
|
src/lib/libtor-version.a \
|
2020-02-13 19:14:54 +01:00
|
|
|
src/lib/libtor-llharden.a \
|
2018-06-28 19:40:21 +02:00
|
|
|
src/lib/libtor-intmath.a \
|
2020-10-19 21:15:47 +02:00
|
|
|
src/lib/libtor-ctime.a \
|
|
|
|
src/lib/libtor-metrics.a
|
2018-06-21 16:34:29 +02:00
|
|
|
|
|
|
|
# Variants of the above for linking the testing variant of tor (for coverage
|
|
|
|
# and tests)
|
2018-07-16 12:49:40 +02:00
|
|
|
if UNITTESTS_ENABLED
|
2018-06-21 16:34:29 +02:00
|
|
|
TOR_UTIL_TESTING_LIBS = \
|
2018-09-27 16:26:01 +02:00
|
|
|
src/lib/libtor-geoip-testing.a \
|
2018-06-28 19:40:21 +02:00
|
|
|
src/lib/libtor-process-testing.a \
|
2018-11-07 00:05:14 +01:00
|
|
|
src/lib/libtor-buf-testing.a \
|
2019-06-14 14:42:24 +02:00
|
|
|
src/lib/libtor-confmgt-testing.a \
|
2019-01-15 15:01:41 +01:00
|
|
|
src/lib/libtor-pubsub-testing.a \
|
2019-01-12 02:17:04 +01:00
|
|
|
src/lib/libtor-dispatch-testing.a \
|
2018-06-28 19:40:21 +02:00
|
|
|
src/lib/libtor-time-testing.a \
|
|
|
|
src/lib/libtor-fs-testing.a \
|
|
|
|
src/lib/libtor-encoding-testing.a \
|
|
|
|
src/lib/libtor-sandbox-testing.a \
|
2018-06-26 18:13:23 +02:00
|
|
|
src/lib/libtor-container-testing.a \
|
2018-06-27 02:42:47 +02:00
|
|
|
src/lib/libtor-net-testing.a \
|
2018-06-28 19:40:21 +02:00
|
|
|
src/lib/libtor-thread-testing.a \
|
|
|
|
src/lib/libtor-memarea-testing.a \
|
2018-06-28 18:24:45 +02:00
|
|
|
src/lib/libtor-math-testing.a \
|
2018-07-01 15:37:28 +02:00
|
|
|
src/lib/libtor-meminfo-testing.a \
|
2018-06-29 16:37:35 +02:00
|
|
|
src/lib/libtor-osinfo-testing.a \
|
2018-06-29 16:50:05 +02:00
|
|
|
src/lib/libtor-term-testing.a \
|
2018-06-28 19:40:21 +02:00
|
|
|
src/lib/libtor-log-testing.a \
|
|
|
|
src/lib/libtor-lock-testing.a \
|
|
|
|
src/lib/libtor-fdio-testing.a \
|
|
|
|
src/lib/libtor-string-testing.a \
|
|
|
|
src/lib/libtor-smartlist-core-testing.a \
|
2018-06-21 21:17:54 +02:00
|
|
|
src/lib/libtor-malloc-testing.a \
|
2018-06-28 19:40:21 +02:00
|
|
|
src/lib/libtor-wallclock-testing.a \
|
|
|
|
src/lib/libtor-err-testing.a \
|
2018-11-01 17:33:22 +01:00
|
|
|
src/lib/libtor-version-testing.a \
|
2020-02-13 19:14:54 +01:00
|
|
|
src/lib/libtor-llharden-testing.a \
|
2018-06-28 19:40:21 +02:00
|
|
|
src/lib/libtor-intmath.a \
|
2020-10-19 21:15:47 +02:00
|
|
|
src/lib/libtor-ctime-testing.a \
|
|
|
|
src/lib/libtor-metrics-testing.a
|
2018-07-16 12:49:40 +02:00
|
|
|
endif
|
2018-06-21 16:34:29 +02:00
|
|
|
|
|
|
|
# Internal crypto libraries used in Tor
|
|
|
|
TOR_CRYPTO_LIBS = \
|
2018-06-21 18:46:11 +02:00
|
|
|
src/lib/libtor-tls.a \
|
|
|
|
src/lib/libtor-crypt-ops.a \
|
2018-06-21 16:34:29 +02:00
|
|
|
$(LIBKECCAK_TINY) \
|
|
|
|
$(LIBDONNA)
|
|
|
|
|
|
|
|
# Variants of the above for linking the testing variant of tor (for coverage
|
|
|
|
# and tests)
|
2018-07-16 12:49:40 +02:00
|
|
|
if UNITTESTS_ENABLED
|
2018-06-21 16:34:29 +02:00
|
|
|
TOR_CRYPTO_TESTING_LIBS = \
|
2018-06-21 18:46:11 +02:00
|
|
|
src/lib/libtor-tls-testing.a \
|
|
|
|
src/lib/libtor-crypt-ops-testing.a \
|
2018-06-21 16:34:29 +02:00
|
|
|
$(LIBKECCAK_TINY) \
|
|
|
|
$(LIBDONNA)
|
2018-07-16 12:49:40 +02:00
|
|
|
endif
|
2018-06-21 16:34:29 +02:00
|
|
|
|
|
|
|
# All static libraries used to link tor.
|
|
|
|
TOR_INTERNAL_LIBS = \
|
2018-07-05 22:04:32 +02:00
|
|
|
src/core/libtor-app.a \
|
2018-07-01 15:37:28 +02:00
|
|
|
src/lib/libtor-compress.a \
|
2018-07-05 21:13:44 +02:00
|
|
|
src/lib/libtor-evloop.a \
|
2018-06-21 16:34:29 +02:00
|
|
|
$(TOR_CRYPTO_LIBS) \
|
|
|
|
$(TOR_UTIL_LIBS) \
|
|
|
|
src/trunnel/libor-trunnel.a \
|
2018-06-21 18:02:14 +02:00
|
|
|
src/lib/libtor-trace.a
|
2018-06-21 16:34:29 +02:00
|
|
|
|
2020-09-18 18:17:02 +02:00
|
|
|
libtor.a: $(TOR_INTERNAL_LIBS)
|
|
|
|
$(AM_V_AR) export AR="$(AR)"; \
|
|
|
|
export ARFLAGS="$(ARFLAGS)"; \
|
2020-11-10 22:57:03 +01:00
|
|
|
export RANLIB="$(RANLIB)"; \
|
2020-09-18 18:17:02 +02:00
|
|
|
$(top_srcdir)/scripts/build/combine_libs libtor.a $(TOR_INTERNAL_LIBS)
|
|
|
|
|
|
|
|
MOSTLYCLEANFILES += libtor.a
|
|
|
|
|
2018-06-21 16:34:29 +02:00
|
|
|
# Variants of the above for linking the testing variant of tor (for coverage
|
|
|
|
# and tests)
|
2018-07-16 12:49:40 +02:00
|
|
|
if UNITTESTS_ENABLED
|
2018-06-21 16:34:29 +02:00
|
|
|
TOR_INTERNAL_TESTING_LIBS = \
|
2018-07-05 22:04:32 +02:00
|
|
|
src/core/libtor-app-testing.a \
|
2018-07-01 15:37:28 +02:00
|
|
|
src/lib/libtor-compress-testing.a \
|
2018-07-05 21:13:44 +02:00
|
|
|
src/lib/libtor-evloop-testing.a \
|
2018-06-21 16:34:29 +02:00
|
|
|
$(TOR_CRYPTO_TESTING_LIBS) \
|
|
|
|
$(TOR_UTIL_TESTING_LIBS) \
|
|
|
|
src/trunnel/libor-trunnel-testing.a \
|
2018-06-21 18:02:14 +02:00
|
|
|
src/lib/libtor-trace.a
|
2020-09-18 18:17:02 +02:00
|
|
|
|
|
|
|
src/test/libtor-testing.a: $(TOR_INTERNAL_TESTING_LIBS)
|
|
|
|
$(AM_V_AR) export AR="$(AR)"; \
|
|
|
|
export ARFLAGS="$(ARFLAGS)"; \
|
|
|
|
export RANLIB="$(RANLIB)"; \
|
|
|
|
$(top_srcdir)/scripts/build/combine_libs src/test/libtor-testing.a $(TOR_INTERNAL_TESTING_LIBS)
|
|
|
|
|
|
|
|
MOSTLYCLEANFILES += src/test/libtor-testing.a
|
2018-07-16 12:49:40 +02:00
|
|
|
endif
|
2018-06-21 16:34:29 +02:00
|
|
|
|
2018-07-11 18:51:36 +02:00
|
|
|
TOR_LDFLAGS_CRYPTLIB=@TOR_LDFLAGS_openssl@
|
|
|
|
TOR_LIBS_CRYPTLIB=@TOR_OPENSSL_LIBS@
|
2018-07-11 18:57:30 +02:00
|
|
|
TOR_CFLAGS_CRYPTLIB=
|
|
|
|
if USE_NSS
|
|
|
|
TOR_CFLAGS_CRYPTLIB+=@NSS_CFLAGS@
|
|
|
|
TOR_LIBS_CRYPTLIB+=@NSS_LIBS@
|
|
|
|
endif
|
2018-07-11 18:51:36 +02:00
|
|
|
|
2018-06-21 16:34:29 +02:00
|
|
|
# All libraries used to link tor-cov
|
|
|
|
|
2012-08-02 15:31:43 +02:00
|
|
|
include src/include.am
|
|
|
|
include doc/include.am
|
|
|
|
include contrib/include.am
|
2002-06-29 01:26:42 +02:00
|
|
|
|
2020-08-12 17:35:15 +02:00
|
|
|
manpages: $(nodist_man1_MANS)
|
|
|
|
|
2012-08-02 15:31:43 +02:00
|
|
|
EXTRA_DIST+= \
|
2019-10-25 08:13:16 +02:00
|
|
|
ChangeLog \
|
|
|
|
CONTRIBUTING \
|
|
|
|
CODE_OF_CONDUCT \
|
|
|
|
INSTALL \
|
|
|
|
LICENSE \
|
|
|
|
Makefile.nmake \
|
2022-02-07 16:07:33 +01:00
|
|
|
README.md \
|
2019-10-25 08:13:16 +02:00
|
|
|
ReleaseNotes \
|
2020-09-18 18:17:02 +02:00
|
|
|
scripts/build/combine_libs \
|
2019-10-25 08:13:16 +02:00
|
|
|
scripts/maint/checkIncludes.py \
|
|
|
|
scripts/maint/checkSpace.pl \
|
2019-12-02 18:43:10 +01:00
|
|
|
scripts/maint/checkSpaceTest.sh \
|
|
|
|
scripts/maint/checkspace_tests/dubious.c \
|
|
|
|
scripts/maint/checkspace_tests/dubious.h \
|
|
|
|
scripts/maint/checkspace_tests/expected.txt \
|
|
|
|
scripts/maint/checkspace_tests/good_guard.h \
|
|
|
|
scripts/maint/checkspace_tests/same_guard.h \
|
|
|
|
scripts/maint/checkspace_tests/subdir/dubious.c \
|
2019-10-25 08:13:16 +02:00
|
|
|
scripts/maint/checkShellScripts.sh \
|
|
|
|
scripts/maint/practracker/README \
|
|
|
|
scripts/maint/practracker/exceptions.txt \
|
|
|
|
scripts/maint/practracker/includes.py \
|
|
|
|
scripts/maint/practracker/metrics.py \
|
|
|
|
scripts/maint/practracker/practracker.py \
|
|
|
|
scripts/maint/practracker/practracker_tests.py \
|
|
|
|
scripts/maint/practracker/problem.py \
|
|
|
|
scripts/maint/practracker/testdata/.may_include \
|
|
|
|
scripts/maint/practracker/testdata/a.c \
|
|
|
|
scripts/maint/practracker/testdata/b.c \
|
|
|
|
scripts/maint/practracker/testdata/ex0-expected.txt \
|
|
|
|
scripts/maint/practracker/testdata/ex0.txt \
|
|
|
|
scripts/maint/practracker/testdata/ex1-expected.txt \
|
|
|
|
scripts/maint/practracker/testdata/ex1.txt \
|
|
|
|
scripts/maint/practracker/testdata/ex1-overbroad-expected.txt \
|
2020-02-03 19:11:58 +01:00
|
|
|
scripts/maint/practracker/testdata/ex1-regen-expected.txt \
|
|
|
|
scripts/maint/practracker/testdata/ex1-regen-overbroad-expected.txt \
|
2019-10-25 08:13:16 +02:00
|
|
|
scripts/maint/practracker/testdata/ex.txt \
|
|
|
|
scripts/maint/practracker/testdata/header.h \
|
|
|
|
scripts/maint/practracker/testdata/not_c_file \
|
|
|
|
scripts/maint/practracker/test_practracker.sh \
|
|
|
|
scripts/maint/practracker/util.py \
|
|
|
|
scripts/coccinelle/apply.sh \
|
|
|
|
scripts/coccinelle/check_cocci_parse.sh \
|
|
|
|
scripts/coccinelle/exceptions.txt \
|
|
|
|
scripts/coccinelle/test-operator-cleanup \
|
|
|
|
scripts/coccinelle/tor-coccinelle.h \
|
2019-10-23 07:44:17 +02:00
|
|
|
scripts/coccinelle/try_parse.sh
|
2002-07-22 06:07:34 +02:00
|
|
|
|
2016-10-03 19:58:09 +02:00
|
|
|
## This tells etags how to find mockable function definitions.
|
|
|
|
AM_ETAGSFLAGS=--regex='{c}/MOCK_IMPL([^,]+,\W*\([a-zA-Z0-9_]+\)\W*,/\1/s'
|
|
|
|
|
2013-07-09 18:37:11 +02:00
|
|
|
if COVERAGE_ENABLED
|
|
|
|
TEST_CFLAGS=-fno-inline -fprofile-arcs -ftest-coverage
|
2016-02-05 14:40:07 +01:00
|
|
|
if DISABLE_ASSERTS_IN_UNIT_TESTS
|
2018-04-27 17:33:22 +02:00
|
|
|
TEST_CPPFLAGS=-DTOR_UNIT_TESTS -DTOR_COVERAGE -DDISABLE_ASSERTS_IN_UNIT_TESTS @TOR_MODULES_ALL_ENABLED@
|
2016-02-05 14:40:07 +01:00
|
|
|
else
|
2018-04-27 17:33:22 +02:00
|
|
|
TEST_CPPFLAGS=-DTOR_UNIT_TESTS -DTOR_COVERAGE @TOR_MODULES_ALL_ENABLED@
|
2016-02-05 14:40:07 +01:00
|
|
|
endif
|
2015-09-08 14:27:59 +02:00
|
|
|
TEST_NETWORK_FLAGS=--coverage --hs-multi-client 1
|
2013-07-09 18:37:11 +02:00
|
|
|
else
|
|
|
|
TEST_CFLAGS=
|
2018-04-27 17:33:22 +02:00
|
|
|
TEST_CPPFLAGS=-DTOR_UNIT_TESTS @TOR_MODULES_ALL_ENABLED@
|
2015-09-08 14:27:59 +02:00
|
|
|
TEST_NETWORK_FLAGS=--hs-multi-client 1
|
2013-07-09 18:37:11 +02:00
|
|
|
endif
|
2019-06-14 03:44:26 +02:00
|
|
|
TEST_NETWORK_SHOW_WARNINGS_FOR_LAST_RUN_FLAGS=--quiet --only-warnings
|
2013-07-09 18:37:11 +02:00
|
|
|
|
2016-12-19 21:17:42 +01:00
|
|
|
if LIBFUZZER_ENABLED
|
2021-06-08 18:47:57 +02:00
|
|
|
TEST_CFLAGS += -fsanitize=fuzzer-no-link
|
2017-01-09 16:44:55 +01:00
|
|
|
# not "edge"
|
2016-12-19 21:17:42 +01:00
|
|
|
endif
|
|
|
|
|
2015-09-08 14:27:59 +02:00
|
|
|
TEST_NETWORK_ALL_LOG_DIR=$(top_builddir)/test_network_log
|
|
|
|
TEST_NETWORK_ALL_DRIVER_FLAGS=--color-tests yes
|
|
|
|
|
2003-10-22 06:33:11 +02:00
|
|
|
#install-data-local:
|
|
|
|
# $(INSTALL) -m 755 -d $(LOCALSTATEDIR)/lib/tor
|
2004-03-02 20:09:30 +01:00
|
|
|
|
2012-06-16 18:38:14 +02:00
|
|
|
# Allows to override rpmbuild with rpmbuild-md5 from fedora-packager so that
|
|
|
|
# building for EL5 won't fail on https://bugzilla.redhat.com/show_bug.cgi?id=490613
|
|
|
|
RPMBUILD ?= rpmbuild
|
|
|
|
|
2012-06-15 23:59:35 +02:00
|
|
|
# Use automake's dist-gzip target to build the tarball
|
|
|
|
dist-rpm: dist-gzip
|
|
|
|
TIMESTAMP=$$(date +"%Y-%m-%d_%H.%M.%S"); \
|
|
|
|
RPM_BUILD_DIR=$$(mktemp -d "/tmp/tor-rpm-build-$$TIMESTAMP-XXXX"); \
|
|
|
|
mkdir -p "$$RPM_BUILD_DIR"/{BUILD,RPMS,SOURCES/"tor-$(VERSION)",SPECS,SRPMS}; \
|
|
|
|
cp -fa "$(distdir).tar.gz" "$$RPM_BUILD_DIR"/SOURCES/; \
|
2012-06-16 18:38:14 +02:00
|
|
|
LIBS=-lrt $(RPMBUILD) -ba --define "_topdir $$RPM_BUILD_DIR" tor.spec; \
|
2012-06-15 23:59:35 +02:00
|
|
|
cp -fa "$$RPM_BUILD_DIR"/SRPMS/* .; \
|
|
|
|
cp -fa "$$RPM_BUILD_DIR"/RPMS/* .; \
|
|
|
|
rm -rf "$$RPM_BUILD_DIR"; \
|
|
|
|
echo "RPM build finished"; \
|
|
|
|
#end of dist-rpm
|
2004-05-07 19:03:52 +02:00
|
|
|
|
2019-10-16 15:56:31 +02:00
|
|
|
.PHONY: doxygen
|
|
|
|
doxygen: Doxyfile
|
2019-11-05 14:57:39 +01:00
|
|
|
mkdir -p doc/doxygen
|
|
|
|
(cd "$(top_srcdir)" && doxygen "$(abs_top_builddir)/Doxyfile")
|
2004-11-09 21:04:00 +01:00
|
|
|
|
2009-09-22 19:57:00 +02:00
|
|
|
test: all
|
2015-02-17 15:36:10 +01:00
|
|
|
$(top_builddir)/src/test/test
|
2006-10-08 05:17:24 +02:00
|
|
|
|
2018-12-15 09:47:30 +01:00
|
|
|
shellcheck:
|
2019-08-30 14:54:05 +02:00
|
|
|
$(top_srcdir)/scripts/maint/checkShellScripts.sh
|
2018-12-15 09:47:30 +01:00
|
|
|
|
2019-12-04 18:21:53 +01:00
|
|
|
check-local: \
|
|
|
|
check-spaces \
|
|
|
|
check-changes \
|
|
|
|
check-includes \
|
2020-07-13 15:24:26 +02:00
|
|
|
shellcheck
|
2016-12-15 13:06:01 +01:00
|
|
|
|
2020-02-13 02:57:36 +01:00
|
|
|
# test-network requires a copy of Chutney in $CHUTNEY_PATH.
|
2023-06-15 19:00:11 +02:00
|
|
|
# Chutney can be cloned from https://gitlab.torproject.org/tpo/core/chutney.git .
|
2020-02-13 02:57:36 +01:00
|
|
|
.PHONY: need-chutney-path
|
2015-08-03 19:03:58 +02:00
|
|
|
need-chutney-path:
|
|
|
|
@if test ! -d "$$CHUTNEY_PATH"; then \
|
2015-08-27 02:31:35 +02:00
|
|
|
echo '$$CHUTNEY_PATH was not set.'; \
|
2020-02-14 01:34:17 +01:00
|
|
|
if test -d "$(top_srcdir)/../chutney" && \
|
|
|
|
test -x "$(top_srcdir)/../chutney/chutney"; then \
|
|
|
|
echo "Assuming test-network.sh will find" \
|
|
|
|
"$(top_srcdir)/../chutney"; \
|
2015-08-27 02:31:35 +02:00
|
|
|
else \
|
|
|
|
echo; \
|
2020-02-14 02:11:09 +01:00
|
|
|
echo "To run these tests," \
|
|
|
|
"git clone" \
|
2023-06-15 19:00:11 +02:00
|
|
|
"https://gitlab.torproject.org/tpo/core/chutney.git ;" \
|
2020-02-14 02:11:09 +01:00
|
|
|
"export CHUTNEY_PATH=\`pwd\`/chutney"; \
|
2015-08-27 02:31:35 +02:00
|
|
|
exit 1; \
|
|
|
|
fi \
|
2015-08-03 19:03:58 +02:00
|
|
|
fi
|
|
|
|
|
2020-02-13 02:57:36 +01:00
|
|
|
# Run some basic tests using automake's test-driver
|
|
|
|
.PHONY: test-network
|
2020-02-17 13:03:09 +01:00
|
|
|
# Hide directory path logs from submakes using $(MAKE) -s
|
2020-02-13 02:57:36 +01:00
|
|
|
test-network:
|
2020-02-17 13:03:09 +01:00
|
|
|
@$(MAKE) -s test-network-mkdir
|
|
|
|
@$(MAKE) -s test-network-clean
|
|
|
|
@$(MAKE) -s test-network-run \
|
2020-02-17 05:26:41 +01:00
|
|
|
ipv4_flavors="$(TEST_CHUTNEY_FLAVOR_QUICK)" \
|
2020-02-14 01:34:17 +01:00
|
|
|
ipv6_flavors="$(TEST_CHUTNEY_FLAVOR_QUICK_IPV6)"
|
2020-02-17 13:03:09 +01:00
|
|
|
@$(MAKE) -s test-network-results
|
2013-06-05 15:48:57 +02:00
|
|
|
|
2015-09-08 14:27:59 +02:00
|
|
|
# Run all available tests using automake's test-driver
|
2020-02-13 01:09:33 +01:00
|
|
|
.PHONY: test-network-all
|
2020-02-17 13:03:09 +01:00
|
|
|
# Hide directory path logs from submakes using $(MAKE) -s
|
2020-02-13 01:09:33 +01:00
|
|
|
test-network-all:
|
2020-02-17 13:03:09 +01:00
|
|
|
@$(MAKE) -s test-network-mkdir
|
|
|
|
@$(MAKE) -s test-network-clean
|
|
|
|
@$(MAKE) -s test-network-run \
|
2020-02-17 05:26:41 +01:00
|
|
|
ipv4_flavors="$(TEST_CHUTNEY_FLAVORS)" \
|
|
|
|
mixed_flavors="$(TEST_CHUTNEY_FLAVORS_MIXED)" \
|
2020-02-17 05:50:24 +01:00
|
|
|
ipv6_flavors="$(TEST_CHUTNEY_FLAVORS_IPV6)" \
|
|
|
|
ipv6_mixed_flavors="$(TEST_CHUTNEY_FLAVORS_IPV6_MIXED)"
|
2020-02-17 13:03:09 +01:00
|
|
|
@$(MAKE) -s test-network-results
|
2020-02-13 01:09:33 +01:00
|
|
|
|
|
|
|
# Run IPv4 and mixed tests using automake's test-driver
|
|
|
|
.PHONY: test-network-ipv4
|
2020-02-17 13:03:09 +01:00
|
|
|
# Hide directory path logs from submakes using $(MAKE) -s
|
2020-02-13 01:09:33 +01:00
|
|
|
test-network-ipv4:
|
2020-02-17 13:03:09 +01:00
|
|
|
@$(MAKE) -s test-network-mkdir
|
|
|
|
@$(MAKE) -s test-network-clean
|
|
|
|
@$(MAKE) -s test-network-run \
|
2020-02-17 05:26:41 +01:00
|
|
|
ipv4_flavors="$(TEST_CHUTNEY_FLAVORS)" \
|
2020-02-14 01:34:17 +01:00
|
|
|
mixed_flavors="$(TEST_CHUTNEY_FLAVORS_MIXED)"
|
2020-02-17 13:03:09 +01:00
|
|
|
@$(MAKE) -s test-network-results
|
2020-02-13 01:09:33 +01:00
|
|
|
|
|
|
|
# Run IPv6 tests using automake's test-driver
|
|
|
|
.PHONY: test-network-ipv6
|
2020-02-17 13:03:09 +01:00
|
|
|
# Hide directory path logs from submakes using $(MAKE) -s
|
2020-02-13 01:09:33 +01:00
|
|
|
test-network-ipv6:
|
2020-02-17 13:03:09 +01:00
|
|
|
@$(MAKE) -s test-network-mkdir
|
|
|
|
@$(MAKE) -s test-network-clean
|
|
|
|
@$(MAKE) -s test-network-run \
|
2020-02-17 05:50:24 +01:00
|
|
|
ipv6_flavors="$(TEST_CHUTNEY_FLAVORS_IPV6)" \
|
|
|
|
ipv6_mixed_flavors="$(TEST_CHUTNEY_FLAVORS_IPV6_MIXED)"
|
2020-02-17 13:03:09 +01:00
|
|
|
@$(MAKE) -s test-network-results
|
2020-02-13 01:09:33 +01:00
|
|
|
|
|
|
|
# Make the test network log directory, if it does not exist
|
|
|
|
.PHONY: test-network-mkdir
|
|
|
|
test-network-mkdir:
|
2020-02-14 01:34:17 +01:00
|
|
|
@mkdir -p "$(TEST_NETWORK_ALL_LOG_DIR)"
|
2020-02-13 01:09:33 +01:00
|
|
|
|
|
|
|
# Clean the test network log directory
|
|
|
|
.PHONY: test-network-clean
|
2020-02-14 01:34:17 +01:00
|
|
|
# We need to remove all matching files, so we can't quote the glob part of the
|
|
|
|
# rm arguments
|
2020-02-13 01:09:33 +01:00
|
|
|
test-network-clean:
|
2020-02-14 01:34:17 +01:00
|
|
|
rm -f "$(TEST_NETWORK_ALL_LOG_DIR)"/*.log \
|
|
|
|
"$(TEST_NETWORK_ALL_LOG_DIR)"/*.trs
|
2020-02-13 01:09:33 +01:00
|
|
|
|
2020-02-17 05:26:41 +01:00
|
|
|
# Run tests using automake's test-driver
|
|
|
|
# When checking if a set of test can be run, log the type of test, and the
|
|
|
|
# list of tests that will be run (or skipped).
|
|
|
|
#
|
|
|
|
# Run the IPv4 tests in $(ipv4_flavors), unconditionally
|
|
|
|
# - tor relays and directory authorities require IPv4.
|
2020-02-13 01:09:33 +01:00
|
|
|
# Run the IPv6 tests in $(ipv6_flavors), if IPv6 is available
|
2019-06-14 03:44:26 +02:00
|
|
|
# - only run IPv6 tests if we can ping6 or ping -6 ::1 (localhost)
|
|
|
|
# we try the syntax for BSD ping6, Linux ping6, and Linux ping -6,
|
|
|
|
# because they're incompatible
|
|
|
|
# - some IPv6 tests may fail without an IPv6 DNS server
|
|
|
|
# (see #16971 and #17011)
|
2020-02-17 05:26:41 +01:00
|
|
|
# Run the mixed tests in $(mixed_flavors), if a tor-stable binary is available
|
|
|
|
# - only run mixed tests if we have a tor-stable binary
|
|
|
|
# Run the IPv6 mixed tests in $(ipv6_mixed_flavors), if IPv6 and mixed are run
|
|
|
|
# - see above for details about IPv6 and mixed
|
2020-02-13 01:09:33 +01:00
|
|
|
.PHONY: test-network-run
|
2020-02-14 01:34:17 +01:00
|
|
|
# We need the word splitting in the "for" lines, so we can't quote
|
|
|
|
# $(skip_flavors) or $(flavors)
|
2020-02-13 01:09:33 +01:00
|
|
|
test-network-run: need-chutney-path test-driver $(TESTING_TOR_BINARY) src/tools/tor-gencert
|
2020-02-17 05:26:41 +01:00
|
|
|
@flavors=""; \
|
|
|
|
skip_flavors=""; \
|
|
|
|
if test -n "$(ipv4_flavors)"; then \
|
|
|
|
echo "Running IPv4 flavors: $(ipv4_flavors)."; \
|
|
|
|
flavors="$$flavors $(ipv4_flavors)"; \
|
|
|
|
fi; \
|
|
|
|
test_network_ipv6=false; \
|
|
|
|
if test -n "$(ipv6_flavors)" || \
|
|
|
|
test -n "$(ipv6_mixed_flavors)"; then \
|
|
|
|
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 \
|
|
|
|
test_network_ipv6=true; \
|
|
|
|
fi; \
|
|
|
|
fi; \
|
|
|
|
if test -n "$(ipv6_flavors)"; then \
|
|
|
|
if test "$$test_network_ipv6" = "true"; then \
|
|
|
|
echo "ping6 ::1 or ping ::1 succeeded, running IPv6" \
|
|
|
|
"flavors: $(ipv6_flavors)."; \
|
|
|
|
flavors="$$flavors $(ipv6_flavors)"; \
|
|
|
|
else \
|
|
|
|
echo "ping6 ::1 and ping ::1 failed, skipping IPv6" \
|
|
|
|
"flavors: $(ipv6_flavors)."; \
|
|
|
|
skip_flavors="$$skip_flavors $(ipv6_flavors)"; \
|
|
|
|
fi; \
|
|
|
|
fi; \
|
|
|
|
test_network_mixed=false; \
|
|
|
|
if test -n "$(mixed_flavors)" || \
|
|
|
|
test -n "$(ipv6_mixed_flavors)"; then \
|
|
|
|
if command -v tor-stable >/dev/null 2>&1; then \
|
|
|
|
test_network_mixed=true; \
|
|
|
|
fi; \
|
|
|
|
fi; \
|
|
|
|
if test -n "$(mixed_flavors)"; then \
|
|
|
|
if test "$$test_network_mixed" = "true"; then \
|
|
|
|
echo "tor-stable found, running mixed flavors:" \
|
|
|
|
"$(mixed_flavors)."; \
|
|
|
|
flavors="$$flavors $(mixed_flavors)"; \
|
|
|
|
else \
|
|
|
|
echo "tor-stable not found, skipping mixed flavors:" \
|
|
|
|
"$(mixed_flavors)."; \
|
|
|
|
skip_flavors="$$skip_flavors $(mixed_flavors)"; \
|
|
|
|
fi; \
|
|
|
|
fi; \
|
|
|
|
if test -n "$(ipv6_mixed_flavors)"; then \
|
|
|
|
if test "$$test_network_ipv6" = "true" && \
|
|
|
|
test "$$test_network_mixed" = "true"; then \
|
|
|
|
echo "Running IPv6 mixed flavors:" \
|
|
|
|
"$(ipv6_mixed_flavors)."; \
|
|
|
|
flavors="$$flavors $(ipv6_mixed_flavors)"; \
|
|
|
|
else \
|
|
|
|
echo "Skipping IPv6 mixed flavors:" \
|
|
|
|
"$(ipv6_mixed_flavors)."; \
|
|
|
|
skip_flavors="$$skip_flavors $(ipv6_mixed_flavors)"; \
|
|
|
|
fi; \
|
|
|
|
fi; \
|
|
|
|
for f in $$skip_flavors; do \
|
2015-09-08 14:27:59 +02:00
|
|
|
echo "SKIP: $$f"; \
|
|
|
|
done; \
|
2020-02-17 05:26:41 +01:00
|
|
|
for f in $$flavors; do \
|
2020-02-14 01:34:17 +01:00
|
|
|
$(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" \
|
2020-02-13 01:09:33 +01:00
|
|
|
$(TEST_NETWORK_ALL_DRIVER_FLAGS) \
|
2020-02-14 01:34:17 +01:00
|
|
|
"$(top_srcdir)/src/test/test-network.sh" \
|
|
|
|
--flavor "$$f" $(TEST_NETWORK_FLAGS); \
|
|
|
|
"$(top_srcdir)/src/test/test-network.sh" \
|
2020-02-13 01:09:33 +01:00
|
|
|
$(TEST_NETWORK_SHOW_WARNINGS_FOR_LAST_RUN_FLAGS); \
|
|
|
|
done
|
|
|
|
|
|
|
|
# Print the results from automake's test-driver
|
|
|
|
# - show tor warnings on the console after each network run
|
|
|
|
# (otherwise, warnings go to the logs, and people don't see them unless
|
|
|
|
# there is a network failure)
|
|
|
|
.PHONY: test-network-results
|
2020-02-14 01:34:17 +01:00
|
|
|
# We need to grep all matching files, so we can't quote the glob part of the
|
|
|
|
# grep arguments
|
2020-02-13 01:09:33 +01:00
|
|
|
test-network-results:
|
2020-02-14 01:34:17 +01:00
|
|
|
@echo \
|
|
|
|
"Log and result files are available in $(TEST_NETWORK_ALL_LOG_DIR)."
|
|
|
|
@! grep -q FAIL "$(TEST_NETWORK_ALL_LOG_DIR)"/*.trs
|
2015-09-08 14:27:59 +02:00
|
|
|
|
2015-08-03 19:03:58 +02:00
|
|
|
need-stem-path:
|
|
|
|
@if test ! -d "$$STEM_SOURCE_DIR"; then \
|
2015-01-05 17:52:36 +01:00
|
|
|
echo '$$STEM_SOURCE_DIR was not set.'; echo; \
|
2023-06-19 14:09:24 +02:00
|
|
|
echo "To run these tests, git clone https://gitlab.torproject.org/tpo/network-health/stem ; export STEM_SOURCE_DIR=\`pwd\`/stem"; \
|
2015-08-03 19:03:58 +02:00
|
|
|
exit 1; \
|
2015-01-05 17:52:36 +01:00
|
|
|
fi
|
|
|
|
|
2016-04-05 17:47:37 +02:00
|
|
|
test-stem: need-stem-path $(TESTING_TOR_BINARY)
|
2019-08-29 13:56:16 +02:00
|
|
|
@$(PYTHON) "$$STEM_SOURCE_DIR"/run_tests.py --tor "$(TESTING_TOR_BINARY)" --integ --test control.controller --test control.base_controller --test process --log notice;
|
2015-08-03 19:03:58 +02:00
|
|
|
|
2016-04-05 17:47:37 +02:00
|
|
|
test-stem-full: need-stem-path $(TESTING_TOR_BINARY)
|
|
|
|
@$(PYTHON) "$$STEM_SOURCE_DIR"/run_tests.py --tor "$(TESTING_TOR_BINARY)" --all --log notice --target RUN_ALL,ONLINE -v;
|
2015-08-03 19:03:58 +02:00
|
|
|
|
2019-12-04 18:21:53 +01:00
|
|
|
test-full: \
|
|
|
|
need-stem-path \
|
|
|
|
need-chutney-path \
|
|
|
|
check \
|
|
|
|
test-network \
|
|
|
|
test-stem
|
|
|
|
|
|
|
|
test-full-online: \
|
|
|
|
need-stem-path \
|
|
|
|
need-chutney-path \
|
|
|
|
check \
|
|
|
|
test-network \
|
|
|
|
test-stem-full
|
2015-01-05 17:52:36 +01:00
|
|
|
|
2019-04-05 04:56:29 +02:00
|
|
|
# We can't delete the gcno files, because they are created when tor is compiled
|
2013-07-16 07:33:39 +02:00
|
|
|
reset-gcov:
|
2019-04-01 05:49:27 +02:00
|
|
|
rm -f $(top_builddir)/src/*/*.gcda $(top_builddir)/src/*/*/*.gcda \
|
|
|
|
$(top_builddir)/src/*/*.gcov $(top_builddir)/src/*/*/*.gcov
|
2013-07-16 07:33:39 +02:00
|
|
|
|
2015-02-17 15:36:10 +01:00
|
|
|
HTML_COVER_DIR=$(top_builddir)/coverage_html
|
2014-07-09 10:37:32 +02:00
|
|
|
coverage-html: all
|
2015-03-05 15:48:47 +01:00
|
|
|
if COVERAGE_ENABLED
|
2014-07-16 12:01:18 +02:00
|
|
|
test -e "`which lcov`" || (echo "lcov must be installed. See <http://ltp.sourceforge.net/coverage/lcov.php>." && false)
|
2015-02-17 15:36:10 +01:00
|
|
|
test -d "$(HTML_COVER_DIR)" || $(MKDIR_P) "$(HTML_COVER_DIR)"
|
|
|
|
lcov --rc lcov_branch_coverage=1 --directory $(top_builddir)/src --zerocounters
|
2014-07-16 12:01:18 +02:00
|
|
|
$(MAKE) reset-gcov
|
|
|
|
$(MAKE) check
|
2015-02-17 15:36:10 +01:00
|
|
|
lcov --capture --rc lcov_branch_coverage=1 --no-external --directory $(top_builddir) --base-directory $(top_srcdir) --output-file "$(HTML_COVER_DIR)/lcov.tmp"
|
2014-07-09 10:37:32 +02:00
|
|
|
lcov --remove "$(HTML_COVER_DIR)/lcov.tmp" --rc lcov_branch_coverage=1 'test/*' 'ext/tinytest*' '/usr/*' --output-file "$(HTML_COVER_DIR)/lcov.info"
|
|
|
|
genhtml --branch-coverage -o "$(HTML_COVER_DIR)" "$(HTML_COVER_DIR)/lcov.info"
|
2015-03-05 15:48:47 +01:00
|
|
|
else
|
|
|
|
@printf "Not configured with --enable-coverage, run ./configure --enable-coverage\n"
|
|
|
|
endif
|
2014-07-09 10:37:32 +02:00
|
|
|
|
2015-03-20 13:12:09 +01:00
|
|
|
coverage-html-full: all
|
|
|
|
test -e "`which lcov`" || (echo "lcov must be installed. See <http://ltp.sourceforge.net/coverage/lcov.php>." && false)
|
|
|
|
test -d "$(HTML_COVER_DIR)" || mkdir -p "$(HTML_COVER_DIR)"
|
|
|
|
lcov --rc lcov_branch_coverage=1 --directory ./src --zerocounters
|
|
|
|
$(MAKE) reset-gcov
|
|
|
|
$(MAKE) check
|
|
|
|
$(MAKE) test-stem-full
|
2015-03-22 04:22:04 +01:00
|
|
|
CHUTNEY_TOR=tor-cov CHUTNEY_TOR_GENCERT=tor-cov-gencert $(top_srcdir)/src/test/test-network.sh
|
|
|
|
CHUTNEY_TOR=tor-cov CHUTNEY_TOR_GENCERT=tor-cov-gencert $(top_srcdir)/src/test/test-network.sh --flavor hs
|
2015-03-20 13:12:09 +01:00
|
|
|
lcov --capture --rc lcov_branch_coverage=1 --no-external --directory . --output-file "$(HTML_COVER_DIR)/lcov.tmp"
|
|
|
|
lcov --remove "$(HTML_COVER_DIR)/lcov.tmp" --rc lcov_branch_coverage=1 'test/*' 'ext/tinytest*' '/usr/*' --output-file "$(HTML_COVER_DIR)/lcov.info"
|
|
|
|
genhtml --branch-coverage -o "$(HTML_COVER_DIR)" "$(HTML_COVER_DIR)/lcov.info"
|
|
|
|
|
2019-05-20 18:08:30 +02:00
|
|
|
# For scripts: avoid src/ext and src/trunnel.
|
2019-11-26 00:20:57 +01:00
|
|
|
# Keep these lists consistent:
|
|
|
|
# - OWNED_TOR_C_FILES in Makefile.am
|
|
|
|
# - CHECK_FILES in pre-commit.git-hook and pre-push.git-hook
|
|
|
|
# - try_parse in check_cocci_parse.sh
|
2019-05-20 18:08:30 +02:00
|
|
|
OWNED_TOR_C_FILES=\
|
2018-06-21 20:22:15 +02:00
|
|
|
$(top_srcdir)/src/lib/*/*.[ch] \
|
2018-07-05 22:52:12 +02:00
|
|
|
$(top_srcdir)/src/core/*/*.[ch] \
|
|
|
|
$(top_srcdir)/src/feature/*/*.[ch] \
|
|
|
|
$(top_srcdir)/src/app/*/*.[ch] \
|
2015-02-17 15:36:10 +01:00
|
|
|
$(top_srcdir)/src/test/*.[ch] \
|
2016-12-14 23:11:26 +01:00
|
|
|
$(top_srcdir)/src/test/*/*.[ch] \
|
2015-08-20 20:33:38 +02:00
|
|
|
$(top_srcdir)/src/tools/*.[ch]
|
2019-05-20 18:08:30 +02:00
|
|
|
|
|
|
|
check-spaces:
|
|
|
|
if USE_PERL
|
|
|
|
$(PERL) $(top_srcdir)/scripts/maint/checkSpace.pl -C \
|
|
|
|
$(OWNED_TOR_C_FILES)
|
2016-12-15 13:02:42 +01:00
|
|
|
endif
|
2004-11-09 21:04:00 +01:00
|
|
|
|
2018-06-21 20:20:43 +02:00
|
|
|
check-includes:
|
|
|
|
if USEPYTHON
|
2019-11-06 03:29:35 +01:00
|
|
|
$(PYTHON) $(top_srcdir)/scripts/maint/practracker/includes.py $(top_srcdir)
|
2018-06-21 20:20:43 +02:00
|
|
|
endif
|
|
|
|
|
2019-02-28 11:09:10 +01:00
|
|
|
check-best-practices:
|
|
|
|
if USEPYTHON
|
2019-08-01 18:57:26 +02:00
|
|
|
@$(PYTHON) $(top_srcdir)/scripts/maint/practracker/practracker.py $(top_srcdir) $(TOR_PRACTRACKER_OPTIONS)
|
2019-02-28 11:09:10 +01:00
|
|
|
endif
|
|
|
|
|
2019-10-23 07:44:17 +02:00
|
|
|
check-cocci:
|
|
|
|
VERBOSE=1 $(top_srcdir)/scripts/coccinelle/check_cocci_parse.sh $(OWNED_TOR_C_FILES)
|
|
|
|
|
2019-03-25 21:07:58 +01:00
|
|
|
practracker-regen:
|
|
|
|
$(PYTHON) $(top_srcdir)/scripts/maint/practracker/practracker.py --regen $(top_srcdir)
|
|
|
|
|
2015-03-11 10:47:13 +01:00
|
|
|
check-docs: all
|
|
|
|
$(PERL) $(top_builddir)/scripts/maint/checkOptionDocs.pl
|
2006-12-20 18:05:48 +01:00
|
|
|
|
2006-09-30 00:33:28 +02:00
|
|
|
check-logs:
|
2015-02-17 15:36:10 +01:00
|
|
|
$(top_srcdir)/scripts/maint/checkLogs.pl \
|
|
|
|
$(top_srcdir)/src/*/*.[ch] | sort -n
|
2006-10-08 05:17:24 +02:00
|
|
|
|
2018-01-29 23:03:01 +01:00
|
|
|
.PHONY: check-typos
|
|
|
|
check-typos:
|
|
|
|
@if test -x "`which misspell 2>&1;true`"; then \
|
|
|
|
echo "Checking for Typos ..."; \
|
2018-04-14 21:35:49 +02:00
|
|
|
(misspell \
|
|
|
|
$(top_srcdir)/src/[^e]*/*.[ch] \
|
2018-01-29 23:03:01 +01:00
|
|
|
$(top_srcdir)/doc \
|
|
|
|
$(top_srcdir)/contrib \
|
|
|
|
$(top_srcdir)/scripts \
|
2022-02-07 16:07:33 +01:00
|
|
|
$(top_srcdir)/README.md \
|
2018-01-29 23:03:01 +01:00
|
|
|
$(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
|
|
|
|
|
2015-03-06 11:56:57 +01:00
|
|
|
.PHONY: check-changes
|
|
|
|
check-changes:
|
2017-09-21 23:32:17 +02:00
|
|
|
if USEPYTHON
|
2015-03-06 11:56:57 +01:00
|
|
|
@if test -d "$(top_srcdir)/changes"; then \
|
2018-09-18 12:39:03 +02:00
|
|
|
PACKAGE_VERSION=$(PACKAGE_VERSION) $(PYTHON) $(top_srcdir)/scripts/maint/lintChanges.py $(top_srcdir)/changes; \
|
2015-03-06 11:56:57 +01:00
|
|
|
fi
|
2017-09-21 23:32:17 +02:00
|
|
|
endif
|
2015-03-06 11:56:57 +01:00
|
|
|
|
2015-03-12 09:28:41 +01:00
|
|
|
.PHONY: update-versions
|
|
|
|
update-versions:
|
2018-11-25 02:03:48 +01:00
|
|
|
abs_top_srcdir="$(abs_top_srcdir)" $(PYTHON) $(top_srcdir)/scripts/maint/update_versions.py
|
2015-03-12 09:28:41 +01:00
|
|
|
|
2017-09-07 16:51:02 +02:00
|
|
|
.PHONY: callgraph
|
|
|
|
callgraph:
|
2019-11-16 10:57:22 +01:00
|
|
|
cd $(top_builddir); $(abs_top_srcdir)/scripts/maint/run_calltool.sh
|
2017-09-07 16:51:02 +02:00
|
|
|
|
2011-11-25 05:53:18 +01:00
|
|
|
version:
|
|
|
|
@echo "Tor @VERSION@"
|
|
|
|
@if test -d "$(top_srcdir)/.git" && test -x "`which git 2>&1;true`"; then \
|
|
|
|
echo -n "git: " ;\
|
|
|
|
(cd "$(top_srcdir)" && git rev-parse --short=16 HEAD); \
|
|
|
|
fi
|
|
|
|
|
2019-05-20 18:08:30 +02:00
|
|
|
.PHONY: autostyle-ifdefs
|
|
|
|
autostyle-ifdefs:
|
2019-11-05 02:56:14 +01:00
|
|
|
$(PYTHON) $(top_srcdir)/scripts/maint/annotate_ifdef_directives.py $(OWNED_TOR_C_FILES)
|
2019-05-20 18:08:30 +02:00
|
|
|
|
|
|
|
.PHONY: autostyle-ifdefs
|
|
|
|
autostyle-operators:
|
2019-11-05 02:56:14 +01:00
|
|
|
$(PERL) $(top_srcdir)/scripts/coccinelle/test-operator-cleanup $(OWNED_TOR_C_FILES)
|
2019-05-20 18:08:30 +02:00
|
|
|
|
|
|
|
.PHONY: rectify-includes
|
|
|
|
rectify-includes:
|
2019-11-16 10:57:22 +01:00
|
|
|
cd $(top_srcdir); $(PYTHON) $(abs_top_srcdir)/scripts/maint/rectify_include_paths.py
|
2019-05-20 18:08:30 +02:00
|
|
|
|
|
|
|
.PHONY: update-copyright
|
|
|
|
update-copyright:
|
2019-11-05 02:56:14 +01:00
|
|
|
$(PERL) $(top_srcdir)/scripts/maint/updateCopyright.pl $(OWNED_TOR_C_FILES)
|
2019-05-20 18:08:30 +02:00
|
|
|
|
|
|
|
.PHONY: autostyle
|
2021-09-14 17:03:00 +02:00
|
|
|
autostyle: update-versions autostyle-ifdefs rectify-includes
|
2019-05-20 18:08:30 +02:00
|
|
|
|
2013-07-09 18:37:11 +02:00
|
|
|
mostlyclean-local:
|
2015-02-17 15:36:10 +01:00
|
|
|
rm -f $(top_builddir)/src/*/*.gc{da,no} $(top_builddir)/src/*/*/*.gc{da,no}
|
|
|
|
rm -rf $(HTML_COVER_DIR)
|
|
|
|
rm -rf $(top_builddir)/doc/doxygen
|
2015-09-08 14:27:59 +02:00
|
|
|
rm -rf $(TEST_NETWORK_ALL_LOG_DIR)
|
2017-04-29 09:15:14 +02:00
|
|
|
|
2018-04-26 21:22:52 +02:00
|
|
|
# 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.
|
|
|
|
show-distdir-testlog:
|
|
|
|
@if test -d "$(distdir)/_build/sub"; then \
|
|
|
|
cat $(distdir)/_build/sub/$(TEST_SUITE_LOG); \
|
|
|
|
else \
|
|
|
|
cat $(distdir)/_build/$(TEST_SUITE_LOG); fi
|
2018-07-01 16:08:54 +02:00
|
|
|
|
2018-10-12 03:25:41 +02:00
|
|
|
# Similarly, this relies on automake internals to run file on an
|
|
|
|
# intermittent core file whose provenance is not known to us. See
|
|
|
|
# ticket 26787.
|
|
|
|
show-distdir-core:
|
|
|
|
@if test -d "$(distdir)/_build/sub"; then \
|
|
|
|
file $(distdir)/_build/sub/core ; \
|
|
|
|
else \
|
|
|
|
file $(distdir)/_build/core; fi
|
|
|
|
|
2018-07-01 16:08:54 +02:00
|
|
|
show-libs:
|
2020-09-18 18:17:02 +02:00
|
|
|
@echo libtor.a
|
2018-07-01 16:08:54 +02:00
|
|
|
|
|
|
|
show-testing-libs:
|
2020-09-18 18:17:02 +02:00
|
|
|
@echo src/test/libtor-testing.a
|
2020-12-16 16:01:15 +01:00
|
|
|
|
|
|
|
# Note here that we hardcode this -j2 because if the user would pass too many
|
|
|
|
# cores, bear actually chockes and dies :S. For this to work, a make clean
|
|
|
|
# needs to be done else bear will miss some compile flags.
|
|
|
|
lsp:
|
|
|
|
@if test -x "`which bear 2>&1;true`"; then \
|
|
|
|
echo "Generating LSP compile_commands.json. Might take few minutes..."; \
|
|
|
|
$(MAKE) clean 2>&1 >/dev/null; \
|
|
|
|
bear >/dev/null 2>&1 -- $(MAKE) -j2 2>&1 >/dev/null; \
|
|
|
|
echo "Generating .ccls file..."; \
|
|
|
|
./scripts/maint/gen_ccls_file.sh \
|
|
|
|
else \
|
|
|
|
echo "No bear command found. On debian, apt install bear"; \
|
|
|
|
fi
|
2021-10-28 22:29:22 +02:00
|
|
|
|
|
|
|
# Reproducible tarball. We change the tar options for this.
|
|
|
|
dist-reprod:
|
|
|
|
$(MAKE) dist am__tar="$${TAR-tar} --format=gnu --owner=root --group=root --sort=name --mtime=\"`git show --no-patch --format='%ci'`\" -chof - $(distdir)"
|