1 # Copyright (c) 2001-2004, Roger Dingledine
2 # Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson
3 # Copyright (c) 2007-2019, The Tor Project, Inc.
4 # See LICENSE for licensing information
6 ACLOCAL_AMFLAGS = -I m4
21 -I$(top_srcdir)/src/ext \
22 -I$(top_srcdir)/src/ext/trunnel \
23 -I$(top_srcdir)/src/trunnel
26 @TOR_SYSTEMD_CFLAGS@ \
34 TESTING_TOR_BINARY=$(top_builddir)/src/app/tor-cov$(EXEEXT)
36 TESTING_TOR_BINARY=$(top_builddir)/src/app/tor$(EXEEXT)
39 # "Common" libraries used to link tor's utility code.
41 src/lib/libtor-geoip.a \
42 src/lib/libtor-process.a \
43 src/lib/libtor-buf.a \
44 src/lib/libtor-confmgt.a \
45 src/lib/libtor-pubsub.a \
46 src/lib/libtor-dispatch.a \
47 src/lib/libtor-time.a \
49 src/lib/libtor-encoding.a \
50 src/lib/libtor-sandbox.a \
51 src/lib/libtor-container.a \
52 src/lib/libtor-net.a \
53 src/lib/libtor-thread.a \
54 src/lib/libtor-memarea.a \
55 src/lib/libtor-math.a \
56 src/lib/libtor-meminfo.a \
57 src/lib/libtor-osinfo.a \
58 src/lib/libtor-log.a \
59 src/lib/libtor-lock.a \
60 src/lib/libtor-fdio.a \
61 src/lib/libtor-string.a \
62 src/lib/libtor-term.a \
63 src/lib/libtor-smartlist-core.a \
64 src/lib/libtor-malloc.a \
65 src/lib/libtor-wallclock.a \
66 src/lib/libtor-err.a \
67 src/lib/libtor-version.a \
68 src/lib/libtor-llharden.a \
69 src/lib/libtor-intmath.a \
70 src/lib/libtor-ctime.a \
71 src/lib/libtor-metrics.a
73 # Variants of the above for linking the testing variant of tor (for coverage
76 TOR_UTIL_TESTING_LIBS = \
77 src/lib/libtor-geoip-testing.a \
78 src/lib/libtor-process-testing.a \
79 src/lib/libtor-buf-testing.a \
80 src/lib/libtor-confmgt-testing.a \
81 src/lib/libtor-pubsub-testing.a \
82 src/lib/libtor-dispatch-testing.a \
83 src/lib/libtor-time-testing.a \
84 src/lib/libtor-fs-testing.a \
85 src/lib/libtor-encoding-testing.a \
86 src/lib/libtor-sandbox-testing.a \
87 src/lib/libtor-container-testing.a \
88 src/lib/libtor-net-testing.a \
89 src/lib/libtor-thread-testing.a \
90 src/lib/libtor-memarea-testing.a \
91 src/lib/libtor-math-testing.a \
92 src/lib/libtor-meminfo-testing.a \
93 src/lib/libtor-osinfo-testing.a \
94 src/lib/libtor-term-testing.a \
95 src/lib/libtor-log-testing.a \
96 src/lib/libtor-lock-testing.a \
97 src/lib/libtor-fdio-testing.a \
98 src/lib/libtor-string-testing.a \
99 src/lib/libtor-smartlist-core-testing.a \
100 src/lib/libtor-malloc-testing.a \
101 src/lib/libtor-wallclock-testing.a \
102 src/lib/libtor-err-testing.a \
103 src/lib/libtor-version-testing.a \
104 src/lib/libtor-llharden-testing.a \
105 src/lib/libtor-intmath.a \
106 src/lib/libtor-ctime-testing.a \
107 src/lib/libtor-metrics-testing.a
110 # Internal crypto libraries used in Tor
112 src/lib/libtor-tls.a \
113 src/lib/libtor-crypt-ops.a \
117 # Variants of the above for linking the testing variant of tor (for coverage
120 TOR_CRYPTO_TESTING_LIBS = \
121 src/lib/libtor-tls-testing.a \
122 src/lib/libtor-crypt-ops-testing.a \
127 # All static libraries used to link tor.
128 TOR_INTERNAL_LIBS = \
129 src/core/libtor-app.a \
130 src/lib/libtor-compress.a \
131 src/lib/libtor-evloop.a \
134 src/trunnel/libor-trunnel.a \
135 src/lib/libtor-trace.a
137 libtor.a: $(TOR_INTERNAL_LIBS)
138 $(AM_V_AR) export AR="$(AR)"; \
139 export ARFLAGS="$(ARFLAGS)"; \
140 export RANLIB="$(RANLIB)"; \
141 $(top_srcdir)/scripts/build/combine_libs libtor.a $(TOR_INTERNAL_LIBS)
143 MOSTLYCLEANFILES += libtor.a
145 # Variants of the above for linking the testing variant of tor (for coverage
148 TOR_INTERNAL_TESTING_LIBS = \
149 src/core/libtor-app-testing.a \
150 src/lib/libtor-compress-testing.a \
151 src/lib/libtor-evloop-testing.a \
152 $(TOR_CRYPTO_TESTING_LIBS) \
153 $(TOR_UTIL_TESTING_LIBS) \
154 src/trunnel/libor-trunnel-testing.a \
155 src/lib/libtor-trace.a
157 src/test/libtor-testing.a: $(TOR_INTERNAL_TESTING_LIBS)
158 $(AM_V_AR) export AR="$(AR)"; \
159 export ARFLAGS="$(ARFLAGS)"; \
160 export RANLIB="$(RANLIB)"; \
161 $(top_srcdir)/scripts/build/combine_libs src/test/libtor-testing.a $(TOR_INTERNAL_TESTING_LIBS)
163 MOSTLYCLEANFILES += src/test/libtor-testing.a
166 TOR_LDFLAGS_CRYPTLIB=@TOR_LDFLAGS_openssl@
167 TOR_LIBS_CRYPTLIB=@TOR_OPENSSL_LIBS@
170 TOR_CFLAGS_CRYPTLIB+=@NSS_CFLAGS@
171 TOR_LIBS_CRYPTLIB+=@NSS_LIBS@
174 # All libraries used to link tor-cov
176 include src/include.am
177 include doc/include.am
178 include contrib/include.am
180 manpages: $(nodist_man1_MANS)
190 scripts/build/combine_libs \
191 scripts/maint/checkIncludes.py \
192 scripts/maint/checkSpace.pl \
193 scripts/maint/checkSpaceTest.sh \
194 scripts/maint/checkspace_tests/dubious.c \
195 scripts/maint/checkspace_tests/dubious.h \
196 scripts/maint/checkspace_tests/expected.txt \
197 scripts/maint/checkspace_tests/good_guard.h \
198 scripts/maint/checkspace_tests/same_guard.h \
199 scripts/maint/checkspace_tests/subdir/dubious.c \
200 scripts/maint/checkShellScripts.sh \
201 scripts/maint/practracker/README \
202 scripts/maint/practracker/exceptions.txt \
203 scripts/maint/practracker/includes.py \
204 scripts/maint/practracker/metrics.py \
205 scripts/maint/practracker/practracker.py \
206 scripts/maint/practracker/practracker_tests.py \
207 scripts/maint/practracker/problem.py \
208 scripts/maint/practracker/testdata/.may_include \
209 scripts/maint/practracker/testdata/a.c \
210 scripts/maint/practracker/testdata/b.c \
211 scripts/maint/practracker/testdata/ex0-expected.txt \
212 scripts/maint/practracker/testdata/ex0.txt \
213 scripts/maint/practracker/testdata/ex1-expected.txt \
214 scripts/maint/practracker/testdata/ex1.txt \
215 scripts/maint/practracker/testdata/ex1-overbroad-expected.txt \
216 scripts/maint/practracker/testdata/ex1-regen-expected.txt \
217 scripts/maint/practracker/testdata/ex1-regen-overbroad-expected.txt \
218 scripts/maint/practracker/testdata/ex.txt \
219 scripts/maint/practracker/testdata/header.h \
220 scripts/maint/practracker/testdata/not_c_file \
221 scripts/maint/practracker/test_practracker.sh \
222 scripts/maint/practracker/util.py \
223 scripts/coccinelle/apply.sh \
224 scripts/coccinelle/check_cocci_parse.sh \
225 scripts/coccinelle/exceptions.txt \
226 scripts/coccinelle/test-operator-cleanup \
227 scripts/coccinelle/tor-coccinelle.h \
228 scripts/coccinelle/try_parse.sh
230 ## This tells etags how to find mockable function definitions.
231 AM_ETAGSFLAGS=--regex='{c}/MOCK_IMPL([^,]+,\W*\([a-zA-Z0-9_]+\)\W*,/\1/s'
234 TEST_CFLAGS=-fno-inline -fprofile-arcs -ftest-coverage
235 if DISABLE_ASSERTS_IN_UNIT_TESTS
236 TEST_CPPFLAGS=-DTOR_UNIT_TESTS -DTOR_COVERAGE -DDISABLE_ASSERTS_IN_UNIT_TESTS @TOR_MODULES_ALL_ENABLED@
238 TEST_CPPFLAGS=-DTOR_UNIT_TESTS -DTOR_COVERAGE @TOR_MODULES_ALL_ENABLED@
240 TEST_NETWORK_FLAGS=--coverage --hs-multi-client 1
243 TEST_CPPFLAGS=-DTOR_UNIT_TESTS @TOR_MODULES_ALL_ENABLED@
244 TEST_NETWORK_FLAGS=--hs-multi-client 1
246 TEST_NETWORK_SHOW_WARNINGS_FOR_LAST_RUN_FLAGS=--quiet --only-warnings
249 TEST_CFLAGS += -fsanitize=fuzzer-no-link
253 TEST_NETWORK_ALL_LOG_DIR=$(top_builddir)/test_network_log
254 TEST_NETWORK_ALL_DRIVER_FLAGS=--color-tests yes
257 # $(INSTALL) -m 755 -d $(LOCALSTATEDIR)/lib/tor
259 # Allows to override rpmbuild with rpmbuild-md5 from fedora-packager so that
260 # building for EL5 won't fail on https://bugzilla.redhat.com/show_bug.cgi?id=490613
263 # Use automake's dist-gzip target to build the tarball
265 TIMESTAMP=$$(date +"%Y-%m-%d_%H.%M.%S"); \
266 RPM_BUILD_DIR=$$(mktemp -d "/tmp/tor-rpm-build-$$TIMESTAMP-XXXX"); \
267 mkdir -p "$$RPM_BUILD_DIR"/{BUILD,RPMS,SOURCES/"tor-$(VERSION)",SPECS,SRPMS}; \
268 cp -fa "$(distdir).tar.gz" "$$RPM_BUILD_DIR"/SOURCES/; \
269 LIBS=-lrt $(RPMBUILD) -ba --define "_topdir $$RPM_BUILD_DIR" tor.spec; \
270 cp -fa "$$RPM_BUILD_DIR"/SRPMS/* .; \
271 cp -fa "$$RPM_BUILD_DIR"/RPMS/* .; \
272 rm -rf "$$RPM_BUILD_DIR"; \
273 echo "RPM build finished"; \
279 (cd "$(top_srcdir)" && doxygen "$(abs_top_builddir)/Doxyfile")
282 $(top_builddir)/src/test/test
285 $(top_srcdir)/scripts/maint/checkShellScripts.sh
293 # test-network requires a copy of Chutney in $CHUTNEY_PATH.
294 # Chutney can be cloned from https://git.torproject.org/chutney.git .
295 .PHONY: need-chutney-path
297 @if test ! -d "$$CHUTNEY_PATH"; then \
298 echo '$$CHUTNEY_PATH was not set.'; \
299 if test -d "$(top_srcdir)/../chutney" && \
300 test -x "$(top_srcdir)/../chutney/chutney"; then \
301 echo "Assuming test-network.sh will find" \
302 "$(top_srcdir)/../chutney"; \
305 echo "To run these tests," \
307 "https://git.torproject.org/chutney.git ;" \
308 "export CHUTNEY_PATH=\`pwd\`/chutney"; \
313 # Run some basic tests using automake's test-driver
315 # Hide directory path logs from submakes using $(MAKE) -s
317 @$(MAKE) -s test-network-mkdir
318 @$(MAKE) -s test-network-clean
319 @$(MAKE) -s test-network-run \
320 ipv4_flavors="$(TEST_CHUTNEY_FLAVOR_QUICK)" \
321 ipv6_flavors="$(TEST_CHUTNEY_FLAVOR_QUICK_IPV6)"
322 @$(MAKE) -s test-network-results
324 # Run all available tests using automake's test-driver
325 .PHONY: test-network-all
326 # Hide directory path logs from submakes using $(MAKE) -s
328 @$(MAKE) -s test-network-mkdir
329 @$(MAKE) -s test-network-clean
330 @$(MAKE) -s test-network-run \
331 ipv4_flavors="$(TEST_CHUTNEY_FLAVORS)" \
332 mixed_flavors="$(TEST_CHUTNEY_FLAVORS_MIXED)" \
333 ipv6_flavors="$(TEST_CHUTNEY_FLAVORS_IPV6)" \
334 ipv6_mixed_flavors="$(TEST_CHUTNEY_FLAVORS_IPV6_MIXED)"
335 @$(MAKE) -s test-network-results
337 # Run IPv4 and mixed tests using automake's test-driver
338 .PHONY: test-network-ipv4
339 # Hide directory path logs from submakes using $(MAKE) -s
341 @$(MAKE) -s test-network-mkdir
342 @$(MAKE) -s test-network-clean
343 @$(MAKE) -s test-network-run \
344 ipv4_flavors="$(TEST_CHUTNEY_FLAVORS)" \
345 mixed_flavors="$(TEST_CHUTNEY_FLAVORS_MIXED)"
346 @$(MAKE) -s test-network-results
348 # Run IPv6 tests using automake's test-driver
349 .PHONY: test-network-ipv6
350 # Hide directory path logs from submakes using $(MAKE) -s
352 @$(MAKE) -s test-network-mkdir
353 @$(MAKE) -s test-network-clean
354 @$(MAKE) -s test-network-run \
355 ipv6_flavors="$(TEST_CHUTNEY_FLAVORS_IPV6)" \
356 ipv6_mixed_flavors="$(TEST_CHUTNEY_FLAVORS_IPV6_MIXED)"
357 @$(MAKE) -s test-network-results
359 # Make the test network log directory, if it does not exist
360 .PHONY: test-network-mkdir
362 @mkdir -p "$(TEST_NETWORK_ALL_LOG_DIR)"
364 # Clean the test network log directory
365 .PHONY: test-network-clean
366 # We need to remove all matching files, so we can't quote the glob part of the
369 rm -f "$(TEST_NETWORK_ALL_LOG_DIR)"/*.log \
370 "$(TEST_NETWORK_ALL_LOG_DIR)"/*.trs
372 # Run tests using automake's test-driver
373 # When checking if a set of test can be run, log the type of test, and the
374 # list of tests that will be run (or skipped).
376 # Run the IPv4 tests in $(ipv4_flavors), unconditionally
377 # - tor relays and directory authorities require IPv4.
378 # Run the IPv6 tests in $(ipv6_flavors), if IPv6 is available
379 # - only run IPv6 tests if we can ping6 or ping -6 ::1 (localhost)
380 # we try the syntax for BSD ping6, Linux ping6, and Linux ping -6,
381 # because they're incompatible
382 # - some IPv6 tests may fail without an IPv6 DNS server
383 # (see #16971 and #17011)
384 # Run the mixed tests in $(mixed_flavors), if a tor-stable binary is available
385 # - only run mixed tests if we have a tor-stable binary
386 # Run the IPv6 mixed tests in $(ipv6_mixed_flavors), if IPv6 and mixed are run
387 # - see above for details about IPv6 and mixed
388 .PHONY: test-network-run
389 # We need the word splitting in the "for" lines, so we can't quote
390 # $(skip_flavors) or $(flavors)
391 test-network-run: need-chutney-path test-driver $(TESTING_TOR_BINARY) src/tools/tor-gencert
394 if test -n "$(ipv4_flavors)"; then \
395 echo "Running IPv4 flavors: $(ipv4_flavors)."; \
396 flavors="$$flavors $(ipv4_flavors)"; \
398 test_network_ipv6=false; \
399 if test -n "$(ipv6_flavors)" || \
400 test -n "$(ipv6_mixed_flavors)"; then \
401 if ping6 -q -c 1 -o ::1 >/dev/null 2>&1 || \
402 ping6 -q -c 1 -W 1 ::1 >/dev/null 2>&1 || \
403 ping -6 -c 1 -W 1 ::1 >/dev/null 2>&1; then \
404 test_network_ipv6=true; \
407 if test -n "$(ipv6_flavors)"; then \
408 if test "$$test_network_ipv6" = "true"; then \
409 echo "ping6 ::1 or ping ::1 succeeded, running IPv6" \
410 "flavors: $(ipv6_flavors)."; \
411 flavors="$$flavors $(ipv6_flavors)"; \
413 echo "ping6 ::1 and ping ::1 failed, skipping IPv6" \
414 "flavors: $(ipv6_flavors)."; \
415 skip_flavors="$$skip_flavors $(ipv6_flavors)"; \
418 test_network_mixed=false; \
419 if test -n "$(mixed_flavors)" || \
420 test -n "$(ipv6_mixed_flavors)"; then \
421 if command -v tor-stable >/dev/null 2>&1; then \
422 test_network_mixed=true; \
425 if test -n "$(mixed_flavors)"; then \
426 if test "$$test_network_mixed" = "true"; then \
427 echo "tor-stable found, running mixed flavors:" \
428 "$(mixed_flavors)."; \
429 flavors="$$flavors $(mixed_flavors)"; \
431 echo "tor-stable not found, skipping mixed flavors:" \
432 "$(mixed_flavors)."; \
433 skip_flavors="$$skip_flavors $(mixed_flavors)"; \
436 if test -n "$(ipv6_mixed_flavors)"; then \
437 if test "$$test_network_ipv6" = "true" && \
438 test "$$test_network_mixed" = "true"; then \
439 echo "Running IPv6 mixed flavors:" \
440 "$(ipv6_mixed_flavors)."; \
441 flavors="$$flavors $(ipv6_mixed_flavors)"; \
443 echo "Skipping IPv6 mixed flavors:" \
444 "$(ipv6_mixed_flavors)."; \
445 skip_flavors="$$skip_flavors $(ipv6_mixed_flavors)"; \
448 for f in $$skip_flavors; do \
451 for f in $$flavors; do \
452 $(SHELL) "$(top_srcdir)/test-driver" --test-name "$$f" \
453 --log-file "$(TEST_NETWORK_ALL_LOG_DIR)/$$f.log" \
454 --trs-file "$(TEST_NETWORK_ALL_LOG_DIR)/$$f.trs" \
455 $(TEST_NETWORK_ALL_DRIVER_FLAGS) \
456 "$(top_srcdir)/src/test/test-network.sh" \
457 --flavor "$$f" $(TEST_NETWORK_FLAGS); \
458 "$(top_srcdir)/src/test/test-network.sh" \
459 $(TEST_NETWORK_SHOW_WARNINGS_FOR_LAST_RUN_FLAGS); \
462 # Print the results from automake's test-driver
463 # - show tor warnings on the console after each network run
464 # (otherwise, warnings go to the logs, and people don't see them unless
465 # there is a network failure)
466 .PHONY: test-network-results
467 # We need to grep all matching files, so we can't quote the glob part of the
469 test-network-results:
471 "Log and result files are available in $(TEST_NETWORK_ALL_LOG_DIR)."
472 @! grep -q FAIL "$(TEST_NETWORK_ALL_LOG_DIR)"/*.trs
475 @if test ! -d "$$STEM_SOURCE_DIR"; then \
476 echo '$$STEM_SOURCE_DIR was not set.'; echo; \
477 echo "To run these tests, git clone https://git.torproject.org/stem.git/ ; export STEM_SOURCE_DIR=\`pwd\`/stem"; \
481 test-stem: need-stem-path $(TESTING_TOR_BINARY)
482 @$(PYTHON) "$$STEM_SOURCE_DIR"/run_tests.py --tor "$(TESTING_TOR_BINARY)" --integ --test control.controller --test control.base_controller --test process --log notice;
484 test-stem-full: need-stem-path $(TESTING_TOR_BINARY)
485 @$(PYTHON) "$$STEM_SOURCE_DIR"/run_tests.py --tor "$(TESTING_TOR_BINARY)" --all --log notice --target RUN_ALL,ONLINE -v;
501 # We can't delete the gcno files, because they are created when tor is compiled
503 rm -f $(top_builddir)/src/*/*.gcda $(top_builddir)/src/*/*/*.gcda \
504 $(top_builddir)/src/*/*.gcov $(top_builddir)/src/*/*/*.gcov
506 HTML_COVER_DIR=$(top_builddir)/coverage_html
509 test -e "`which lcov`" || (echo "lcov must be installed. See <http://ltp.sourceforge.net/coverage/lcov.php>." && false)
510 test -d "$(HTML_COVER_DIR)" || $(MKDIR_P) "$(HTML_COVER_DIR)"
511 lcov --rc lcov_branch_coverage=1 --directory $(top_builddir)/src --zerocounters
514 lcov --capture --rc lcov_branch_coverage=1 --no-external --directory $(top_builddir) --base-directory $(top_srcdir) --output-file "$(HTML_COVER_DIR)/lcov.tmp"
515 lcov --remove "$(HTML_COVER_DIR)/lcov.tmp" --rc lcov_branch_coverage=1 'test/*' 'ext/tinytest*' '/usr/*' --output-file "$(HTML_COVER_DIR)/lcov.info"
516 genhtml --branch-coverage -o "$(HTML_COVER_DIR)" "$(HTML_COVER_DIR)/lcov.info"
518 @printf "Not configured with --enable-coverage, run ./configure --enable-coverage\n"
521 coverage-html-full: all
522 test -e "`which lcov`" || (echo "lcov must be installed. See <http://ltp.sourceforge.net/coverage/lcov.php>." && false)
523 test -d "$(HTML_COVER_DIR)" || mkdir -p "$(HTML_COVER_DIR)"
524 lcov --rc lcov_branch_coverage=1 --directory ./src --zerocounters
527 $(MAKE) test-stem-full
528 CHUTNEY_TOR=tor-cov CHUTNEY_TOR_GENCERT=tor-cov-gencert $(top_srcdir)/src/test/test-network.sh
529 CHUTNEY_TOR=tor-cov CHUTNEY_TOR_GENCERT=tor-cov-gencert $(top_srcdir)/src/test/test-network.sh --flavor hs
530 lcov --capture --rc lcov_branch_coverage=1 --no-external --directory . --output-file "$(HTML_COVER_DIR)/lcov.tmp"
531 lcov --remove "$(HTML_COVER_DIR)/lcov.tmp" --rc lcov_branch_coverage=1 'test/*' 'ext/tinytest*' '/usr/*' --output-file "$(HTML_COVER_DIR)/lcov.info"
532 genhtml --branch-coverage -o "$(HTML_COVER_DIR)" "$(HTML_COVER_DIR)/lcov.info"
534 # For scripts: avoid src/ext and src/trunnel.
535 # Keep these lists consistent:
536 # - OWNED_TOR_C_FILES in Makefile.am
537 # - CHECK_FILES in pre-commit.git-hook and pre-push.git-hook
538 # - try_parse in check_cocci_parse.sh
540 $(top_srcdir)/src/lib/*/*.[ch] \
541 $(top_srcdir)/src/core/*/*.[ch] \
542 $(top_srcdir)/src/feature/*/*.[ch] \
543 $(top_srcdir)/src/app/*/*.[ch] \
544 $(top_srcdir)/src/test/*.[ch] \
545 $(top_srcdir)/src/test/*/*.[ch] \
546 $(top_srcdir)/src/tools/*.[ch]
550 $(PERL) $(top_srcdir)/scripts/maint/checkSpace.pl -C \
556 $(PYTHON) $(top_srcdir)/scripts/maint/practracker/includes.py $(top_srcdir)
559 check-best-practices:
561 @$(PYTHON) $(top_srcdir)/scripts/maint/practracker/practracker.py $(top_srcdir) $(TOR_PRACTRACKER_OPTIONS)
565 VERBOSE=1 $(top_srcdir)/scripts/coccinelle/check_cocci_parse.sh $(OWNED_TOR_C_FILES)
568 $(PYTHON) $(top_srcdir)/scripts/maint/practracker/practracker.py --regen $(top_srcdir)
571 $(PERL) $(top_builddir)/scripts/maint/checkOptionDocs.pl
574 $(top_srcdir)/scripts/maint/checkLogs.pl \
575 $(top_srcdir)/src/*/*.[ch] | sort -n
579 @if test -x "`which misspell 2>&1;true`"; then \
580 echo "Checking for Typos ..."; \
582 $(top_srcdir)/src/[^e]*/*.[ch] \
584 $(top_srcdir)/contrib \
585 $(top_srcdir)/scripts \
586 $(top_srcdir)/README.md \
587 $(top_srcdir)/ChangeLog \
588 $(top_srcdir)/INSTALL \
589 $(top_srcdir)/ReleaseNotes \
590 $(top_srcdir)/LICENSE); \
592 echo "Tor can use misspell to check for typos."; \
593 echo "It seems that you don't have misspell installed."; \
594 echo "You can install the latest version of misspell here: https://github.com/client9/misspell#install"; \
597 .PHONY: check-changes
600 @if test -d "$(top_srcdir)/changes"; then \
601 PACKAGE_VERSION=$(PACKAGE_VERSION) $(PYTHON) $(top_srcdir)/scripts/maint/lintChanges.py $(top_srcdir)/changes; \
605 .PHONY: update-versions
607 abs_top_srcdir="$(abs_top_srcdir)" $(PYTHON) $(top_srcdir)/scripts/maint/update_versions.py
611 cd $(top_builddir); $(abs_top_srcdir)/scripts/maint/run_calltool.sh
614 @echo "Tor @VERSION@"
615 @if test -d "$(top_srcdir)/.git" && test -x "`which git 2>&1;true`"; then \
617 (cd "$(top_srcdir)" && git rev-parse --short=16 HEAD); \
620 .PHONY: autostyle-ifdefs
622 $(PYTHON) $(top_srcdir)/scripts/maint/annotate_ifdef_directives.py $(OWNED_TOR_C_FILES)
624 .PHONY: autostyle-ifdefs
626 $(PERL) $(top_srcdir)/scripts/coccinelle/test-operator-cleanup $(OWNED_TOR_C_FILES)
628 .PHONY: rectify-includes
630 cd $(top_srcdir); $(PYTHON) $(abs_top_srcdir)/scripts/maint/rectify_include_paths.py
632 .PHONY: update-copyright
634 $(PERL) $(top_srcdir)/scripts/maint/updateCopyright.pl $(OWNED_TOR_C_FILES)
637 autostyle: update-versions autostyle-ifdefs rectify-includes
640 rm -f $(top_builddir)/src/*/*.gc{da,no} $(top_builddir)/src/*/*/*.gc{da,no}
641 rm -rf $(HTML_COVER_DIR)
642 rm -rf $(top_builddir)/doc/doxygen
643 rm -rf $(TEST_NETWORK_ALL_LOG_DIR)
645 # This relies on some internal details of how automake implements
646 # distcheck. We check two directories because automake-1.15 changed
647 # from $(distdir)/_build to $(distdir)/_build/sub.
648 show-distdir-testlog:
649 @if test -d "$(distdir)/_build/sub"; then \
650 cat $(distdir)/_build/sub/$(TEST_SUITE_LOG); \
652 cat $(distdir)/_build/$(TEST_SUITE_LOG); fi
654 # Similarly, this relies on automake internals to run file on an
655 # intermittent core file whose provenance is not known to us. See
658 @if test -d "$(distdir)/_build/sub"; then \
659 file $(distdir)/_build/sub/core ; \
661 file $(distdir)/_build/core; fi
667 @echo src/test/libtor-testing.a
669 # Note here that we hardcode this -j2 because if the user would pass too many
670 # cores, bear actually chockes and dies :S. For this to work, a make clean
671 # needs to be done else bear will miss some compile flags.
673 @if test -x "`which bear 2>&1;true`"; then \
674 echo "Generating LSP compile_commands.json. Might take few minutes..."; \
675 $(MAKE) clean 2>&1 >/dev/null; \
676 bear >/dev/null 2>&1 -- $(MAKE) -j2 2>&1 >/dev/null; \
677 echo "Generating .ccls file..."; \
678 ./scripts/maint/gen_ccls_file.sh \
680 echo "No bear command found. On debian, apt install bear"; \
683 # Reproducible tarball. We change the tar options for this.
685 $(MAKE) dist am__tar="$${TAR-tar} --format=gnu --owner=root --group=root --sort=name --mtime=\"`git show --no-patch --format='%ci'`\" -chof - $(distdir)"