1 ACLOCAL_AMFLAGS = -I build-aux/m4
12 pkgconfigdir = $(libdir)/pkgconfig
13 pkgconfig_DATA = libbitcoinconsensus.pc
16 BITCOIND_BIN=$(top_builddir)/src/$(BITCOIN_DAEMON_NAME)$(EXEEXT)
17 BITCOIN_QT_BIN=$(top_builddir)/src/qt/$(BITCOIN_GUI_NAME)$(EXEEXT)
18 BITCOIN_CLI_BIN=$(top_builddir)/src/$(BITCOIN_CLI_NAME)$(EXEEXT)
19 BITCOIN_WIN_INSTALLER=$(PACKAGE)-$(PACKAGE_VERSION)-win$(WINDOWS_BITS)-setup$(EXEEXT)
22 space := $(empty) $(empty)
24 OSX_APP=Bitcoin-Qt.app
25 OSX_VOLNAME = $(subst $(space),-,$(PACKAGE_NAME))
26 OSX_DMG = $(OSX_VOLNAME).dmg
27 OSX_BACKGROUND_SVG=background.svg
28 OSX_BACKGROUND_IMAGE=background.tiff
29 OSX_BACKGROUND_IMAGE_DPIS=36 72
30 OSX_DSSTORE_GEN=$(top_srcdir)/contrib/macdeploy/custom_dsstore.py
31 OSX_DEPLOY_SCRIPT=$(top_srcdir)/contrib/macdeploy/macdeployqtplus
32 OSX_FANCY_PLIST=$(top_srcdir)/contrib/macdeploy/fancy.plist
33 OSX_INSTALLER_ICONS=$(top_srcdir)/src/qt/res/icons/bitcoin.icns
34 OSX_PLIST=$(top_builddir)/share/qt/Info.plist #not installed
35 OSX_QT_TRANSLATIONS = da,de,es,hu,ru,uk,zh_CN,zh_TW
37 DIST_DOCS = $(wildcard doc/*.md) $(wildcard doc/release-notes/*.md)
39 BIN_CHECKS=$(top_srcdir)/contrib/devtools/symbol-check.py \
40 $(top_srcdir)/contrib/devtools/security-check.py
42 WINDOWS_PACKAGING = $(top_srcdir)/share/pixmaps/bitcoin.ico \
43 $(top_srcdir)/share/pixmaps/nsis-header.bmp \
44 $(top_srcdir)/share/pixmaps/nsis-wizard.bmp \
45 $(top_srcdir)/doc/README_windows.txt
47 OSX_PACKAGING = $(OSX_DEPLOY_SCRIPT) $(OSX_FANCY_PLIST) $(OSX_INSTALLER_ICONS) \
48 $(top_srcdir)/contrib/macdeploy/$(OSX_BACKGROUND_SVG) \
50 $(top_srcdir)/contrib/macdeploy/detached-sig-apply.sh \
51 $(top_srcdir)/contrib/macdeploy/detached-sig-create.sh
53 COVERAGE_INFO = baseline_filtered_combined.info baseline.info \
54 leveldb_baseline.info test_bitcoin_filtered.info total_coverage.info \
55 baseline_filtered.info rpc_test.info rpc_test_filtered.info \
56 leveldb_baseline_filtered.info test_bitcoin_coverage.info test_bitcoin.info
59 -$(GIT) archive --format=tar HEAD -- src/clientversion.cpp | $(AMTAR) -C $(top_distdir) -xf -
61 $(BITCOIN_WIN_INSTALLER): all-recursive
62 $(MKDIR_P) $(top_builddir)/release
63 STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIND_BIN) $(top_builddir)/release
64 STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIN_QT_BIN) $(top_builddir)/release
65 STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIN_CLI_BIN) $(top_builddir)/release
66 @test -f $(MAKENSIS) && $(MAKENSIS) -V2 $(top_builddir)/share/setup.nsi || \
67 echo error: could not build $@
70 $(if $(findstring src/,$(MAKECMDGOALS)),$(MAKECMDGOALS), none): FORCE
71 $(MAKE) -C src $(patsubst src/%,%,$@)
73 $(OSX_APP)/Contents/PkgInfo:
77 $(OSX_APP)/Contents/Resources/empty.lproj:
81 $(OSX_APP)/Contents/Info.plist: $(OSX_PLIST)
85 $(OSX_APP)/Contents/Resources/bitcoin.icns: $(OSX_INSTALLER_ICONS)
89 $(OSX_APP)/Contents/MacOS/Bitcoin-Qt: $(BITCOIN_QT_BIN)
91 STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $< $@
93 $(OSX_APP)/Contents/Resources/Base.lproj/InfoPlist.strings:
95 echo '{ CFBundleDisplayName = "$(PACKAGE_NAME)"; CFBundleName = "$(PACKAGE_NAME)"; }' > $@
97 OSX_APP_BUILT=$(OSX_APP)/Contents/PkgInfo $(OSX_APP)/Contents/Resources/empty.lproj \
98 $(OSX_APP)/Contents/Resources/bitcoin.icns $(OSX_APP)/Contents/Info.plist \
99 $(OSX_APP)/Contents/MacOS/Bitcoin-Qt $(OSX_APP)/Contents/Resources/Base.lproj/InfoPlist.strings
102 echo $(OSX_VOLNAME) >$@
105 $(OSX_DMG): $(OSX_APP_BUILT) $(OSX_PACKAGING)
106 $(PYTHON) $(OSX_DEPLOY_SCRIPT) $(OSX_APP) -add-qt-tr $(OSX_QT_TRANSLATIONS) -translations-dir=$(QT_TRANSLATION_DIR) -dmg -fancy $(OSX_FANCY_PLIST) -verbose 2 -volname $(OSX_VOLNAME)
108 deploydir: $(OSX_DMG)
110 APP_DIST_DIR=$(top_builddir)/dist
111 APP_DIST_EXTRAS=$(APP_DIST_DIR)/.background/$(OSX_BACKGROUND_IMAGE) $(APP_DIST_DIR)/.DS_Store $(APP_DIST_DIR)/Applications
113 $(APP_DIST_DIR)/Applications:
115 @cd $(@D); $(LN_S) /Applications $(@F)
117 $(APP_DIST_EXTRAS): $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Bitcoin-Qt
119 $(OSX_DMG): $(APP_DIST_EXTRAS)
120 $(GENISOIMAGE) -no-cache-inodes -D -l -probe -V "$(OSX_VOLNAME)" -no-pad -r -dir-mode 0755 -apple -o $@ dist
122 dpi%.$(OSX_BACKGROUND_IMAGE): contrib/macdeploy/$(OSX_BACKGROUND_SVG)
123 sed 's/PACKAGE_NAME/$(PACKAGE_NAME)/' < "$<" | $(RSVG_CONVERT) -f png -d $* -p $* | $(IMAGEMAGICK_CONVERT) - $@
124 OSX_BACKGROUND_IMAGE_DPIFILES := $(foreach dpi,$(OSX_BACKGROUND_IMAGE_DPIS),dpi$(dpi).$(OSX_BACKGROUND_IMAGE))
125 $(APP_DIST_DIR)/.background/$(OSX_BACKGROUND_IMAGE): $(OSX_BACKGROUND_IMAGE_DPIFILES)
127 $(TIFFCP) -c none $(OSX_BACKGROUND_IMAGE_DPIFILES) $@
129 $(APP_DIST_DIR)/.DS_Store: $(OSX_DSSTORE_GEN)
130 $(PYTHON) $< "$@" "$(OSX_VOLNAME)"
132 $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Bitcoin-Qt: $(OSX_APP_BUILT) $(OSX_PACKAGING)
133 INSTALLNAMETOOL=$(INSTALLNAMETOOL) OTOOL=$(OTOOL) STRIP=$(STRIP) $(PYTHON) $(OSX_DEPLOY_SCRIPT) $(OSX_APP) -translations-dir=$(QT_TRANSLATION_DIR) -add-qt-tr $(OSX_QT_TRANSLATIONS) -verbose 2
135 deploydir: $(APP_DIST_EXTRAS)
139 appbundle: $(OSX_APP_BUILT)
143 deploy: $(BITCOIN_WIN_INSTALLER)
146 $(BITCOIN_QT_BIN): FORCE
147 $(MAKE) -C src qt/$(@F)
149 $(BITCOIND_BIN): FORCE
152 $(BITCOIN_CLI_BIN): FORCE
158 $(LCOV) -c -i -d $(abs_builddir)/src -o $@
160 baseline_filtered.info: baseline.info
161 $(LCOV) -r $< "/usr/include/*" -o $@
163 leveldb_baseline.info: baseline_filtered.info
164 $(LCOV) -c -i -d $(abs_builddir)/src/leveldb -b $(abs_builddir)/src/leveldb -o $@
166 leveldb_baseline_filtered.info: leveldb_baseline.info
167 $(LCOV) -r $< "/usr/include/*" -o $@
169 baseline_filtered_combined.info: leveldb_baseline_filtered.info baseline_filtered.info
170 $(LCOV) -a leveldb_baseline_filtered.info -a baseline_filtered.info -o $@
172 test_bitcoin.info: baseline_filtered_combined.info
173 $(MAKE) -C src/ check
174 $(LCOV) -c -d $(abs_builddir)/src -t test_bitcoin -o $@
175 $(LCOV) -z -d $(abs_builddir)/src
176 $(LCOV) -z -d $(abs_builddir)/src/leveldb
178 test_bitcoin_filtered.info: test_bitcoin.info
179 $(LCOV) -r $< "/usr/include/*" -o $@
181 rpc_test.info: test_bitcoin_filtered.info
182 -@TIMEOUT=15 python qa/pull-tester/rpc-tests.py $(EXTENDED_RPC_TESTS)
183 $(LCOV) -c -d $(abs_builddir)/src --t rpc-tests -o $@
184 $(LCOV) -z -d $(abs_builddir)/src
185 $(LCOV) -z -d $(abs_builddir)/src/leveldb
187 rpc_test_filtered.info: rpc_test.info
188 $(LCOV) -r $< "/usr/include/*" -o $@
190 test_bitcoin_coverage.info: baseline_filtered_combined.info test_bitcoin_filtered.info
191 $(LCOV) -a baseline_filtered.info -a leveldb_baseline_filtered.info -a test_bitcoin_filtered.info -o $@
193 total_coverage.info: baseline_filtered_combined.info test_bitcoin_filtered.info rpc_test_filtered.info
194 $(LCOV) -a baseline_filtered.info -a leveldb_baseline_filtered.info -a test_bitcoin_filtered.info -a rpc_test_filtered.info -o $@ | $(GREP) "\%" | $(AWK) '{ print substr($$3,2,50) "/" $$5 }' > coverage_percent.txt
196 test_bitcoin.coverage/.dirstamp: test_bitcoin_coverage.info
197 $(GENHTML) -s $< -o $(@D)
200 total.coverage/.dirstamp: total_coverage.info
201 $(GENHTML) -s $< -o $(@D)
204 cov: test_bitcoin.coverage/.dirstamp total.coverage/.dirstamp
208 dist_noinst_SCRIPTS = autogen.sh
210 EXTRA_DIST = $(top_srcdir)/share/genbuild.sh qa/pull-tester/rpc-tests.py qa/rpc-tests $(DIST_DOCS) $(WINDOWS_PACKAGING) $(OSX_PACKAGING) $(BIN_CHECKS)
212 CLEANFILES = $(OSX_DMG) $(BITCOIN_WIN_INSTALLER)
214 # This file is problematic for out-of-tree builds if it exists.
215 DISTCLEANFILES = qa/pull-tester/tests_config.pyc
217 .INTERMEDIATE: $(COVERAGE_INFO)
219 DISTCHECK_CONFIGURE_FLAGS = --enable-man
222 rm -rf coverage_percent.txt test_bitcoin.coverage/ total.coverage/ qa/tmp/ cache/ $(OSX_APP)
223 rm -rf qa/pull-tester/__pycache__