Use unique_ptr for upnp_thread (boost::thread)
[bitcoinplatinum.git] / Makefile.am
bloba7092bb334fc46e6c7459cdbf993efbd3939465a
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 export PYTHONPATH
14 if BUILD_BITCOIN_LIBS
15 pkgconfigdir = $(libdir)/pkgconfig
16 pkgconfig_DATA = libbitcoinconsensus.pc
17 endif
19 BITCOIND_BIN=$(top_builddir)/src/$(BITCOIN_DAEMON_NAME)$(EXEEXT)
20 BITCOIN_QT_BIN=$(top_builddir)/src/qt/$(BITCOIN_GUI_NAME)$(EXEEXT)
21 BITCOIN_CLI_BIN=$(top_builddir)/src/$(BITCOIN_CLI_NAME)$(EXEEXT)
22 BITCOIN_WIN_INSTALLER=$(PACKAGE)-$(PACKAGE_VERSION)-win$(WINDOWS_BITS)-setup$(EXEEXT)
24 empty :=
25 space := $(empty) $(empty)
27 OSX_APP=Bitcoin-Qt.app
28 OSX_VOLNAME = $(subst $(space),-,$(PACKAGE_NAME))
29 OSX_DMG = $(OSX_VOLNAME).dmg
30 OSX_BACKGROUND_SVG=background.svg
31 OSX_BACKGROUND_IMAGE=background.tiff
32 OSX_BACKGROUND_IMAGE_DPIS=36 72
33 OSX_DSSTORE_GEN=$(top_srcdir)/contrib/macdeploy/custom_dsstore.py
34 OSX_DEPLOY_SCRIPT=$(top_srcdir)/contrib/macdeploy/macdeployqtplus
35 OSX_FANCY_PLIST=$(top_srcdir)/contrib/macdeploy/fancy.plist
36 OSX_INSTALLER_ICONS=$(top_srcdir)/src/qt/res/icons/bitcoin.icns
37 OSX_PLIST=$(top_builddir)/share/qt/Info.plist #not installed
38 OSX_QT_TRANSLATIONS = da,de,es,hu,ru,uk,zh_CN,zh_TW
40 DIST_DOCS = $(wildcard doc/*.md) $(wildcard doc/release-notes/*.md)
41 DIST_CONTRIB = $(top_srcdir)/contrib/bitcoin-cli.bash-completion \
42                $(top_srcdir)/contrib/bitcoin-tx.bash-completion \
43                $(top_srcdir)/contrib/bitcoind.bash-completion \
44                $(top_srcdir)/contrib/init \
45                $(top_srcdir)/contrib/rpm
46 DIST_SHARE = \
47   $(top_srcdir)/share/genbuild.sh \
48   $(top_srcdir)/share/rpcuser
50 BIN_CHECKS=$(top_srcdir)/contrib/devtools/symbol-check.py \
51            $(top_srcdir)/contrib/devtools/security-check.py
53 WINDOWS_PACKAGING = $(top_srcdir)/share/pixmaps/bitcoin.ico \
54   $(top_srcdir)/share/pixmaps/nsis-header.bmp \
55   $(top_srcdir)/share/pixmaps/nsis-wizard.bmp \
56   $(top_srcdir)/doc/README_windows.txt
58 OSX_PACKAGING = $(OSX_DEPLOY_SCRIPT) $(OSX_FANCY_PLIST) $(OSX_INSTALLER_ICONS) \
59   $(top_srcdir)/contrib/macdeploy/$(OSX_BACKGROUND_SVG) \
60   $(OSX_DSSTORE_GEN) \
61   $(top_srcdir)/contrib/macdeploy/detached-sig-apply.sh \
62   $(top_srcdir)/contrib/macdeploy/detached-sig-create.sh
64 COVERAGE_INFO = baseline.info \
65   test_bitcoin_filtered.info total_coverage.info \
66   baseline_filtered.info functional_test.info functional_test_filtered.info \
67   test_bitcoin_coverage.info test_bitcoin.info
69 dist-hook:
70         -$(GIT) archive --format=tar HEAD -- src/clientversion.cpp | $(AMTAR) -C $(top_distdir) -xf -
72 $(BITCOIN_WIN_INSTALLER): all-recursive
73         $(MKDIR_P) $(top_builddir)/release
74         STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIND_BIN) $(top_builddir)/release
75         STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIN_QT_BIN) $(top_builddir)/release
76         STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIN_CLI_BIN) $(top_builddir)/release
77         @test -f $(MAKENSIS) && $(MAKENSIS) -V2 $(top_builddir)/share/setup.nsi || \
78           echo error: could not build $@
79         @echo built $@
81 $(OSX_APP)/Contents/PkgInfo:
82         $(MKDIR_P) $(@D)
83         @echo "APPL????" > $@
85 $(OSX_APP)/Contents/Resources/empty.lproj:
86         $(MKDIR_P) $(@D)
87         @touch $@ 
89 $(OSX_APP)/Contents/Info.plist: $(OSX_PLIST)
90         $(MKDIR_P) $(@D)
91         $(INSTALL_DATA) $< $@
93 $(OSX_APP)/Contents/Resources/bitcoin.icns: $(OSX_INSTALLER_ICONS)
94         $(MKDIR_P) $(@D)
95         $(INSTALL_DATA) $< $@
97 $(OSX_APP)/Contents/MacOS/Bitcoin-Qt: $(BITCOIN_QT_BIN)
98         $(MKDIR_P) $(@D)
99         STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM)  $< $@
101 $(OSX_APP)/Contents/Resources/Base.lproj/InfoPlist.strings:
102         $(MKDIR_P) $(@D)
103         echo '{ CFBundleDisplayName = "$(PACKAGE_NAME)"; CFBundleName = "$(PACKAGE_NAME)"; }' > $@
105 OSX_APP_BUILT=$(OSX_APP)/Contents/PkgInfo $(OSX_APP)/Contents/Resources/empty.lproj \
106   $(OSX_APP)/Contents/Resources/bitcoin.icns $(OSX_APP)/Contents/Info.plist \
107   $(OSX_APP)/Contents/MacOS/Bitcoin-Qt $(OSX_APP)/Contents/Resources/Base.lproj/InfoPlist.strings
109 osx_volname:
110         echo $(OSX_VOLNAME) >$@
112 if BUILD_DARWIN
113 $(OSX_DMG): $(OSX_APP_BUILT) $(OSX_PACKAGING) $(OSX_BACKGROUND_IMAGE)
114         $(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)
116 $(OSX_BACKGROUND_IMAGE).png: contrib/macdeploy/$(OSX_BACKGROUND_SVG)
117         sed 's/PACKAGE_NAME/$(PACKAGE_NAME)/' < "$<" | $(RSVG_CONVERT) -f png -d 36 -p 36 -o $@
118 $(OSX_BACKGROUND_IMAGE)@2x.png: contrib/macdeploy/$(OSX_BACKGROUND_SVG)
119         sed 's/PACKAGE_NAME/$(PACKAGE_NAME)/' < "$<" | $(RSVG_CONVERT) -f png -d 72 -p 72 -o $@
120 $(OSX_BACKGROUND_IMAGE): $(OSX_BACKGROUND_IMAGE).png $(OSX_BACKGROUND_IMAGE)@2x.png
121         tiffutil -cathidpicheck $^ -out $@
123 deploydir: $(OSX_DMG)
124 else
125 APP_DIST_DIR=$(top_builddir)/dist
126 APP_DIST_EXTRAS=$(APP_DIST_DIR)/.background/$(OSX_BACKGROUND_IMAGE) $(APP_DIST_DIR)/.DS_Store $(APP_DIST_DIR)/Applications
128 $(APP_DIST_DIR)/Applications:
129         @rm -f $@
130         @cd $(@D); $(LN_S) /Applications $(@F)
132 $(APP_DIST_EXTRAS): $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Bitcoin-Qt
134 $(OSX_DMG): $(APP_DIST_EXTRAS)
135         $(GENISOIMAGE) -no-cache-inodes -D -l -probe -V "$(OSX_VOLNAME)" -no-pad -r -dir-mode 0755 -apple -o $@ dist
137 dpi%.$(OSX_BACKGROUND_IMAGE): contrib/macdeploy/$(OSX_BACKGROUND_SVG)
138         sed 's/PACKAGE_NAME/$(PACKAGE_NAME)/' < "$<" | $(RSVG_CONVERT) -f png -d $* -p $* | $(IMAGEMAGICK_CONVERT) - $@
139 OSX_BACKGROUND_IMAGE_DPIFILES := $(foreach dpi,$(OSX_BACKGROUND_IMAGE_DPIS),dpi$(dpi).$(OSX_BACKGROUND_IMAGE))
140 $(APP_DIST_DIR)/.background/$(OSX_BACKGROUND_IMAGE): $(OSX_BACKGROUND_IMAGE_DPIFILES)
141         $(MKDIR_P) $(@D)
142         $(TIFFCP) -c none $(OSX_BACKGROUND_IMAGE_DPIFILES) $@
144 $(APP_DIST_DIR)/.DS_Store: $(OSX_DSSTORE_GEN)
145         $(PYTHON) $< "$@" "$(OSX_VOLNAME)"
147 $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Bitcoin-Qt: $(OSX_APP_BUILT) $(OSX_PACKAGING)
148         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
150 deploydir: $(APP_DIST_EXTRAS)
151 endif
153 if TARGET_DARWIN
154 appbundle: $(OSX_APP_BUILT)
155 deploy: $(OSX_DMG)
156 endif
157 if TARGET_WINDOWS
158 deploy: $(BITCOIN_WIN_INSTALLER)
159 endif
161 $(BITCOIN_QT_BIN): FORCE
162         $(MAKE) -C src qt/$(@F)
164 $(BITCOIND_BIN): FORCE
165         $(MAKE) -C src $(@F)
167 $(BITCOIN_CLI_BIN): FORCE
168         $(MAKE) -C src $(@F)
170 if USE_LCOV
171 LCOV_FILTER_PATTERN=-p "/usr/include/" -p "src/leveldb/" -p "src/bench/" -p "src/univalue" -p "src/crypto/ctaes" -p "src/secp256k1"
173 baseline.info:
174         $(LCOV) -c -i -d $(abs_builddir)/src -o $@
176 baseline_filtered.info: baseline.info
177         $(abs_builddir)/contrib/filter-lcov.py $(LCOV_FILTER_PATTERN) $< $@
178         $(LCOV) -a $@ $(LCOV_OPTS) -o $@
180 test_bitcoin.info: baseline_filtered.info
181         $(MAKE) -C src/ check
182         $(LCOV) -c $(LCOV_OPTS) -d $(abs_builddir)/src -t test_bitcoin -o $@
183         $(LCOV) -z $(LCOV_OPTS) -d $(abs_builddir)/src
185 test_bitcoin_filtered.info: test_bitcoin.info
186         $(abs_builddir)/contrib/filter-lcov.py $(LCOV_FILTER_PATTERN) $< $@
187         $(LCOV) -a $@ $(LCOV_OPTS) -o $@
189 functional_test.info: test_bitcoin_filtered.info
190         -@TIMEOUT=15 test/functional/test_runner.py $(EXTENDED_FUNCTIONAL_TESTS)
191         $(LCOV) -c $(LCOV_OPTS) -d $(abs_builddir)/src --t functional-tests -o $@
192         $(LCOV) -z $(LCOV_OPTS) -d $(abs_builddir)/src
194 functional_test_filtered.info: functional_test.info
195         $(abs_builddir)/contrib/filter-lcov.py $(LCOV_FILTER_PATTERN) $< $@
196         $(LCOV) -a $@ $(LCOV_OPTS) -o $@
198 test_bitcoin_coverage.info: baseline_filtered.info test_bitcoin_filtered.info
199         $(LCOV) -a $(LCOV_OPTS) baseline_filtered.info -a test_bitcoin_filtered.info -o $@
201 total_coverage.info: test_bitcoin_filtered.info functional_test_filtered.info
202         $(LCOV) -a $(LCOV_OPTS) baseline_filtered.info -a test_bitcoin_filtered.info -a functional_test_filtered.info -o $@ | $(GREP) "\%" | $(AWK) '{ print substr($$3,2,50) "/" $$5 }' > coverage_percent.txt
204 test_bitcoin.coverage/.dirstamp:  test_bitcoin_coverage.info
205         $(GENHTML) -s $(LCOV_OPTS) $< -o $(@D)
206         @touch $@
208 total.coverage/.dirstamp: total_coverage.info
209         $(GENHTML) -s $(LCOV_OPTS) $< -o $(@D)
210         @touch $@
212 cov: test_bitcoin.coverage/.dirstamp total.coverage/.dirstamp
214 endif
216 dist_noinst_SCRIPTS = autogen.sh
218 EXTRA_DIST = $(DIST_SHARE) test/functional/test_runner.py test/functional $(DIST_CONTRIB) $(DIST_DOCS) $(WINDOWS_PACKAGING) $(OSX_PACKAGING) $(BIN_CHECKS)
220 EXTRA_DIST += \
221     test/util/bitcoin-util-test.py \
222     test/util/data/bitcoin-util-test.json \
223     test/util/data/blanktxv1.hex \
224     test/util/data/blanktxv1.json \
225     test/util/data/blanktxv2.hex \
226     test/util/data/blanktxv2.json \
227     test/util/data/tt-delin1-out.hex \
228     test/util/data/tt-delin1-out.json \
229     test/util/data/tt-delout1-out.hex \
230     test/util/data/tt-delout1-out.json \
231     test/util/data/tt-locktime317000-out.hex \
232     test/util/data/tt-locktime317000-out.json \
233     test/util/data/tx394b54bb.hex \
234     test/util/data/txcreate1.hex \
235     test/util/data/txcreate1.json \
236     test/util/data/txcreate2.hex \
237     test/util/data/txcreate2.json \
238     test/util/data/txcreatedata1.hex \
239     test/util/data/txcreatedata1.json \
240     test/util/data/txcreatedata2.hex \
241     test/util/data/txcreatedata2.json \
242     test/util/data/txcreatedata_seq0.hex \
243     test/util/data/txcreatedata_seq0.json \
244     test/util/data/txcreatedata_seq1.hex \
245     test/util/data/txcreatedata_seq1.json \
246     test/util/data/txcreatemultisig1.hex \
247     test/util/data/txcreatemultisig1.json \
248     test/util/data/txcreatemultisig2.hex \
249     test/util/data/txcreatemultisig2.json \
250     test/util/data/txcreatemultisig3.hex \
251     test/util/data/txcreatemultisig3.json \
252     test/util/data/txcreatemultisig4.hex \
253     test/util/data/txcreatemultisig4.json \
254     test/util/data/txcreatemultisig5.json \
255     test/util/data/txcreateoutpubkey1.hex \
256     test/util/data/txcreateoutpubkey1.json \
257     test/util/data/txcreateoutpubkey2.hex \
258     test/util/data/txcreateoutpubkey2.json \
259     test/util/data/txcreateoutpubkey3.hex \
260     test/util/data/txcreateoutpubkey3.json \
261     test/util/data/txcreatescript1.hex \
262     test/util/data/txcreatescript1.json \
263     test/util/data/txcreatescript2.hex \
264     test/util/data/txcreatescript2.json \
265     test/util/data/txcreatescript3.hex \
266     test/util/data/txcreatescript3.json \
267     test/util/data/txcreatescript4.hex \
268     test/util/data/txcreatescript4.json \
269     test/util/data/txcreatesignv1.hex \
270     test/util/data/txcreatesignv1.json \
271     test/util/data/txcreatesignv2.hex
273 CLEANFILES = $(OSX_DMG) $(BITCOIN_WIN_INSTALLER)
275 .INTERMEDIATE: $(COVERAGE_INFO)
277 DISTCHECK_CONFIGURE_FLAGS = --enable-man
279 clean-local:
280         rm -rf coverage_percent.txt test_bitcoin.coverage/ total.coverage/ test/tmp/ cache/ $(OSX_APP)
281         rm -rf test/functional/__pycache__