1 # Copyright (c) 2016-2019 The Zcash developers
2 # Copyright (c) 2013-2019 The Bitcoin Core developers
3 # Copyright (c) 2013-2019 Bitcoin Developers
4 # Distributed under the MIT software license, see the accompanying
5 # file COPYING or https://www.opensource.org/licenses/mit-license.php .
7 ACLOCAL_AMFLAGS = -I build-aux/m4
17 pkgconfigdir = $(libdir)/pkgconfig
18 pkgconfig_DATA = libzcashconsensus.pc
21 BITCOIND_BIN=$(top_builddir)/src/$(BITCOIN_DAEMON_NAME)$(EXEEXT)
22 BITCOIN_CLI_BIN=$(top_builddir)/src/$(BITCOIN_CLI_NAME)$(EXEEXT)
24 DIST_DOCS = $(wildcard doc/*.md) $(wildcard doc/release-notes/*.md)
26 BIN_CHECKS=$(top_srcdir)/contrib/devtools/symbol-check.py \
27 $(top_srcdir)/contrib/devtools/security-check.py
29 COVERAGE_INFO = baseline_filtered_combined.info baseline.info \
30 leveldb_baseline.info test_bitcoin_filtered.info total_coverage.info \
31 baseline_filtered.info \
32 leveldb_baseline_filtered.info test_bitcoin_coverage.info test_bitcoin.info \
33 zcash-gtest.info zcash-gtest_filtered.info zcash-gtest_coverage.info
36 -$(MAKE) -C $(top_distdir)/src/leveldb clean
37 -$(MAKE) -C $(top_distdir)/src/secp256k1 distclean
38 -$(GIT) archive --format=tar HEAD -- src/clientversion.cpp | $(AMTAR) -C $(top_distdir) -xf -
41 $(MKDIR_P) $(top_distdir)/_build/src/leveldb
42 cp -rf $(top_srcdir)/src/leveldb/* $(top_distdir)/_build/src/leveldb/
43 -$(MAKE) -C $(top_distdir)/_build/src/leveldb clean
48 $(if $(findstring src/,$(MAKECMDGOALS)),$(MAKECMDGOALS), none): FORCE
49 $(MAKE) -C src $(patsubst src/%,%,$@)
51 $(BITCOIND_BIN): FORCE
54 $(BITCOIN_CLI_BIN): FORCE
60 $(LCOV) -c -i -d $(abs_builddir)/src -o $@
62 baseline_filtered.info: baseline.info
63 $(LCOV) -r $< "/usr/include/*" \
64 "$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/*.h" \
65 "$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/boost/*" \
66 "$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/gmock/*" \
67 "$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/gtest/*" \
68 "$(abs_builddir)/src/gtest/*" \
69 "$(abs_builddir)/src/test/*" \
70 "$(abs_builddir)/src/wallet/gtest/*" \
71 "$(abs_builddir)/src/wallet/test/*" \
74 leveldb_baseline.info: baseline_filtered.info
75 $(LCOV) -c -i -d $(abs_builddir)/src/leveldb -b $(abs_builddir)/src/leveldb -o $@
77 leveldb_baseline_filtered.info: leveldb_baseline.info
78 $(LCOV) -r $< "/usr/include/*" \
79 "$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/*.h" \
80 "$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/boost/*" \
81 "$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/gmock/*" \
82 "$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/gtest/*" \
83 "$(abs_builddir)/src/gtest/*" \
84 "$(abs_builddir)/src/test/*" \
85 "$(abs_builddir)/src/wallet/gtest/*" \
86 "$(abs_builddir)/src/wallet/test/*" \
89 baseline_filtered_combined.info: leveldb_baseline_filtered.info baseline_filtered.info
90 $(LCOV) -a leveldb_baseline_filtered.info -a baseline_filtered.info -o $@
92 test_bitcoin.info: baseline_filtered_combined.info
93 $(MAKE) -C src/ bitcoin_test_check
94 $(LCOV) -c -d $(abs_builddir)/src -t test_bitcoin -o $@
95 $(LCOV) -z -d $(abs_builddir)/src
96 $(LCOV) -z -d $(abs_builddir)/src/leveldb
98 test_bitcoin_filtered.info: test_bitcoin.info
99 $(LCOV) -r $< "/usr/include/*" \
100 "$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/*.h" \
101 "$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/boost/*" \
102 "$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/gmock/*" \
103 "$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/gtest/*" \
104 "$(abs_builddir)/src/gtest/*" \
105 "$(abs_builddir)/src/test/*" \
106 "$(abs_builddir)/src/wallet/gtest/*" \
107 "$(abs_builddir)/src/wallet/test/*" \
110 zcash-gtest.info: baseline_filtered_combined.info
111 $(MAKE) -C src/ zcash-gtest_check
112 $(LCOV) -c -d $(abs_builddir)/src -t zcash-gtest -o $@
113 $(LCOV) -z -d $(abs_builddir)/src
114 $(LCOV) -z -d $(abs_builddir)/src/leveldb
116 zcash-gtest_filtered.info: zcash-gtest.info
117 $(LCOV) -r $< "/usr/include/*" \
118 "$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/*.h" \
119 "$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/boost/*" \
120 "$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/gmock/*" \
121 "$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/gtest/*" \
122 "$(abs_builddir)/src/gtest/*" \
123 "$(abs_builddir)/src/test/*" \
124 "$(abs_builddir)/src/wallet/gtest/*" \
125 "$(abs_builddir)/src/wallet/test/*" \
128 test_bitcoin_coverage.info: baseline_filtered_combined.info test_bitcoin_filtered.info
129 $(LCOV) -a baseline_filtered.info -a leveldb_baseline_filtered.info -a test_bitcoin_filtered.info -o $@
131 zcash-gtest_coverage.info: baseline_filtered_combined.info zcash-gtest_filtered.info
132 $(LCOV) -a baseline_filtered.info -a leveldb_baseline_filtered.info -a zcash-gtest_filtered.info -o $@
134 total_coverage.info: baseline_filtered_combined.info test_bitcoin_filtered.info zcash-gtest_filtered.info
135 $(LCOV) -a baseline_filtered.info -a leveldb_baseline_filtered.info -a test_bitcoin_filtered.info -a zcash-gtest_filtered.info -o $@ | $(GREP) "\%" | $(AWK) '{ print substr($$3,2,50) "/" $$5 }' > coverage_percent.txt
137 test_bitcoin.coverage/.dirstamp: test_bitcoin_coverage.info
138 $(GENHTML) -s $< -o $(@D)
141 zcash-gtest.coverage/.dirstamp: zcash-gtest_coverage.info
142 $(GENHTML) -s $< -o $(@D)
145 cov-zcash: zcash-gtest.coverage/.dirstamp
147 total.coverage/.dirstamp: total_coverage.info
148 $(GENHTML) -s $< -o $(@D)
151 cov: test_bitcoin.coverage/.dirstamp cov-zcash total.coverage/.dirstamp
155 dist_bin_SCRIPTS = zcutil/fetch-params.sh
156 dist_noinst_SCRIPTS = autogen.sh zcutil/build-debian-package.sh zcutil/build.sh
158 EXTRA_DIST = $(top_srcdir)/share/genbuild.sh qa/pull-tester/rpc-tests.sh qa/pull-tester/run-bitcoin-cli qa/rpc-tests qa/zcash $(DIST_DOCS) $(BIN_CHECKS)
161 mv $(DESTDIR)$(bindir)/fetch-params.sh $(DESTDIR)$(bindir)/zcash-fetch-params
163 .INTERMEDIATE: $(COVERAGE_INFO)
165 DISTCHECK_CONFIGURE_FLAGS = --enable-man
168 rm -rf test_bitcoin.coverage/ zcash-gtest.coverage/ total.coverage/