Merge #9128: net: Decouple CConnman and message serialization
[bitcoinplatinum.git] / Makefile.am
blob76eba519068f43accbdcd59293c04fb6e2b70fdd
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)
42 DIST_CONTRIB = $(top_srcdir)/contrib/bitcoin-cli.bash-completion \
43                $(top_srcdir)/contrib/bitcoin-tx.bash-completion \
44                $(top_srcdir)/contrib/bitcoind.bash-completion \
45                $(top_srcdir)/contrib/init \
46                $(top_srcdir)/contrib/rpm
48 BIN_CHECKS=$(top_srcdir)/contrib/devtools/symbol-check.py \
49            $(top_srcdir)/contrib/devtools/security-check.py
51 WINDOWS_PACKAGING = $(top_srcdir)/share/pixmaps/bitcoin.ico \
52   $(top_srcdir)/share/pixmaps/nsis-header.bmp \
53   $(top_srcdir)/share/pixmaps/nsis-wizard.bmp \
54   $(top_srcdir)/doc/README_windows.txt
56 OSX_PACKAGING = $(OSX_DEPLOY_SCRIPT) $(OSX_FANCY_PLIST) $(OSX_INSTALLER_ICONS) \
57   $(top_srcdir)/contrib/macdeploy/$(OSX_BACKGROUND_SVG) \
58   $(OSX_DSSTORE_GEN) \
59   $(top_srcdir)/contrib/macdeploy/detached-sig-apply.sh \
60   $(top_srcdir)/contrib/macdeploy/detached-sig-create.sh
62 COVERAGE_INFO = baseline_filtered_combined.info baseline.info \
63   leveldb_baseline.info test_bitcoin_filtered.info total_coverage.info \
64   baseline_filtered.info rpc_test.info rpc_test_filtered.info \
65   leveldb_baseline_filtered.info test_bitcoin_coverage.info test_bitcoin.info
67 dist-hook:
68         -$(GIT) archive --format=tar HEAD -- src/clientversion.cpp | $(AMTAR) -C $(top_distdir) -xf -
70 $(BITCOIN_WIN_INSTALLER): all-recursive
71         $(MKDIR_P) $(top_builddir)/release
72         STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIND_BIN) $(top_builddir)/release
73         STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIN_QT_BIN) $(top_builddir)/release
74         STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIN_CLI_BIN) $(top_builddir)/release
75         @test -f $(MAKENSIS) && $(MAKENSIS) -V2 $(top_builddir)/share/setup.nsi || \
76           echo error: could not build $@
77         @echo built $@
79 $(if $(findstring src/,$(MAKECMDGOALS)),$(MAKECMDGOALS), none): FORCE
80         $(MAKE) -C src $(patsubst src/%,%,$@)
82 $(OSX_APP)/Contents/PkgInfo:
83         $(MKDIR_P) $(@D)
84         @echo "APPL????" > $@
86 $(OSX_APP)/Contents/Resources/empty.lproj:
87         $(MKDIR_P) $(@D)
88         @touch $@ 
90 $(OSX_APP)/Contents/Info.plist: $(OSX_PLIST)
91         $(MKDIR_P) $(@D)
92         $(INSTALL_DATA) $< $@
94 $(OSX_APP)/Contents/Resources/bitcoin.icns: $(OSX_INSTALLER_ICONS)
95         $(MKDIR_P) $(@D)
96         $(INSTALL_DATA) $< $@
98 $(OSX_APP)/Contents/MacOS/Bitcoin-Qt: $(BITCOIN_QT_BIN)
99         $(MKDIR_P) $(@D)
100         STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM)  $< $@
102 $(OSX_APP)/Contents/Resources/Base.lproj/InfoPlist.strings:
103         $(MKDIR_P) $(@D)
104         echo '{ CFBundleDisplayName = "$(PACKAGE_NAME)"; CFBundleName = "$(PACKAGE_NAME)"; }' > $@
106 OSX_APP_BUILT=$(OSX_APP)/Contents/PkgInfo $(OSX_APP)/Contents/Resources/empty.lproj \
107   $(OSX_APP)/Contents/Resources/bitcoin.icns $(OSX_APP)/Contents/Info.plist \
108   $(OSX_APP)/Contents/MacOS/Bitcoin-Qt $(OSX_APP)/Contents/Resources/Base.lproj/InfoPlist.strings
110 osx_volname:
111         echo $(OSX_VOLNAME) >$@
113 if BUILD_DARWIN
114 $(OSX_DMG): $(OSX_APP_BUILT) $(OSX_PACKAGING)
115         $(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)
117 deploydir: $(OSX_DMG)
118 else
119 APP_DIST_DIR=$(top_builddir)/dist
120 APP_DIST_EXTRAS=$(APP_DIST_DIR)/.background/$(OSX_BACKGROUND_IMAGE) $(APP_DIST_DIR)/.DS_Store $(APP_DIST_DIR)/Applications
122 $(APP_DIST_DIR)/Applications:
123         @rm -f $@
124         @cd $(@D); $(LN_S) /Applications $(@F)
126 $(APP_DIST_EXTRAS): $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Bitcoin-Qt
128 $(OSX_DMG): $(APP_DIST_EXTRAS)
129         $(GENISOIMAGE) -no-cache-inodes -D -l -probe -V "$(OSX_VOLNAME)" -no-pad -r -dir-mode 0755 -apple -o $@ dist
131 dpi%.$(OSX_BACKGROUND_IMAGE): contrib/macdeploy/$(OSX_BACKGROUND_SVG)
132         sed 's/PACKAGE_NAME/$(PACKAGE_NAME)/' < "$<" | $(RSVG_CONVERT) -f png -d $* -p $* | $(IMAGEMAGICK_CONVERT) - $@
133 OSX_BACKGROUND_IMAGE_DPIFILES := $(foreach dpi,$(OSX_BACKGROUND_IMAGE_DPIS),dpi$(dpi).$(OSX_BACKGROUND_IMAGE))
134 $(APP_DIST_DIR)/.background/$(OSX_BACKGROUND_IMAGE): $(OSX_BACKGROUND_IMAGE_DPIFILES)
135         $(MKDIR_P) $(@D)
136         $(TIFFCP) -c none $(OSX_BACKGROUND_IMAGE_DPIFILES) $@
138 $(APP_DIST_DIR)/.DS_Store: $(OSX_DSSTORE_GEN)
139         $(PYTHON) $< "$@" "$(OSX_VOLNAME)"
141 $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Bitcoin-Qt: $(OSX_APP_BUILT) $(OSX_PACKAGING)
142         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
144 deploydir: $(APP_DIST_EXTRAS)
145 endif
147 if TARGET_DARWIN
148 appbundle: $(OSX_APP_BUILT)
149 deploy: $(OSX_DMG)
150 endif
151 if TARGET_WINDOWS
152 deploy: $(BITCOIN_WIN_INSTALLER)
153 endif
155 $(BITCOIN_QT_BIN): FORCE
156         $(MAKE) -C src qt/$(@F)
158 $(BITCOIND_BIN): FORCE
159         $(MAKE) -C src $(@F)
161 $(BITCOIN_CLI_BIN): FORCE
162         $(MAKE) -C src $(@F)
164 if USE_LCOV
166 baseline.info:
167         $(LCOV) -c -i -d $(abs_builddir)/src -o $@
169 baseline_filtered.info: baseline.info
170         $(LCOV) -r $< "/usr/include/*" -o $@
172 leveldb_baseline.info: baseline_filtered.info
173         $(LCOV) -c -i -d $(abs_builddir)/src/leveldb -b $(abs_builddir)/src/leveldb -o $@
175 leveldb_baseline_filtered.info: leveldb_baseline.info
176         $(LCOV) -r $< "/usr/include/*" -o $@
178 baseline_filtered_combined.info: leveldb_baseline_filtered.info baseline_filtered.info
179         $(LCOV) -a leveldb_baseline_filtered.info -a baseline_filtered.info -o $@
181 test_bitcoin.info: baseline_filtered_combined.info
182         $(MAKE) -C src/ check
183         $(LCOV) -c -d $(abs_builddir)/src -t test_bitcoin -o $@
184         $(LCOV) -z -d $(abs_builddir)/src
185         $(LCOV) -z -d $(abs_builddir)/src/leveldb
187 test_bitcoin_filtered.info: test_bitcoin.info
188         $(LCOV) -r $< "/usr/include/*" -o $@
190 rpc_test.info: test_bitcoin_filtered.info
191         -@TIMEOUT=15 python qa/pull-tester/rpc-tests.py $(EXTENDED_RPC_TESTS)
192         $(LCOV) -c -d $(abs_builddir)/src --t rpc-tests -o $@
193         $(LCOV) -z -d $(abs_builddir)/src
194         $(LCOV) -z -d $(abs_builddir)/src/leveldb
196 rpc_test_filtered.info: rpc_test.info
197         $(LCOV) -r $< "/usr/include/*" -o $@
199 test_bitcoin_coverage.info: baseline_filtered_combined.info test_bitcoin_filtered.info
200         $(LCOV) -a baseline_filtered.info -a leveldb_baseline_filtered.info -a test_bitcoin_filtered.info -o $@
202 total_coverage.info: baseline_filtered_combined.info test_bitcoin_filtered.info rpc_test_filtered.info
203         $(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
205 test_bitcoin.coverage/.dirstamp:  test_bitcoin_coverage.info
206         $(GENHTML) -s $< -o $(@D)
207         @touch $@
209 total.coverage/.dirstamp: total_coverage.info
210         $(GENHTML) -s $< -o $(@D)
211         @touch $@
213 cov: test_bitcoin.coverage/.dirstamp total.coverage/.dirstamp
215 endif
217 dist_noinst_SCRIPTS = autogen.sh
219 EXTRA_DIST = $(top_srcdir)/share/genbuild.sh qa/pull-tester/rpc-tests.py qa/rpc-tests $(DIST_CONTRIB) $(DIST_DOCS) $(WINDOWS_PACKAGING) $(OSX_PACKAGING) $(BIN_CHECKS)
221 CLEANFILES = $(OSX_DMG) $(BITCOIN_WIN_INSTALLER)
223 # This file is problematic for out-of-tree builds if it exists.
224 DISTCLEANFILES = qa/pull-tester/tests_config.pyc
226 .INTERMEDIATE: $(COVERAGE_INFO)
228 DISTCHECK_CONFIGURE_FLAGS = --enable-man
230 clean-local:
231         rm -rf coverage_percent.txt test_bitcoin.coverage/ total.coverage/ qa/tmp/ cache/ $(OSX_APP)
232         rm -rf qa/pull-tester/__pycache__