Merge #8154: drop vAddrToSend after sending big addr message
[bitcoinplatinum.git] / Makefile.am
blob5783c1fdd8f55a4d75faef10d77fd027051991c4
1 ACLOCAL_AMFLAGS = -I build-aux/m4
2 SUBDIRS = src
3 .PHONY: deploy FORCE
5 GZIP_ENV="-9n"
6 export PYTHONPATH
8 if BUILD_BITCOIN_LIBS
9 pkgconfigdir = $(libdir)/pkgconfig
10 pkgconfig_DATA = libbitcoinconsensus.pc
11 endif
13 BITCOIND_BIN=$(top_builddir)/src/$(BITCOIN_DAEMON_NAME)$(EXEEXT)
14 BITCOIN_QT_BIN=$(top_builddir)/src/qt/$(BITCOIN_GUI_NAME)$(EXEEXT)
15 BITCOIN_CLI_BIN=$(top_builddir)/src/$(BITCOIN_CLI_NAME)$(EXEEXT)
16 BITCOIN_WIN_INSTALLER=$(PACKAGE)-$(PACKAGE_VERSION)-win$(WINDOWS_BITS)-setup$(EXEEXT)
18 empty :=
19 space := $(empty) $(empty)
21 OSX_APP=Bitcoin-Qt.app
22 OSX_VOLNAME = $(subst $(space),-,$(PACKAGE_NAME))
23 OSX_DMG = $(OSX_VOLNAME).dmg
24 OSX_BACKGROUND_SVG=background.svg
25 OSX_BACKGROUND_IMAGE=background.tiff
26 OSX_BACKGROUND_IMAGE_DPIS=36 72
27 OSX_DSSTORE_GEN=$(top_srcdir)/contrib/macdeploy/custom_dsstore.py
28 OSX_DEPLOY_SCRIPT=$(top_srcdir)/contrib/macdeploy/macdeployqtplus
29 OSX_FANCY_PLIST=$(top_srcdir)/contrib/macdeploy/fancy.plist
30 OSX_INSTALLER_ICONS=$(top_srcdir)/src/qt/res/icons/bitcoin.icns
31 OSX_PLIST=$(top_srcdir)/share/qt/Info.plist #not installed
32 OSX_QT_TRANSLATIONS = da,de,es,hu,ru,uk,zh_CN,zh_TW
34 DIST_DOCS = $(wildcard doc/*.md) $(wildcard doc/release-notes/*.md)
36 BIN_CHECKS=$(top_srcdir)/contrib/devtools/symbol-check.py \
37            $(top_srcdir)/contrib/devtools/security-check.py
39 WINDOWS_PACKAGING = $(top_srcdir)/share/pixmaps/bitcoin.ico \
40   $(top_srcdir)/share/pixmaps/nsis-header.bmp \
41   $(top_srcdir)/share/pixmaps/nsis-wizard.bmp \
42   $(top_srcdir)/doc/README_windows.txt
44 OSX_PACKAGING = $(OSX_DEPLOY_SCRIPT) $(OSX_FANCY_PLIST) $(OSX_INSTALLER_ICONS) \
45   $(top_srcdir)/contrib/macdeploy/$(OSX_BACKGROUND_SVG) \
46   $(OSX_DSSTORE_GEN) \
47   $(top_srcdir)/contrib/macdeploy/detached-sig-apply.sh \
48   $(top_srcdir)/contrib/macdeploy/detached-sig-create.sh
50 COVERAGE_INFO = baseline_filtered_combined.info baseline.info block_test.info \
51   leveldb_baseline.info test_bitcoin_filtered.info total_coverage.info \
52   baseline_filtered.info block_test_filtered.info rpc_test.info rpc_test_filtered.info \
53   leveldb_baseline_filtered.info test_bitcoin_coverage.info test_bitcoin.info
55 dist-hook:
56         -$(MAKE) -C $(top_distdir)/src/leveldb clean
57         -$(MAKE) -C $(top_distdir)/src/secp256k1 distclean
58         -$(GIT) archive --format=tar HEAD -- src/clientversion.cpp | $(AMTAR) -C $(top_distdir) -xf -
60 distcheck-hook:
61         $(MKDIR_P) $(top_distdir)/_build/src/leveldb
62         cp -rf $(top_srcdir)/src/leveldb/* $(top_distdir)/_build/src/leveldb/
63         -$(MAKE) -C $(top_distdir)/_build/src/leveldb clean
65 distcleancheck:
66         @:
68 $(BITCOIN_WIN_INSTALLER): all-recursive
69         $(MKDIR_P) $(top_builddir)/release
70         STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIND_BIN) $(top_builddir)/release
71         STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIN_QT_BIN) $(top_builddir)/release
72         STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIN_CLI_BIN) $(top_builddir)/release
73         @test -f $(MAKENSIS) && $(MAKENSIS) -V2 $(top_builddir)/share/setup.nsi || \
74           echo error: could not build $@
75         @echo built $@
77 $(if $(findstring src/,$(MAKECMDGOALS)),$(MAKECMDGOALS), none): FORCE
78         $(MAKE) -C src $(patsubst src/%,%,$@)
80 $(OSX_APP)/Contents/PkgInfo:
81         $(MKDIR_P) $(@D)
82         @echo "APPL????" > $@
84 $(OSX_APP)/Contents/Resources/empty.lproj:
85         $(MKDIR_P) $(@D)
86         @touch $@ 
88 $(OSX_APP)/Contents/Info.plist: $(OSX_PLIST)
89         $(MKDIR_P) $(@D)
90         $(INSTALL_DATA) $< $@
92 $(OSX_APP)/Contents/Resources/bitcoin.icns: $(OSX_INSTALLER_ICONS)
93         $(MKDIR_P) $(@D)
94         $(INSTALL_DATA) $< $@
96 $(OSX_APP)/Contents/MacOS/Bitcoin-Qt: $(BITCOIN_QT_BIN)
97         $(MKDIR_P) $(@D)
98         STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM)  $< $@
100 $(OSX_APP)/Contents/Resources/Base.lproj/InfoPlist.strings:
101         $(MKDIR_P) $(@D)
102         echo '{ CFBundleDisplayName = "$(PACKAGE_NAME)"; CFBundleName = "$(PACKAGE_NAME)"; }' > $@
104 OSX_APP_BUILT=$(OSX_APP)/Contents/PkgInfo $(OSX_APP)/Contents/Resources/empty.lproj \
105   $(OSX_APP)/Contents/Resources/bitcoin.icns $(OSX_APP)/Contents/Info.plist \
106   $(OSX_APP)/Contents/MacOS/Bitcoin-Qt $(OSX_APP)/Contents/Resources/Base.lproj/InfoPlist.strings
108 osx_volname:
109         echo $(OSX_VOLNAME) >$@
111 if BUILD_DARWIN
112 $(OSX_DMG): $(OSX_APP_BUILT) $(OSX_PACKAGING)
113         $(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)
115 deploydir: $(OSX_DMG)
116 else
117 APP_DIST_DIR=$(top_builddir)/dist
118 APP_DIST_EXTRAS=$(APP_DIST_DIR)/.background/$(OSX_BACKGROUND_IMAGE) $(APP_DIST_DIR)/.DS_Store $(APP_DIST_DIR)/Applications
120 $(APP_DIST_DIR)/Applications:
121         @rm -f $@
122         @cd $(@D); $(LN_S) /Applications $(@F)
124 $(APP_DIST_EXTRAS): $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Bitcoin-Qt
126 $(OSX_DMG): $(APP_DIST_EXTRAS)
127         $(GENISOIMAGE) -no-cache-inodes -D -l -probe -V "$(OSX_VOLNAME)" -no-pad -r -dir-mode 0755 -apple -o $@ dist
129 dpi%.$(OSX_BACKGROUND_IMAGE): contrib/macdeploy/$(OSX_BACKGROUND_SVG)
130         sed 's/PACKAGE_NAME/$(PACKAGE_NAME)/' < "$<" | $(RSVG_CONVERT) -f png -d $* -p $* | $(IMAGEMAGICK_CONVERT) - $@
131 OSX_BACKGROUND_IMAGE_DPIFILES := $(foreach dpi,$(OSX_BACKGROUND_IMAGE_DPIS),dpi$(dpi).$(OSX_BACKGROUND_IMAGE))
132 $(APP_DIST_DIR)/.background/$(OSX_BACKGROUND_IMAGE): $(OSX_BACKGROUND_IMAGE_DPIFILES)
133         $(MKDIR_P) $(@D)
134         $(TIFFCP) -c none $(OSX_BACKGROUND_IMAGE_DPIFILES) $@
136 $(APP_DIST_DIR)/.DS_Store: $(OSX_DSSTORE_GEN)
137         $(PYTHON) $< "$@" "$(OSX_VOLNAME)"
139 $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Bitcoin-Qt: $(OSX_APP_BUILT) $(OSX_PACKAGING)
140         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
142 deploydir: $(APP_DIST_EXTRAS)
143 endif
145 if TARGET_DARWIN
146 appbundle: $(OSX_APP_BUILT)
147 deploy: $(OSX_DMG)
148 endif
149 if TARGET_WINDOWS
150 deploy: $(BITCOIN_WIN_INSTALLER)
151 endif
153 $(BITCOIN_QT_BIN): FORCE
154         $(MAKE) -C src qt/$(@F)
156 $(BITCOIND_BIN): FORCE
157         $(MAKE) -C src $(@F)
159 $(BITCOIN_CLI_BIN): FORCE
160         $(MAKE) -C src $(@F)
162 if USE_LCOV
164 baseline.info:
165         $(LCOV) -c -i -d $(abs_builddir)/src -o $@
167 baseline_filtered.info: baseline.info
168         $(LCOV) -r $< "/usr/include/*" -o $@
170 leveldb_baseline.info: baseline_filtered.info
171         $(LCOV) -c -i -d $(abs_builddir)/src/leveldb -b $(abs_builddir)/src/leveldb -o $@
173 leveldb_baseline_filtered.info: leveldb_baseline.info
174         $(LCOV) -r $< "/usr/include/*" -o $@
176 baseline_filtered_combined.info: leveldb_baseline_filtered.info baseline_filtered.info
177         $(LCOV) -a leveldb_baseline_filtered.info -a baseline_filtered.info -o $@
179 test_bitcoin.info: baseline_filtered_combined.info
180         $(MAKE) -C src/ check
181         $(LCOV) -c -d $(abs_builddir)/src -t test_bitcoin -o $@
182         $(LCOV) -z -d $(abs_builddir)/src
183         $(LCOV) -z -d $(abs_builddir)/src/leveldb
185 test_bitcoin_filtered.info: test_bitcoin.info
186         $(LCOV) -r $< "/usr/include/*" -o $@
188 block_test.info: test_bitcoin_filtered.info
189         $(MKDIR_P) qa/tmp
190         -@TIMEOUT=15 qa/pull-tester/run-bitcoind-for-test.sh $(JAVA) -jar $(JAVA_COMPARISON_TOOL) qa/tmp/compTool $(COMPARISON_TOOL_REORG_TESTS)
191         $(LCOV) -c -d $(abs_builddir)/src --t BitcoinJBlockTest -o $@
192         $(LCOV) -z -d $(abs_builddir)/src
193         $(LCOV) -z -d $(abs_builddir)/src/leveldb
195 block_test_filtered.info: block_test.info
196         $(LCOV) -r $< "/usr/include/*" -o $@
198 rpc_test.info: test_bitcoin_filtered.info
199         -@TIMEOUT=15 python qa/pull-tester/rpc-tests.py $(EXTENDED_RPC_TESTS)
200         $(LCOV) -c -d $(abs_builddir)/src --t rpc-tests -o $@
201         $(LCOV) -z -d $(abs_builddir)/src
202         $(LCOV) -z -d $(abs_builddir)/src/leveldb
204 rpc_test_filtered.info: rpc_test.info
205         $(LCOV) -r $< "/usr/include/*" -o $@
207 test_bitcoin_coverage.info: baseline_filtered_combined.info test_bitcoin_filtered.info
208         $(LCOV) -a baseline_filtered.info -a leveldb_baseline_filtered.info -a test_bitcoin_filtered.info -o $@
210 total_coverage.info: baseline_filtered_combined.info test_bitcoin_filtered.info block_test_filtered.info rpc_test_filtered.info
211         $(LCOV) -a baseline_filtered.info -a leveldb_baseline_filtered.info -a test_bitcoin_filtered.info -a block_test_filtered.info -a rpc_test_filtered.info -o $@ | $(GREP) "\%" | $(AWK) '{ print substr($$3,2,50) "/" $$5 }' > coverage_percent.txt
213 test_bitcoin.coverage/.dirstamp:  test_bitcoin_coverage.info
214         $(GENHTML) -s $< -o $(@D)
215         @touch $@
217 total.coverage/.dirstamp: total_coverage.info
218         $(GENHTML) -s $< -o $(@D)
219         @touch $@
221 cov: test_bitcoin.coverage/.dirstamp total.coverage/.dirstamp
223 endif
225 if USE_COMPARISON_TOOL
226 check-local:
227         $(MKDIR_P) qa/tmp
228         @qa/pull-tester/run-bitcoind-for-test.sh $(JAVA) -jar $(JAVA_COMPARISON_TOOL) qa/tmp/compTool $(COMPARISON_TOOL_REORG_TESTS) 2>&1
229 endif
231 dist_noinst_SCRIPTS = autogen.sh
233 EXTRA_DIST = $(top_srcdir)/share/genbuild.sh qa/pull-tester/rpc-tests.py qa/rpc-tests $(DIST_DOCS) $(WINDOWS_PACKAGING) $(OSX_PACKAGING) $(BIN_CHECKS)
235 CLEANFILES = $(OSX_DMG) $(BITCOIN_WIN_INSTALLER)
237 .INTERMEDIATE: $(COVERAGE_INFO)
239 clean-local:
240         rm -rf coverage_percent.txt test_bitcoin.coverage/ total.coverage/ qa/tmp/ cache/ $(OSX_APP)