Merge #8932: Allow bitcoin-tx to create v2 transactions
[bitcoinplatinum.git] / Makefile.am
blob44fdf9c9fb2da389c8447c0e87d25cc05e47647d
1 # Copyright (c) 2013-2016 The Bitcoin Core developers
2 # Distributed under the MIT software license, see the accompanying
3 # file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 ACLOCAL_AMFLAGS = -I build-aux/m4
6 SUBDIRS = src
7 if ENABLE_MAN
8 SUBDIRS += doc/man
9 endif
10 .PHONY: deploy FORCE
12 GZIP_ENV="-9n"
13 export PYTHONPATH
15 if BUILD_BITCOIN_LIBS
16 pkgconfigdir = $(libdir)/pkgconfig
17 pkgconfig_DATA = libbitcoinconsensus.pc
18 endif
20 BITCOIND_BIN=$(top_builddir)/src/$(BITCOIN_DAEMON_NAME)$(EXEEXT)
21 BITCOIN_QT_BIN=$(top_builddir)/src/qt/$(BITCOIN_GUI_NAME)$(EXEEXT)
22 BITCOIN_CLI_BIN=$(top_builddir)/src/$(BITCOIN_CLI_NAME)$(EXEEXT)
23 BITCOIN_WIN_INSTALLER=$(PACKAGE)-$(PACKAGE_VERSION)-win$(WINDOWS_BITS)-setup$(EXEEXT)
25 empty :=
26 space := $(empty) $(empty)
28 OSX_APP=Bitcoin-Qt.app
29 OSX_VOLNAME = $(subst $(space),-,$(PACKAGE_NAME))
30 OSX_DMG = $(OSX_VOLNAME).dmg
31 OSX_BACKGROUND_SVG=background.svg
32 OSX_BACKGROUND_IMAGE=background.tiff
33 OSX_BACKGROUND_IMAGE_DPIS=36 72
34 OSX_DSSTORE_GEN=$(top_srcdir)/contrib/macdeploy/custom_dsstore.py
35 OSX_DEPLOY_SCRIPT=$(top_srcdir)/contrib/macdeploy/macdeployqtplus
36 OSX_FANCY_PLIST=$(top_srcdir)/contrib/macdeploy/fancy.plist
37 OSX_INSTALLER_ICONS=$(top_srcdir)/src/qt/res/icons/bitcoin.icns
38 OSX_PLIST=$(top_builddir)/share/qt/Info.plist #not installed
39 OSX_QT_TRANSLATIONS = da,de,es,hu,ru,uk,zh_CN,zh_TW
41 DIST_DOCS = $(wildcard doc/*.md) $(wildcard doc/release-notes/*.md)
43 BIN_CHECKS=$(top_srcdir)/contrib/devtools/symbol-check.py \
44            $(top_srcdir)/contrib/devtools/security-check.py
46 WINDOWS_PACKAGING = $(top_srcdir)/share/pixmaps/bitcoin.ico \
47   $(top_srcdir)/share/pixmaps/nsis-header.bmp \
48   $(top_srcdir)/share/pixmaps/nsis-wizard.bmp \
49   $(top_srcdir)/doc/README_windows.txt
51 OSX_PACKAGING = $(OSX_DEPLOY_SCRIPT) $(OSX_FANCY_PLIST) $(OSX_INSTALLER_ICONS) \
52   $(top_srcdir)/contrib/macdeploy/$(OSX_BACKGROUND_SVG) \
53   $(OSX_DSSTORE_GEN) \
54   $(top_srcdir)/contrib/macdeploy/detached-sig-apply.sh \
55   $(top_srcdir)/contrib/macdeploy/detached-sig-create.sh
57 COVERAGE_INFO = baseline_filtered_combined.info baseline.info \
58   leveldb_baseline.info test_bitcoin_filtered.info total_coverage.info \
59   baseline_filtered.info rpc_test.info rpc_test_filtered.info \
60   leveldb_baseline_filtered.info test_bitcoin_coverage.info test_bitcoin.info
62 dist-hook:
63         -$(GIT) archive --format=tar HEAD -- src/clientversion.cpp | $(AMTAR) -C $(top_distdir) -xf -
65 $(BITCOIN_WIN_INSTALLER): all-recursive
66         $(MKDIR_P) $(top_builddir)/release
67         STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIND_BIN) $(top_builddir)/release
68         STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIN_QT_BIN) $(top_builddir)/release
69         STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIN_CLI_BIN) $(top_builddir)/release
70         @test -f $(MAKENSIS) && $(MAKENSIS) -V2 $(top_builddir)/share/setup.nsi || \
71           echo error: could not build $@
72         @echo built $@
74 $(if $(findstring src/,$(MAKECMDGOALS)),$(MAKECMDGOALS), none): FORCE
75         $(MAKE) -C src $(patsubst src/%,%,$@)
77 $(OSX_APP)/Contents/PkgInfo:
78         $(MKDIR_P) $(@D)
79         @echo "APPL????" > $@
81 $(OSX_APP)/Contents/Resources/empty.lproj:
82         $(MKDIR_P) $(@D)
83         @touch $@ 
85 $(OSX_APP)/Contents/Info.plist: $(OSX_PLIST)
86         $(MKDIR_P) $(@D)
87         $(INSTALL_DATA) $< $@
89 $(OSX_APP)/Contents/Resources/bitcoin.icns: $(OSX_INSTALLER_ICONS)
90         $(MKDIR_P) $(@D)
91         $(INSTALL_DATA) $< $@
93 $(OSX_APP)/Contents/MacOS/Bitcoin-Qt: $(BITCOIN_QT_BIN)
94         $(MKDIR_P) $(@D)
95         STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM)  $< $@
97 $(OSX_APP)/Contents/Resources/Base.lproj/InfoPlist.strings:
98         $(MKDIR_P) $(@D)
99         echo '{ CFBundleDisplayName = "$(PACKAGE_NAME)"; CFBundleName = "$(PACKAGE_NAME)"; }' > $@
101 OSX_APP_BUILT=$(OSX_APP)/Contents/PkgInfo $(OSX_APP)/Contents/Resources/empty.lproj \
102   $(OSX_APP)/Contents/Resources/bitcoin.icns $(OSX_APP)/Contents/Info.plist \
103   $(OSX_APP)/Contents/MacOS/Bitcoin-Qt $(OSX_APP)/Contents/Resources/Base.lproj/InfoPlist.strings
105 osx_volname:
106         echo $(OSX_VOLNAME) >$@
108 if BUILD_DARWIN
109 $(OSX_DMG): $(OSX_APP_BUILT) $(OSX_PACKAGING)
110         $(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)
112 deploydir: $(OSX_DMG)
113 else
114 APP_DIST_DIR=$(top_builddir)/dist
115 APP_DIST_EXTRAS=$(APP_DIST_DIR)/.background/$(OSX_BACKGROUND_IMAGE) $(APP_DIST_DIR)/.DS_Store $(APP_DIST_DIR)/Applications
117 $(APP_DIST_DIR)/Applications:
118         @rm -f $@
119         @cd $(@D); $(LN_S) /Applications $(@F)
121 $(APP_DIST_EXTRAS): $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Bitcoin-Qt
123 $(OSX_DMG): $(APP_DIST_EXTRAS)
124         $(GENISOIMAGE) -no-cache-inodes -D -l -probe -V "$(OSX_VOLNAME)" -no-pad -r -dir-mode 0755 -apple -o $@ dist
126 dpi%.$(OSX_BACKGROUND_IMAGE): contrib/macdeploy/$(OSX_BACKGROUND_SVG)
127         sed 's/PACKAGE_NAME/$(PACKAGE_NAME)/' < "$<" | $(RSVG_CONVERT) -f png -d $* -p $* | $(IMAGEMAGICK_CONVERT) - $@
128 OSX_BACKGROUND_IMAGE_DPIFILES := $(foreach dpi,$(OSX_BACKGROUND_IMAGE_DPIS),dpi$(dpi).$(OSX_BACKGROUND_IMAGE))
129 $(APP_DIST_DIR)/.background/$(OSX_BACKGROUND_IMAGE): $(OSX_BACKGROUND_IMAGE_DPIFILES)
130         $(MKDIR_P) $(@D)
131         $(TIFFCP) -c none $(OSX_BACKGROUND_IMAGE_DPIFILES) $@
133 $(APP_DIST_DIR)/.DS_Store: $(OSX_DSSTORE_GEN)
134         $(PYTHON) $< "$@" "$(OSX_VOLNAME)"
136 $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Bitcoin-Qt: $(OSX_APP_BUILT) $(OSX_PACKAGING)
137         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
139 deploydir: $(APP_DIST_EXTRAS)
140 endif
142 if TARGET_DARWIN
143 appbundle: $(OSX_APP_BUILT)
144 deploy: $(OSX_DMG)
145 endif
146 if TARGET_WINDOWS
147 deploy: $(BITCOIN_WIN_INSTALLER)
148 endif
150 $(BITCOIN_QT_BIN): FORCE
151         $(MAKE) -C src qt/$(@F)
153 $(BITCOIND_BIN): FORCE
154         $(MAKE) -C src $(@F)
156 $(BITCOIN_CLI_BIN): FORCE
157         $(MAKE) -C src $(@F)
159 if USE_LCOV
161 baseline.info:
162         $(LCOV) -c -i -d $(abs_builddir)/src -o $@
164 baseline_filtered.info: baseline.info
165         $(LCOV) -r $< "/usr/include/*" -o $@
167 leveldb_baseline.info: baseline_filtered.info
168         $(LCOV) -c -i -d $(abs_builddir)/src/leveldb -b $(abs_builddir)/src/leveldb -o $@
170 leveldb_baseline_filtered.info: leveldb_baseline.info
171         $(LCOV) -r $< "/usr/include/*" -o $@
173 baseline_filtered_combined.info: leveldb_baseline_filtered.info baseline_filtered.info
174         $(LCOV) -a leveldb_baseline_filtered.info -a baseline_filtered.info -o $@
176 test_bitcoin.info: baseline_filtered_combined.info
177         $(MAKE) -C src/ check
178         $(LCOV) -c -d $(abs_builddir)/src -t test_bitcoin -o $@
179         $(LCOV) -z -d $(abs_builddir)/src
180         $(LCOV) -z -d $(abs_builddir)/src/leveldb
182 test_bitcoin_filtered.info: test_bitcoin.info
183         $(LCOV) -r $< "/usr/include/*" -o $@
185 rpc_test.info: test_bitcoin_filtered.info
186         -@TIMEOUT=15 python qa/pull-tester/rpc-tests.py $(EXTENDED_RPC_TESTS)
187         $(LCOV) -c -d $(abs_builddir)/src --t rpc-tests -o $@
188         $(LCOV) -z -d $(abs_builddir)/src
189         $(LCOV) -z -d $(abs_builddir)/src/leveldb
191 rpc_test_filtered.info: rpc_test.info
192         $(LCOV) -r $< "/usr/include/*" -o $@
194 test_bitcoin_coverage.info: baseline_filtered_combined.info test_bitcoin_filtered.info
195         $(LCOV) -a baseline_filtered.info -a leveldb_baseline_filtered.info -a test_bitcoin_filtered.info -o $@
197 total_coverage.info: baseline_filtered_combined.info test_bitcoin_filtered.info rpc_test_filtered.info
198         $(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
200 test_bitcoin.coverage/.dirstamp:  test_bitcoin_coverage.info
201         $(GENHTML) -s $< -o $(@D)
202         @touch $@
204 total.coverage/.dirstamp: total_coverage.info
205         $(GENHTML) -s $< -o $(@D)
206         @touch $@
208 cov: test_bitcoin.coverage/.dirstamp total.coverage/.dirstamp
210 endif
212 dist_noinst_SCRIPTS = autogen.sh
214 EXTRA_DIST = $(top_srcdir)/share/genbuild.sh qa/pull-tester/rpc-tests.py qa/rpc-tests $(DIST_DOCS) $(WINDOWS_PACKAGING) $(OSX_PACKAGING) $(BIN_CHECKS)
216 CLEANFILES = $(OSX_DMG) $(BITCOIN_WIN_INSTALLER)
218 # This file is problematic for out-of-tree builds if it exists.
219 DISTCLEANFILES = qa/pull-tester/tests_config.pyc
221 .INTERMEDIATE: $(COVERAGE_INFO)
223 DISTCHECK_CONFIGURE_FLAGS = --enable-man
225 clean-local:
226         rm -rf coverage_percent.txt test_bitcoin.coverage/ total.coverage/ qa/tmp/ cache/ $(OSX_APP)
227         rm -rf qa/pull-tester/__pycache__