1 ACLOCAL_AMFLAGS = -I build-aux/m4
8 pkgconfigdir = $(libdir)/pkgconfig
9 pkgconfig_DATA = libbitcoinconsensus.pc
12 BITCOIND_BIN=$(top_builddir)/src/bitcoind$(EXEEXT)
13 BITCOIN_QT_BIN=$(top_builddir)/src/qt/bitcoin-qt$(EXEEXT)
14 BITCOIN_CLI_BIN=$(top_builddir)/src/bitcoin-cli$(EXEEXT)
15 BITCOIN_WIN_INSTALLER=$(PACKAGE)-$(PACKAGE_VERSION)-win$(WINDOWS_BITS)-setup$(EXEEXT)
17 OSX_APP=Bitcoin-Qt.app
18 OSX_DMG=Bitcoin-Qt.dmg
19 OSX_DEPLOY_SCRIPT=$(top_srcdir)/contrib/macdeploy/macdeployqtplus
20 OSX_FANCY_PLIST=$(top_srcdir)/contrib/macdeploy/fancy.plist
21 OSX_INSTALLER_ICONS=$(top_srcdir)/src/qt/res/icons/bitcoin.icns
22 OSX_PLIST=$(top_srcdir)/share/qt/Info.plist #not installed
23 OSX_QT_TRANSLATIONS = da,de,es,hu,ru,uk,zh_CN,zh_TW
25 DIST_DOCS = $(wildcard doc/*.md) $(wildcard doc/release-notes/*.md)
27 WINDOWS_PACKAGING = $(top_srcdir)/share/pixmaps/bitcoin.ico \
28 $(top_srcdir)/share/pixmaps/nsis-header.bmp \
29 $(top_srcdir)/share/pixmaps/nsis-wizard.bmp \
30 $(top_srcdir)/doc/README_windows.txt
32 OSX_PACKAGING = $(OSX_DEPLOY_SCRIPT) $(OSX_FANCY_PLIST) $(OSX_INSTALLER_ICONS) \
33 $(top_srcdir)/contrib/macdeploy/background.png \
34 $(top_srcdir)/contrib/macdeploy/DS_Store \
35 $(top_srcdir)/contrib/macdeploy/detached-sig-apply.sh \
36 $(top_srcdir)/contrib/macdeploy/detached-sig-create.sh
38 COVERAGE_INFO = baseline_filtered_combined.info baseline.info block_test.info \
39 leveldb_baseline.info test_bitcoin_filtered.info total_coverage.info \
40 baseline_filtered.info block_test_filtered.info \
41 leveldb_baseline_filtered.info test_bitcoin_coverage.info test_bitcoin.info
44 -$(MAKE) -C $(top_distdir)/src/leveldb clean
45 -$(MAKE) -C $(top_distdir)/src/secp256k1 distclean
46 -$(GIT) archive --format=tar HEAD -- src/clientversion.cpp | $(AMTAR) -C $(top_distdir) -xf -
49 $(MKDIR_P) $(top_distdir)/_build/src/leveldb
50 cp -rf $(top_srcdir)/src/leveldb/* $(top_distdir)/_build/src/leveldb/
51 -$(MAKE) -C $(top_distdir)/_build/src/leveldb clean
56 $(BITCOIN_WIN_INSTALLER): all-recursive
57 $(MKDIR_P) $(top_builddir)/release
58 STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIND_BIN) $(top_builddir)/release
59 STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIN_QT_BIN) $(top_builddir)/release
60 STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIN_CLI_BIN) $(top_builddir)/release
61 @test -f $(MAKENSIS) && $(MAKENSIS) $(top_builddir)/share/setup.nsi || \
62 echo error: could not build $@
64 $(if $(findstring src/,$(MAKECMDGOALS)),$(MAKECMDGOALS), none): FORCE
65 $(MAKE) -C src $(patsubst src/%,%,$@)
67 $(OSX_APP)/Contents/PkgInfo:
71 $(OSX_APP)/Contents/Resources/empty.lproj:
75 $(OSX_APP)/Contents/Info.plist: $(OSX_PLIST)
79 $(OSX_APP)/Contents/Resources/bitcoin.icns: $(OSX_INSTALLER_ICONS)
83 $(OSX_APP)/Contents/MacOS/Bitcoin-Qt: $(BITCOIN_QT_BIN)
85 STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $< $@
87 OSX_APP_BUILT=$(OSX_APP)/Contents/PkgInfo $(OSX_APP)/Contents/Resources/empty.lproj \
88 $(OSX_APP)/Contents/Resources/bitcoin.icns $(OSX_APP)/Contents/Info.plist \
89 $(OSX_APP)/Contents/MacOS/Bitcoin-Qt
92 $(OSX_DMG): $(OSX_APP_BUILT) $(OSX_PACKAGING)
93 $(OSX_DEPLOY_SCRIPT) $(OSX_APP) -add-qt-tr $(OSX_QT_TRANSLATIONS) -translations-dir=$(QT_TRANSLATION_DIR) -dmg -fancy $(OSX_FANCY_PLIST) -verbose 2
97 APP_DIST_DIR=$(top_builddir)/dist
98 APP_DIST_EXTRAS=$(APP_DIST_DIR)/.background/background.png $(APP_DIST_DIR)/.DS_Store $(APP_DIST_DIR)/Applications
100 $(APP_DIST_DIR)/Applications:
102 @cd $(@D); $(LN_S) /Applications $(@F)
104 $(APP_DIST_EXTRAS): $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Bitcoin-Qt
106 $(OSX_DMG): $(APP_DIST_EXTRAS)
107 $(GENISOIMAGE) -no-cache-inodes -D -l -probe -V "Bitcoin-Qt" -no-pad -r -apple -o $@ dist
109 $(APP_DIST_DIR)/.background/background.png:
111 $(INSTALL) $(top_srcdir)/contrib/macdeploy/background.png $@
112 $(APP_DIST_DIR)/.DS_Store:
113 $(INSTALL) $(top_srcdir)/contrib/macdeploy/DS_Store $@
115 $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Bitcoin-Qt: $(OSX_APP_BUILT) $(OSX_PACKAGING)
116 INSTALLNAMETOOL=$(INSTALLNAMETOOL) OTOOL=$(OTOOL) STRIP=$(STRIP) $(OSX_DEPLOY_SCRIPT) $(OSX_APP) -translations-dir=$(QT_TRANSLATION_DIR) -add-qt-tr $(OSX_QT_TRANSLATIONS) -verbose 2
118 deploydir: $(APP_DIST_EXTRAS)
122 appbundle: $(OSX_APP_BUILT)
126 deploy: $(BITCOIN_WIN_INSTALLER)
129 $(BITCOIN_QT_BIN): FORCE
130 $(MAKE) -C src qt/$(@F)
132 $(BITCOIND_BIN): FORCE
135 $(BITCOIN_CLI_BIN): FORCE
141 $(LCOV) -c -i -d $(abs_builddir)/src -o $@
143 baseline_filtered.info: baseline.info
144 $(LCOV) -r $< "/usr/include/*" -o $@
146 leveldb_baseline.info: baseline_filtered.info
147 $(LCOV) -c -i -d $(abs_builddir)/src/leveldb -b $(abs_builddir)/src/leveldb -o $@
149 leveldb_baseline_filtered.info: leveldb_baseline.info
150 $(LCOV) -r $< "/usr/include/*" -o $@
152 baseline_filtered_combined.info: leveldb_baseline_filtered.info baseline_filtered.info
153 $(LCOV) -a leveldb_baseline_filtered.info -a baseline_filtered.info -o $@
155 test_bitcoin.info: baseline_filtered_combined.info
156 $(MAKE) -C src/ check
157 $(LCOV) -c -d $(abs_builddir)/src -t test_bitcoin -o $@
158 $(LCOV) -z -d $(abs_builddir)/src
159 $(LCOV) -z -d $(abs_builddir)/src/leveldb
161 test_bitcoin_filtered.info: test_bitcoin.info
162 $(LCOV) -r $< "/usr/include/*" -o $@
164 block_test.info: test_bitcoin_filtered.info
166 -@TIMEOUT=15 qa/pull-tester/run-bitcoind-for-test.sh $(JAVA) -jar $(JAVA_COMPARISON_TOOL) qa/tmp/compTool 0
167 $(LCOV) -c -d $(abs_builddir)/src --t BitcoinJBlockTest -o $@
168 $(LCOV) -z -d $(abs_builddir)/src
169 $(LCOV) -z -d $(abs_builddir)/src/leveldb
171 block_test_filtered.info: block_test.info
172 $(LCOV) -r $< "/usr/include/*" -o $@
174 test_bitcoin_coverage.info: baseline_filtered_combined.info test_bitcoin_filtered.info
175 $(LCOV) -a baseline_filtered.info -a leveldb_baseline_filtered.info -a test_bitcoin_filtered.info -o $@
177 total_coverage.info: baseline_filtered_combined.info test_bitcoin_filtered.info block_test_filtered.info
178 $(LCOV) -a baseline_filtered.info -a leveldb_baseline_filtered.info -a test_bitcoin_filtered.info -a block_test_filtered.info -o $@ | $(GREP) "\%" | $(AWK) '{ print substr($$3,2,50) "/" $$5 }' > coverage_percent.txt
180 test_bitcoin.coverage/.dirstamp: test_bitcoin_coverage.info
181 $(GENHTML) -s $< -o $(@D)
184 total.coverage/.dirstamp: total_coverage.info
185 $(GENHTML) -s $< -o $(@D)
188 cov: test_bitcoin.coverage/.dirstamp total.coverage/.dirstamp
192 if USE_COMPARISON_TOOL
195 @qa/pull-tester/run-bitcoind-for-test.sh $(JAVA) -jar $(JAVA_COMPARISON_TOOL) qa/tmp/compTool $(COMPARISON_TOOL_REORG_TESTS) 2>&1
198 EXTRA_DIST = $(top_srcdir)/share/genbuild.sh qa/pull-tester/rpc-tests.sh qa/pull-tester/run-bitcoin-cli qa/rpc-tests $(DIST_DOCS) $(WINDOWS_PACKAGING) $(OSX_PACKAGING)
200 CLEANFILES = $(OSX_DMG) $(BITCOIN_WIN_INSTALLER)
202 .INTERMEDIATE: $(COVERAGE_INFO)
205 rm -rf test_bitcoin.coverage/ total.coverage/ $(OSX_APP)