Skip to content
Snippets Groups Projects
Commit 17cbc435 authored by cypherpunks's avatar cypherpunks Committed by Nick Mathewson
Browse files

Use output variables instead of relative paths.

Fixes the following rules in out-of-tree builds;
- check-spaces
- check-docs
- check-logs
- Doxygen
- coverage-html

And cleans up additional directories;
- coverage_html
- doc/doxygen
parent 4247ce99
No related branches found
No related tags found
No related merge requests found
...@@ -38,7 +38,7 @@ PROJECT_NUMBER = @VERSION@ ...@@ -38,7 +38,7 @@ PROJECT_NUMBER = @VERSION@
# If a relative path is entered, it will be relative to the location # If a relative path is entered, it will be relative to the location
# where doxygen was started. If left blank the current directory will be used. # where doxygen was started. If left blank the current directory will be used.
OUTPUT_DIRECTORY = ./doc/doxygen OUTPUT_DIRECTORY = @top_builddir@/doc/doxygen
# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
# 4096 sub-directories (in 2 levels) under the output directory of each output # 4096 sub-directories (in 2 levels) under the output directory of each output
...@@ -534,8 +534,8 @@ WARN_LOGFILE = ...@@ -534,8 +534,8 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories # directories like "/usr/src/myproject". Separate the files or directories
# with spaces. # with spaces.
INPUT = src/common \ INPUT = @top_srcdir@/src/common \
src/or @top_srcdir@/src/or
# This tag can be used to specify the character encoding of the source files # This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
......
...@@ -20,6 +20,7 @@ DISTCLEANFILES= ...@@ -20,6 +20,7 @@ DISTCLEANFILES=
bin_SCRIPTS= bin_SCRIPTS=
AM_CPPFLAGS= AM_CPPFLAGS=
AM_CFLAGS = @TOR_SYSTEMD_CFLAGS@ AM_CFLAGS = @TOR_SYSTEMD_CFLAGS@
SHELL = @SHELL@
include src/include.am include src/include.am
include doc/include.am include doc/include.am
include contrib/include.am include contrib/include.am
...@@ -64,12 +65,12 @@ doxygen: ...@@ -64,12 +65,12 @@ doxygen:
doxygen && cd doc/doxygen/latex && make doxygen && cd doc/doxygen/latex && make
test: all test: all
./src/test/test $(top_builddir)/src/test/test
# Note that test-network requires a copy of Chutney in $CHUTNEY_PATH. # Note that test-network requires a copy of Chutney in $CHUTNEY_PATH.
# Chutney can be cloned from https://git.torproject.org/chutney.git . # Chutney can be cloned from https://git.torproject.org/chutney.git .
test-network: all test-network: all
./src/test/test-network.sh $(top_srcdir)/src/test/test-network.sh
test-stem: $(TESTING_TOR_BINARY) test-stem: $(TESTING_TOR_BINARY)
@if test -d "$$STEM_SOURCE_DIR"; then \ @if test -d "$$STEM_SOURCE_DIR"; then \
...@@ -81,35 +82,35 @@ test-stem: $(TESTING_TOR_BINARY) ...@@ -81,35 +82,35 @@ test-stem: $(TESTING_TOR_BINARY)
reset-gcov: reset-gcov:
rm -f src/*/*.gcda src/*/*/*.gcda rm -f $(top_builddir)/src/*/*.gcda $(top_builddir)/src/*/*/*.gcda
HTML_COVER_DIR=./coverage_html HTML_COVER_DIR=$(top_builddir)/coverage_html
coverage-html: all coverage-html: all
test -e "`which lcov`" || (echo "lcov must be installed. See <http://ltp.sourceforge.net/coverage/lcov.php>." && false) 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)" test -d "$(HTML_COVER_DIR)" || $(MKDIR_P) "$(HTML_COVER_DIR)"
lcov --rc lcov_branch_coverage=1 --directory ./src --zerocounters lcov --rc lcov_branch_coverage=1 --directory $(top_builddir)/src --zerocounters
$(MAKE) reset-gcov $(MAKE) reset-gcov
$(MAKE) check $(MAKE) check
lcov --capture --rc lcov_branch_coverage=1 --no-external --directory . --output-file "$(HTML_COVER_DIR)/lcov.tmp" lcov --capture --rc lcov_branch_coverage=1 --no-external --directory $(top_builddir) --base-directory $(top_srcdir) --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" 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" genhtml --branch-coverage -o "$(HTML_COVER_DIR)" "$(HTML_COVER_DIR)/lcov.info"
# Avoid strlcpy.c, strlcat.c, aes.c, OpenBSD_malloc_Linux.c, sha256.c, # Avoid strlcpy.c, strlcat.c, aes.c, OpenBSD_malloc_Linux.c, sha256.c,
# eventdns.[hc], tinytest*.[ch] # eventdns.[hc], tinytest*.[ch]
check-spaces: check-spaces:
./scripts/maint/checkSpace.pl -C \ $(top_srcdir)/scripts/maint/checkSpace.pl -C \
src/common/*.[ch] \ $(top_srcdir)/src/common/*.[ch] \
src/or/*.[ch] \ $(top_srcdir)/src/or/*.[ch] \
src/test/*.[ch] \ $(top_srcdir)/src/test/*.[ch] \
src/tools/*.[ch] \ $(top_srcdir)/src/tools/*.[ch] \
src/tools/tor-fw-helper/*.[ch] $(top_srcdir)/src/tools/tor-fw-helper/*.[ch]
check-docs: check-docs:
./scripts/maint/checkOptionDocs.pl $(top_srcdir)/scripts/maint/checkOptionDocs.pl
check-logs: check-logs:
./scripts/maint/checkLogs.pl \ $(top_srcdir)/scripts/maint/checkLogs.pl \
src/*/*.[ch] | sort -n $(top_srcdir)/src/*/*.[ch] | sort -n
.PHONY: check-changes .PHONY: check-changes
check-changes: check-changes:
...@@ -125,4 +126,6 @@ version: ...@@ -125,4 +126,6 @@ version:
fi fi
mostlyclean-local: mostlyclean-local:
rm -f src/*/*.gc{da,no} src/*/*/*.gc{da,no} 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
...@@ -64,14 +64,14 @@ doc/tor-gencert.html.in: doc/tor-gencert.1.txt ...@@ -64,14 +64,14 @@ doc/tor-gencert.html.in: doc/tor-gencert.1.txt
doc/tor-resolve.html.in: doc/tor-resolve.1.txt doc/tor-resolve.html.in: doc/tor-resolve.1.txt
doc/tor-fw-helper.html.in: doc/tor-fw-helper.1.txt doc/tor-fw-helper.html.in: doc/tor-fw-helper.1.txt
# use ../config.status to swap all machine-specific magic strings # use config.status to swap all machine-specific magic strings
# in the asciidoc with their replacements. # in the asciidoc with their replacements.
$(asciidoc_product) : $(asciidoc_product) :
$(AM_V_GEN)$(MKDIR_P) $(@D) $(AM_V_GEN)$(MKDIR_P) $(@D)
$(AM_V_at)if test -e $(top_srcdir)/$@.in && ! test -e $@.in ; then \ $(AM_V_at)if test -e $(top_srcdir)/$@.in && ! test -e $@.in ; then \
cp $(top_srcdir)/$@.in $@; \ cp $(top_srcdir)/$@.in $@; \
fi fi
$(AM_V_at)./config.status -q --file=$@; $(AM_V_at)$(top_builddir)/config.status -q --file=$@;
doc/tor.html: doc/tor.html.in doc/tor.html: doc/tor.html.in
doc/tor-gencert.html: doc/tor-gencert.html.in doc/tor-gencert.html: doc/tor-gencert.html.in
......
...@@ -85,8 +85,9 @@ LIBTOR_A_SOURCES = \ ...@@ -85,8 +85,9 @@ LIBTOR_A_SOURCES = \
src_or_libtor_a_SOURCES = $(LIBTOR_A_SOURCES) src_or_libtor_a_SOURCES = $(LIBTOR_A_SOURCES)
src_or_libtor_testing_a_SOURCES = $(LIBTOR_A_SOURCES) src_or_libtor_testing_a_SOURCES = $(LIBTOR_A_SOURCES)
#libtor_a_LIBADD = ../common/libor.a ../common/libor-crypto.a \ #libtor_a_LIBADD = $(top_builddir)/common/libor.a \
# ../common/libor-event.a # $(top_builddir)/common/libor-crypto.a \
# $(top_builddir)/common/libor-event.a
src_or_tor_SOURCES = src/or/tor_main.c src_or_tor_SOURCES = src/or/tor_main.c
...@@ -123,9 +124,9 @@ src_or_tor_cov_LDADD = src/or/libtor-testing.a src/common/libor-testing.a \ ...@@ -123,9 +124,9 @@ src_or_tor_cov_LDADD = src/or/libtor-testing.a src/common/libor-testing.a \
src/common/libor-event-testing.a \ src/common/libor-event-testing.a \
@TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ @TOR_LIBEVENT_LIBS@ @TOR_OPENSSL_LIBS@ \ @TOR_ZLIB_LIBS@ @TOR_LIB_MATH@ @TOR_LIBEVENT_LIBS@ @TOR_OPENSSL_LIBS@ \
@TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@ @TOR_SYSTEMD_LIBS@ @TOR_LIB_WS32@ @TOR_LIB_GDI@ @CURVE25519_LIBS@ @TOR_SYSTEMD_LIBS@
TESTING_TOR_BINARY = ./src/or/tor-cov TESTING_TOR_BINARY = $(top_builddir)/src/or/tor-cov
else else
TESTING_TOR_BINARY = ./src/or/tor TESTING_TOR_BINARY = $(top_builddir)/src/or/tor
endif endif
ORHEADERS = \ ORHEADERS = \
......
...@@ -140,9 +140,9 @@ src_test_test_ntor_cl_AM_CPPFLAGS = \ ...@@ -140,9 +140,9 @@ src_test_test_ntor_cl_AM_CPPFLAGS = \
NTOR_TEST_DEPS=src/test/test-ntor-cl NTOR_TEST_DEPS=src/test/test-ntor-cl
if COVERAGE_ENABLED if COVERAGE_ENABLED
CMDLINE_TEST_TOR = ./src/or/tor-cov CMDLINE_TEST_TOR = $(top_builddir)/src/or/tor-cov
else else
CMDLINE_TEST_TOR = ./src/or/tor CMDLINE_TEST_TOR = $(top_builddir)/src/or/tor
endif endif
noinst_PROGRAMS += src/test/test-bt-cl noinst_PROGRAMS += src/test/test-bt-cl
...@@ -158,10 +158,10 @@ check-local: $(NTOR_TEST_DEPS) $(CMDLINE_TEST_TOR) ...@@ -158,10 +158,10 @@ check-local: $(NTOR_TEST_DEPS) $(CMDLINE_TEST_TOR)
if USEPYTHON if USEPYTHON
$(PYTHON) $(top_srcdir)/src/test/ntor_ref.py test-tor $(PYTHON) $(top_srcdir)/src/test/ntor_ref.py test-tor
$(PYTHON) $(top_srcdir)/src/test/ntor_ref.py self-test $(PYTHON) $(top_srcdir)/src/test/ntor_ref.py self-test
./src/test/test-bt-cl assert | $(PYTHON) $(top_srcdir)/src/test/bt_test.py $(top_builddir)/src/test/test-bt-cl assert | $(PYTHON) $(top_srcdir)/src/test/bt_test.py
./src/test/test-bt-cl crash | $(PYTHON) $(top_srcdir)/src/test/bt_test.py $(top_builddir)/src/test/test-bt-cl crash | $(PYTHON) $(top_srcdir)/src/test/bt_test.py
endif endif
$(top_srcdir)/src/test/zero_length_keys.sh $(SHELL) $(top_srcdir)/src/test/zero_length_keys.sh
EXTRA_DIST += \ EXTRA_DIST += \
src/test/bt_test.py \ src/test/bt_test.py \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment