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)
191 scripts/build/combine_libs \
192 scripts/maint/checkIncludes.py \
193 scripts/maint/checkSpace.pl \
194 scripts/maint/checkSpaceTest.sh \
195 scripts/maint/checkspace_tests/dubious.c \
196 scripts/maint/checkspace_tests/dubious.h \
197 scripts/maint/checkspace_tests/expected.txt \
198 scripts/maint/checkspace_tests/good_guard.h \
199 scripts/maint/checkspace_tests/same_guard.h \
200 scripts/maint/checkspace_tests/subdir/dubious.c \
201 scripts/maint/checkShellScripts.sh \
202 scripts/maint/practracker/README \
203 scripts/maint/practracker/exceptions.txt \
204 scripts/maint/practracker/includes.py \
205 scripts/maint/practracker/metrics.py \
206 scripts/maint/practracker/practracker.py \
207 scripts/maint/practracker/practracker_tests.py \
208 scripts/maint/practracker/problem.py \
209 scripts/maint/practracker/testdata/.may_include \
210 scripts/maint/practracker/testdata/a.c \
211 scripts/maint/practracker/testdata/b.c \
212 scripts/maint/practracker/testdata/ex0-expected.txt \
213 scripts/maint/practracker/testdata/ex0.txt \
214 scripts/maint/practracker/testdata/ex1-expected.txt \
215 scripts/maint/practracker/testdata/ex1.txt \
216 scripts/maint/practracker/testdata/ex1-overbroad-expected.txt \
217 scripts/maint/practracker/testdata/ex1-regen-expected.txt \
218 scripts/maint/practracker/testdata/ex1-regen-overbroad-expected.txt \
219 scripts/maint/practracker/testdata/ex.txt \
220 scripts/maint/practracker/testdata/header.h \
221 scripts/maint/practracker/testdata/not_c_file \
222 scripts/maint/practracker/test_practracker.sh \
223 scripts/maint/practracker/util.py \
224 scripts/coccinelle/apply.sh \
225 scripts/coccinelle/check_cocci_parse.sh \
226 scripts/coccinelle/exceptions.txt \
227 scripts/coccinelle/test-operator-cleanup \
228 scripts/coccinelle/tor-coccinelle.h \
229 scripts/coccinelle/try_parse.sh
231 ## This tells etags how to find mockable function definitions.
232 AM_ETAGSFLAGS=--regex='{c}/MOCK_IMPL([^,]+,\W*\([a-zA-Z0-9_]+\)\W*,/\1/s'
235 TEST_CFLAGS=-fno-inline -fprofile-arcs -ftest-coverage
236 if DISABLE_ASSERTS_IN_UNIT_TESTS
237 TEST_CPPFLAGS=-DTOR_UNIT_TESTS -DTOR_COVERAGE -DDISABLE_ASSERTS_IN_UNIT_TESTS @TOR_MODULES_ALL_ENABLED@
239 TEST_CPPFLAGS=-DTOR_UNIT_TESTS -DTOR_COVERAGE @TOR_MODULES_ALL_ENABLED@
241 TEST_NETWORK_FLAGS=--coverage --hs-multi-client 1
244 TEST_CPPFLAGS=-DTOR_UNIT_TESTS @TOR_MODULES_ALL_ENABLED@
245 TEST_NETWORK_FLAGS=--hs-multi-client 1
247 TEST_NETWORK_SHOW_WARNINGS_FOR_LAST_RUN_FLAGS=--quiet --only-warnings
250 TEST_CFLAGS += -fsanitize=fuzzer-no-link
254 TEST_NETWORK_ALL_LOG_DIR=$(top_builddir)/test_network_log
255 TEST_NETWORK_ALL_DRIVER_FLAGS=--color-tests yes
258 # $(INSTALL) -m 755 -d $(LOCALSTATEDIR)/lib/tor
260 # Allows to override rpmbuild with rpmbuild-md5 from fedora-packager so that
261 # building for EL5 won't fail on https://bugzilla.redhat.com/show_bug.cgi?id=490613
264 # Use automake's dist-gzip target to build the tarball
266 TIMESTAMP=$$(date +"%Y-%m-%d_%H.%M.%S"); \
267 RPM_BUILD_DIR=$$(mktemp -d "/tmp/tor-rpm-build-$$TIMESTAMP-XXXX"); \
268 mkdir -p "$$RPM_BUILD_DIR"/{BUILD,RPMS,SOURCES/"tor-$(VERSION)",SPECS,SRPMS}; \
269 cp -fa "$(distdir).tar.gz" "$$RPM_BUILD_DIR"/SOURCES/; \
270 LIBS=-lrt $(RPMBUILD) -ba --define "_topdir $$RPM_BUILD_DIR" tor.spec; \
271 cp -fa "$$RPM_BUILD_DIR"/SRPMS/* .; \
272 cp -fa "$$RPM_BUILD_DIR"/RPMS/* .; \
273 rm -rf "$$RPM_BUILD_DIR"; \
274 echo "RPM build finished"; \
280 (cd "$(top_srcdir)" && doxygen "$(abs_top_builddir)/Doxyfile")
283 $(top_builddir)/src/test/test
286 $(top_srcdir)/scripts/maint/checkShellScripts.sh
294 # test-network requires a copy of Chutney in $CHUTNEY_PATH.
295 # Chutney can be cloned from https://git.torproject.org/chutney.git .
296 .PHONY: need-chutney-path
298 @if test ! -d "$$CHUTNEY_PATH"; then \
299 echo '$$CHUTNEY_PATH was not set.'; \
300 if test -d "$(top_srcdir)/../chutney" && \
301 test -x "$(top_srcdir)/../chutney/chutney"; then \
302 echo "Assuming test-network.sh will find" \
303 "$(top_srcdir)/../chutney"; \
306 echo "To run these tests," \
308 "https://git.torproject.org/chutney.git ;" \
309 "export CHUTNEY_PATH=\`pwd\`/chutney"; \
314 # Run some basic tests using automake's test-driver
316 # Hide directory path logs from submakes using $(MAKE) -s
318 @$(MAKE) -s test-network-mkdir
319 @$(MAKE) -s test-network-clean
320 @$(MAKE) -s test-network-run \
321 ipv4_flavors="$(TEST_CHUTNEY_FLAVOR_QUICK)" \
322 ipv6_flavors="$(TEST_CHUTNEY_FLAVOR_QUICK_IPV6)"
323 @$(MAKE) -s test-network-results
325 # Run all available tests using automake's test-driver
326 .PHONY: test-network-all
327 # Hide directory path logs from submakes using $(MAKE) -s
329 @$(MAKE) -s test-network-mkdir
330 @$(MAKE) -s test-network-clean
331 @$(MAKE) -s test-network-run \
332 ipv4_flavors="$(TEST_CHUTNEY_FLAVORS)" \
333 mixed_flavors="$(TEST_CHUTNEY_FLAVORS_MIXED)" \
334 ipv6_flavors="$(TEST_CHUTNEY_FLAVORS_IPV6)" \
335 ipv6_mixed_flavors="$(TEST_CHUTNEY_FLAVORS_IPV6_MIXED)"
336 @$(MAKE) -s test-network-results
338 # Run IPv4 and mixed tests using automake's test-driver
339 .PHONY: test-network-ipv4
340 # Hide directory path logs from submakes using $(MAKE) -s
342 @$(MAKE) -s test-network-mkdir
343 @$(MAKE) -s test-network-clean
344 @$(MAKE) -s test-network-run \
345 ipv4_flavors="$(TEST_CHUTNEY_FLAVORS)" \
346 mixed_flavors="$(TEST_CHUTNEY_FLAVORS_MIXED)"
347 @$(MAKE) -s test-network-results
349 # Run IPv6 tests using automake's test-driver
350 .PHONY: test-network-ipv6
351 # Hide directory path logs from submakes using $(MAKE) -s
353 @$(MAKE) -s test-network-mkdir
354 @$(MAKE) -s test-network-clean
355 @$(MAKE) -s test-network-run \
356 ipv6_flavors="$(TEST_CHUTNEY_FLAVORS_IPV6)" \
357 ipv6_mixed_flavors="$(TEST_CHUTNEY_FLAVORS_IPV6_MIXED)"
358 @$(MAKE) -s test-network-results
360 # Make the test network log directory, if it does not exist
361 .PHONY: test-network-mkdir
363 @mkdir -p "$(TEST_NETWORK_ALL_LOG_DIR)"
365 # Clean the test network log directory
366 .PHONY: test-network-clean
367 # We need to remove all matching files, so we can't quote the glob part of the
370 rm -f "$(TEST_NETWORK_ALL_LOG_DIR)"/*.log \
371 "$(TEST_NETWORK_ALL_LOG_DIR)"/*.trs
373 # Run tests using automake's test-driver
374 # When checking if a set of test can be run, log the type of test, and the
375 # list of tests that will be run (or skipped).
377 # Run the IPv4 tests in $(ipv4_flavors), unconditionally
378 # - tor relays and directory authorities require IPv4.
379 # Run the IPv6 tests in $(ipv6_flavors), if IPv6 is available
380 # - only run IPv6 tests if we can ping6 or ping -6 ::1 (localhost)
381 # we try the syntax for BSD ping6, Linux ping6, and Linux ping -6,
382 # because they're incompatible
383 # - some IPv6 tests may fail without an IPv6 DNS server
384 # (see #16971 and #17011)
385 # Run the mixed tests in $(mixed_flavors), if a tor-stable binary is available
386 # - only run mixed tests if we have a tor-stable binary
387 # Run the IPv6 mixed tests in $(ipv6_mixed_flavors), if IPv6 and mixed are run
388 # - see above for details about IPv6 and mixed
389 .PHONY: test-network-run
390 # We need the word splitting in the "for" lines, so we can't quote
391 # $(skip_flavors) or $(flavors)
392 test-network-run: need-chutney-path test-driver $(TESTING_TOR_BINARY) src/tools/tor-gencert
395 if test -n "$(ipv4_flavors)"; then \
396 echo "Running IPv4 flavors: $(ipv4_flavors)."; \
397 flavors="$$flavors $(ipv4_flavors)"; \
399 test_network_ipv6=false; \
400 if test -n "$(ipv6_flavors)" || \
401 test -n "$(ipv6_mixed_flavors)"; then \
402 if ping6 -q -c 1 -o ::1 >/dev/null 2>&1 || \
403 ping6 -q -c 1 -W 1 ::1 >/dev/null 2>&1 || \
404 ping -6 -c 1 -W 1 ::1 >/dev/null 2>&1; then \
405 test_network_ipv6=true; \
408 if test -n "$(ipv6_flavors)"; then \
409 if test "$$test_network_ipv6" = "true"; then \
410 echo "ping6 ::1 or ping ::1 succeeded, running IPv6" \
411 "flavors: $(ipv6_flavors)."; \
412 flavors="$$flavors $(ipv6_flavors)"; \
414 echo "ping6 ::1 and ping ::1 failed, skipping IPv6" \
415 "flavors: $(ipv6_flavors)."; \
416 skip_flavors="$$skip_flavors $(ipv6_flavors)"; \
419 test_network_mixed=false; \
420 if test -n "$(mixed_flavors)" || \
421 test -n "$(ipv6_mixed_flavors)"; then \
422 if command -v tor-stable >/dev/null 2>&1; then \
423 test_network_mixed=true; \
426 if test -n "$(mixed_flavors)"; then \
427 if test "$$test_network_mixed" = "true"; then \
428 echo "tor-stable found, running mixed flavors:" \
429 "$(mixed_flavors)."; \
430 flavors="$$flavors $(mixed_flavors)"; \
432 echo "tor-stable not found, skipping mixed flavors:" \
433 "$(mixed_flavors)."; \
434 skip_flavors="$$skip_flavors $(mixed_flavors)"; \
437 if test -n "$(ipv6_mixed_flavors)"; then \
438 if test "$$test_network_ipv6" = "true" && \
439 test "$$test_network_mixed" = "true"; then \
440 echo "Running IPv6 mixed flavors:" \
441 "$(ipv6_mixed_flavors)."; \
442 flavors="$$flavors $(ipv6_mixed_flavors)"; \
444 echo "Skipping IPv6 mixed flavors:" \
445 "$(ipv6_mixed_flavors)."; \
446 skip_flavors="$$skip_flavors $(ipv6_mixed_flavors)"; \
449 for f in $$skip_flavors; do \
452 for f in $$flavors; do \
453 $(SHELL) "$(top_srcdir)/test-driver" --test-name "$$f" \
454 --log-file "$(TEST_NETWORK_ALL_LOG_DIR)/$$f.log" \
455 --trs-file "$(TEST_NETWORK_ALL_LOG_DIR)/$$f.trs" \
456 $(TEST_NETWORK_ALL_DRIVER_FLAGS) \
457 "$(top_srcdir)/src/test/test-network.sh" \
458 --flavor "$$f" $(TEST_NETWORK_FLAGS); \
459 "$(top_srcdir)/src/test/test-network.sh" \
460 $(TEST_NETWORK_SHOW_WARNINGS_FOR_LAST_RUN_FLAGS); \
463 # Print the results from automake's test-driver
464 # - show tor warnings on the console after each network run
465 # (otherwise, warnings go to the logs, and people don't see them unless
466 # there is a network failure)
467 .PHONY: test-network-results
468 # We need to grep all matching files, so we can't quote the glob part of the
470 test-network-results:
472 "Log and result files are available in $(TEST_NETWORK_ALL_LOG_DIR)."
473 @! grep -q FAIL "$(TEST_NETWORK_ALL_LOG_DIR)"/*.trs
476 @if test ! -d "$$STEM_SOURCE_DIR"; then \
477 echo '$$STEM_SOURCE_DIR was not set.'; echo; \
478 echo "To run these tests, git clone https://git.torproject.org/stem.git/ ; export STEM_SOURCE_DIR=\`pwd\`/stem"; \
482 test-stem: need-stem-path $(TESTING_TOR_BINARY)
483 @$(PYTHON) "$$STEM_SOURCE_DIR"/run_tests.py --tor "$(TESTING_TOR_BINARY)" --integ --test control.controller --test control.base_controller --test process --log notice;
485 test-stem-full: need-stem-path $(TESTING_TOR_BINARY)
486 @$(PYTHON) "$$STEM_SOURCE_DIR"/run_tests.py --tor "$(TESTING_TOR_BINARY)" --all --log notice --target RUN_ALL,ONLINE -v;
502 # We can't delete the gcno files, because they are created when tor is compiled
504 rm -f $(top_builddir)/src/*/*.gcda $(top_builddir)/src/*/*/*.gcda \
505 $(top_builddir)/src/*/*.gcov $(top_builddir)/src/*/*/*.gcov
507 HTML_COVER_DIR=$(top_builddir)/coverage_html
510 test -e "`which lcov`" || (echo "lcov must be installed. See <http://ltp.sourceforge.net/coverage/lcov.php>." && false)
511 test -d "$(HTML_COVER_DIR)" || $(MKDIR_P) "$(HTML_COVER_DIR)"
512 lcov --rc lcov_branch_coverage=1 --directory $(top_builddir)/src --zerocounters
515 lcov --capture --rc lcov_branch_coverage=1 --no-external --directory $(top_builddir) --base-directory $(top_srcdir) --output-file "$(HTML_COVER_DIR)/lcov.tmp"
516 lcov --remove "$(HTML_COVER_DIR)/lcov.tmp" --rc lcov_branch_coverage=1 'test/*' 'ext/tinytest*' '/usr/*' --output-file "$(HTML_COVER_DIR)/lcov.info"
517 genhtml --branch-coverage -o "$(HTML_COVER_DIR)" "$(HTML_COVER_DIR)/lcov.info"
519 @printf "Not configured with --enable-coverage, run ./configure --enable-coverage\n"
522 coverage-html-full: all
523 test -e "`which lcov`" || (echo "lcov must be installed. See <http://ltp.sourceforge.net/coverage/lcov.php>." && false)
524 test -d "$(HTML_COVER_DIR)" || mkdir -p "$(HTML_COVER_DIR)"
525 lcov --rc lcov_branch_coverage=1 --directory ./src --zerocounters
528 $(MAKE) test-stem-full
529 CHUTNEY_TOR=tor-cov CHUTNEY_TOR_GENCERT=tor-cov-gencert $(top_srcdir)/src/test/test-network.sh
530 CHUTNEY_TOR=tor-cov CHUTNEY_TOR_GENCERT=tor-cov-gencert $(top_srcdir)/src/test/test-network.sh --flavor hs
531 lcov --capture --rc lcov_branch_coverage=1 --no-external --directory . --output-file "$(HTML_COVER_DIR)/lcov.tmp"
532 lcov --remove "$(HTML_COVER_DIR)/lcov.tmp" --rc lcov_branch_coverage=1 'test/*' 'ext/tinytest*' '/usr/*' --output-file "$(HTML_COVER_DIR)/lcov.info"
533 genhtml --branch-coverage -o "$(HTML_COVER_DIR)" "$(HTML_COVER_DIR)/lcov.info"
535 # For scripts: avoid src/ext and src/trunnel.
536 # Keep these lists consistent:
537 # - OWNED_TOR_C_FILES in Makefile.am
538 # - CHECK_FILES in pre-commit.git-hook and pre-push.git-hook
539 # - try_parse in check_cocci_parse.sh
541 $(top_srcdir)/src/lib/*/*.[ch] \
542 $(top_srcdir)/src/core/*/*.[ch] \
543 $(top_srcdir)/src/feature/*/*.[ch] \
544 $(top_srcdir)/src/app/*/*.[ch] \
545 $(top_srcdir)/src/test/*.[ch] \
546 $(top_srcdir)/src/test/*/*.[ch] \
547 $(top_srcdir)/src/tools/*.[ch]
551 $(PERL) $(top_srcdir)/scripts/maint/checkSpace.pl -C \
557 $(PYTHON) $(top_srcdir)/scripts/maint/practracker/includes.py $(top_srcdir)
560 check-best-practices:
562 @$(PYTHON) $(top_srcdir)/scripts/maint/practracker/practracker.py $(top_srcdir) $(TOR_PRACTRACKER_OPTIONS)
566 VERBOSE=1 $(top_srcdir)/scripts/coccinelle/check_cocci_parse.sh $(OWNED_TOR_C_FILES)
569 $(PYTHON) $(top_srcdir)/scripts/maint/practracker/practracker.py --regen $(top_srcdir)
572 $(PERL) $(top_builddir)/scripts/maint/checkOptionDocs.pl
575 $(top_srcdir)/scripts/maint/checkLogs.pl \
576 $(top_srcdir)/src/*/*.[ch] | sort -n
580 @if test -x "`which misspell 2>&1;true`"; then \
581 echo "Checking for Typos ..."; \
583 $(top_srcdir)/src/[^e]*/*.[ch] \
585 $(top_srcdir)/contrib \
586 $(top_srcdir)/scripts \
587 $(top_srcdir)/README.md \
588 $(top_srcdir)/ChangeLog \
589 $(top_srcdir)/INSTALL \
590 $(top_srcdir)/ReleaseNotes \
591 $(top_srcdir)/LICENSE); \
593 echo "Tor can use misspell to check for typos."; \
594 echo "It seems that you don't have misspell installed."; \
595 echo "You can install the latest version of misspell here: https://github.com/client9/misspell#install"; \
598 .PHONY: check-changes
601 @if test -d "$(top_srcdir)/changes"; then \
602 PACKAGE_VERSION=$(PACKAGE_VERSION) $(PYTHON) $(top_srcdir)/scripts/maint/lintChanges.py $(top_srcdir)/changes; \
606 .PHONY: update-versions
608 abs_top_srcdir="$(abs_top_srcdir)" $(PYTHON) $(top_srcdir)/scripts/maint/update_versions.py
612 cd $(top_builddir); $(abs_top_srcdir)/scripts/maint/run_calltool.sh
615 @echo "Tor @VERSION@"
616 @if test -d "$(top_srcdir)/.git" && test -x "`which git 2>&1;true`"; then \
618 (cd "$(top_srcdir)" && git rev-parse --short=16 HEAD); \
621 .PHONY: autostyle-ifdefs
623 $(PYTHON) $(top_srcdir)/scripts/maint/annotate_ifdef_directives.py $(OWNED_TOR_C_FILES)
625 .PHONY: autostyle-ifdefs
627 $(PERL) $(top_srcdir)/scripts/coccinelle/test-operator-cleanup $(OWNED_TOR_C_FILES)
629 .PHONY: rectify-includes
631 cd $(top_srcdir); $(PYTHON) $(abs_top_srcdir)/scripts/maint/rectify_include_paths.py
633 .PHONY: update-copyright
635 $(PERL) $(top_srcdir)/scripts/maint/updateCopyright.pl $(OWNED_TOR_C_FILES)
638 autostyle: update-versions autostyle-ifdefs rectify-includes
641 rm -f $(top_builddir)/src/*/*.gc{da,no} $(top_builddir)/src/*/*/*.gc{da,no}
642 rm -rf $(HTML_COVER_DIR)
643 rm -rf $(top_builddir)/doc/doxygen
644 rm -rf $(TEST_NETWORK_ALL_LOG_DIR)
646 # This relies on some internal details of how automake implements
647 # distcheck. We check two directories because automake-1.15 changed
648 # from $(distdir)/_build to $(distdir)/_build/sub.
649 show-distdir-testlog:
650 @if test -d "$(distdir)/_build/sub"; then \
651 cat $(distdir)/_build/sub/$(TEST_SUITE_LOG); \
653 cat $(distdir)/_build/$(TEST_SUITE_LOG); fi
655 # Similarly, this relies on automake internals to run file on an
656 # intermittent core file whose provenance is not known to us. See
659 @if test -d "$(distdir)/_build/sub"; then \
660 file $(distdir)/_build/sub/core ; \
662 file $(distdir)/_build/core; fi
668 @echo src/test/libtor-testing.a
670 # Note here that we hardcode this -j2 because if the user would pass too many
671 # cores, bear actually chockes and dies :S. For this to work, a make clean
672 # needs to be done else bear will miss some compile flags.
674 @if test -x "`which bear 2>&1;true`"; then \
675 echo "Generating LSP compile_commands.json. Might take few minutes..."; \
676 $(MAKE) clean 2>&1 >/dev/null; \
677 bear >/dev/null 2>&1 -- $(MAKE) -j2 2>&1 >/dev/null; \
678 echo "Generating .ccls file..."; \
679 ./scripts/maint/gen_ccls_file.sh \
681 echo "No bear command found. On debian, apt install bear"; \
684 # Reproducible tarball. We change the tar options for this.
686 $(MAKE) dist am__tar="$${TAR-tar} --format=gnu --owner=root --group=root --sort=name --mtime=\"`git show --no-patch --format='%ci'`\" -chof - $(distdir)"