Update license in pull-tester and rpc-tests
[bitcoinplatinum.git] / Makefile.am
blobfe7244edf82c23c8c43ba4290dbc6b368aa7d565
1 ACLOCAL_AMFLAGS = -I build-aux/m4
2 SUBDIRS = src
3 .PHONY: deploy FORCE
5 GZIP_ENV="-9n"
7 BITCOIND_BIN=$(top_builddir)/src/bitcoind$(EXEEXT)
8 BITCOIN_QT_BIN=$(top_builddir)/src/qt/bitcoin-qt$(EXEEXT)
9 BITCOIN_CLI_BIN=$(top_builddir)/src/bitcoin-cli$(EXEEXT)
10 BITCOIN_WIN_INSTALLER=$(PACKAGE)-$(PACKAGE_VERSION)-win$(WINDOWS_BITS)-setup$(EXEEXT)
12 OSX_APP=Bitcoin-Qt.app
13 OSX_DMG=Bitcoin-Qt.dmg
14 OSX_DEPLOY_SCRIPT=$(top_srcdir)/contrib/macdeploy/macdeployqtplus
15 OSX_FANCY_PLIST=$(top_srcdir)/contrib/macdeploy/fancy.plist
16 OSX_INSTALLER_ICONS=$(top_srcdir)/src/qt/res/icons/bitcoin.icns
17 OSX_PLIST=$(top_srcdir)/share/qt/Info.plist #not installed
18 OSX_QT_TRANSLATIONS = da,de,es,hu,ru,uk,zh_CN,zh_TW
20 DIST_DOCS = $(wildcard doc/*.md) $(wildcard doc/release-notes/*.md)
22 WINDOWS_PACKAGING = $(top_srcdir)/share/pixmaps/bitcoin.ico \
23   $(top_srcdir)/share/pixmaps/nsis-header.bmp \
24   $(top_srcdir)/share/pixmaps/nsis-wizard.bmp \
25   $(top_srcdir)/doc/README_windows.txt
27 OSX_PACKAGING = $(OSX_DEPLOY_SCRIPT) $(OSX_FANCY_PLIST) $(OSX_INSTALLER_ICONS) \
28   $(top_srcdir)/contrib/macdeploy/background.png \
29   $(top_srcdir)/contrib/macdeploy/DS_Store
31 COVERAGE_INFO = baseline_filtered_combined.info baseline.info block_test.info \
32   leveldb_baseline.info test_bitcoin_filtered.info total_coverage.info \
33   baseline_filtered.info block_test_filtered.info \
34   leveldb_baseline_filtered.info test_bitcoin_coverage.info test_bitcoin.info
36 dist-hook:
37         -$(MAKE) -C $(top_distdir)/src/leveldb clean
38         -$(MAKE) -C $(top_distdir)/src/secp256k1 distclean
39         -$(GIT) archive --format=tar HEAD -- src/version.cpp | $(AMTAR) -C $(top_distdir) -xf -
41 distcheck-hook:
42         $(MKDIR_P) $(top_distdir)/_build/src/leveldb
43         cp -rf $(top_srcdir)/src/leveldb/* $(top_distdir)/_build/src/leveldb/
44         -$(MAKE) -C $(top_distdir)/_build/src/leveldb clean
46 distcleancheck:
47         @:
49 $(BITCOIN_WIN_INSTALLER): all-recursive
50         $(MKDIR_P) $(top_builddir)/release
51         STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIND_BIN) $(top_builddir)/release
52         STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIN_QT_BIN) $(top_builddir)/release
53         STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIN_CLI_BIN) $(top_builddir)/release
54         @test -f $(MAKENSIS) && $(MAKENSIS) $(top_builddir)/share/setup.nsi || \
55           echo error: could not build $@
57 $(if $(findstring src/,$(MAKECMDGOALS)),$(MAKECMDGOALS), none): FORCE
58         $(MAKE) -C src $(patsubst src/%,%,$@)
60 $(OSX_APP)/Contents/PkgInfo:
61         $(MKDIR_P) $(@D)
62         @echo "APPL????" > $@
64 $(OSX_APP)/Contents/Resources/empty.lproj:
65         $(MKDIR_P) $(@D)
66         @touch $@
68 $(OSX_APP)/Contents/Info.plist: $(OSX_PLIST)
69         $(MKDIR_P) $(@D)
70         $(INSTALL_DATA) $< $@
72 $(OSX_APP)/Contents/Resources/bitcoin.icns: $(OSX_INSTALLER_ICONS)
73         $(MKDIR_P) $(@D)
74         $(INSTALL_DATA) $< $@
76 $(OSX_APP)/Contents/MacOS/Bitcoin-Qt: $(BITCOIN_QT_BIN)
77         $(MKDIR_P) $(@D)
78         STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM)  $< $@
80 OSX_APP_BUILT=$(OSX_APP)/Contents/PkgInfo $(OSX_APP)/Contents/Resources/empty.lproj \
81   $(OSX_APP)/Contents/Resources/bitcoin.icns $(OSX_APP)/Contents/Info.plist \
82   $(OSX_APP)/Contents/MacOS/Bitcoin-Qt
84 if BUILD_DARWIN
85 $(OSX_DMG): $(OSX_APP_BUILT) $(OSX_PACKAGING)
86         $(OSX_DEPLOY_SCRIPT) $(OSX_APP) -add-qt-tr $(OSX_QT_TRANSLATIONS) -translations-dir=$(QT_TRANSLATION_DIR) -dmg -fancy $(OSX_FANCY_PLIST) -verbose 2
88 else
89 $(OSX_DMG): $(OSX_APP_BUILT) $(OSX_PACKAGING)
90         INSTALLNAMETOOL=$(INSTALLNAMETOOL)  OTOOL=$(OTOOL) STRIP=$(STRIP) $(OSX_DEPLOY_SCRIPT) $(OSX_APP) -add-qt-tr $(OSX_QT_TRANSLATIONS) -translations-dir=$(QT_TRANSLATION_DIR) -verbose 2
91         $(MKDIR_P) dist/.background
92         $(INSTALL) contrib/macdeploy/background.png dist/.background
93         $(INSTALL) contrib/macdeploy/DS_Store dist/.DS_Store
94         cd dist; $(LN_S) /Applications Applications
95         $(GENISOIMAGE) -no-cache-inodes -l -probe -V "Bitcoin-Qt" -no-pad -r -apple -o $@ dist
96 endif
98 if TARGET_DARWIN
99 appbundle: $(OSX_APP_BUILT)
100 deploy: $(OSX_DMG)
101 endif
102 if TARGET_WINDOWS
103 deploy: $(BITCOIN_WIN_INSTALLER)
104 endif
106 $(BITCOIN_QT_BIN): FORCE
107         $(MAKE) -C src qt/$(@F)
109 $(BITCOIND_BIN): FORCE
110         $(MAKE) -C src $(@F)
112 $(BITCOIN_CLI_BIN): FORCE
113         $(MAKE) -C src $(@F)
115 if USE_LCOV
117 baseline.info:
118         $(LCOV) -c -i -d $(abs_builddir)/src -o $@
120 baseline_filtered.info: baseline.info
121         $(LCOV) -r $< "/usr/include/*" -o $@
123 leveldb_baseline.info: baseline_filtered.info
124         $(LCOV) -c -i -d $(abs_builddir)/src/leveldb -b $(abs_builddir)/src/leveldb -o $@
126 leveldb_baseline_filtered.info: leveldb_baseline.info
127         $(LCOV) -r $< "/usr/include/*" -o $@
129 baseline_filtered_combined.info: leveldb_baseline_filtered.info baseline_filtered.info
130         $(LCOV) -a leveldb_baseline_filtered.info -a baseline_filtered.info -o $@
132 test_bitcoin.info: baseline_filtered_combined.info
133         $(MAKE) -C src/ check
134         $(LCOV) -c -d $(abs_builddir)/src -t test_bitcoin -o $@
135         $(LCOV) -z -d $(abs_builddir)/src
136         $(LCOV) -z -d $(abs_builddir)/src/leveldb
138 test_bitcoin_filtered.info: test_bitcoin.info
139         $(LCOV) -r $< "/usr/include/*" -o $@
141 block_test.info: test_bitcoin_filtered.info
142         $(MKDIR_P) qa/tmp
143         -@TIMEOUT=15 qa/pull-tester/run-bitcoind-for-test.sh $(JAVA) -jar $(JAVA_COMPARISON_TOOL) qa/tmp/compTool 0
144         $(LCOV) -c -d $(abs_builddir)/src --t BitcoinJBlockTest -o $@
145         $(LCOV) -z -d $(abs_builddir)/src
146         $(LCOV) -z -d $(abs_builddir)/src/leveldb
148 block_test_filtered.info: block_test.info
149         $(LCOV) -r $< "/usr/include/*" -o $@
151 test_bitcoin_coverage.info: baseline_filtered_combined.info test_bitcoin_filtered.info
152         $(LCOV) -a baseline_filtered.info -a leveldb_baseline_filtered.info -a test_bitcoin_filtered.info -o $@
154 total_coverage.info:  baseline_filtered_combined.info test_bitcoin_filtered.info block_test_filtered.info
155         $(LCOV) -a baseline_filtered.info -a leveldb_baseline_filtered.info -a test_bitcoin_filtered.info -a block_test_filtered.info -o $@ | $(GREP) "\%" | $(AWK) '{ print substr($$3,2,50) "/" $$5 }' > coverage_percent.txt
157 test_bitcoin.coverage/.dirstamp:  test_bitcoin_coverage.info
158         $(GENHTML) -s $< -o $(@D)
159         @touch $@
161 total.coverage/.dirstamp: total_coverage.info
162         $(GENHTML) -s $< -o $(@D)
163         @touch $@
165 cov: test_bitcoin.coverage/.dirstamp total.coverage/.dirstamp
167 endif
169 if USE_COMPARISON_TOOL
170 check-local:
171         $(MKDIR_P) qa/tmp
172         @qa/pull-tester/run-bitcoind-for-test.sh $(JAVA) -jar $(JAVA_COMPARISON_TOOL) qa/tmp/compTool $(COMPARISON_TOOL_REORG_TESTS) 2>&1
173 endif
175 EXTRA_DIST = $(top_srcdir)/share/genbuild.sh qa/pull-tester/pull-tester.sh qa/rpc-tests $(DIST_DOCS) $(WINDOWS_PACKAGING) $(OSX_PACKAGING)
177 CLEANFILES = $(OSX_DMG) $(BITCOIN_WIN_INSTALLER)
179 .INTERMEDIATE: $(COVERAGE_INFO)
181 clean-local:
182         rm -rf test_bitcoin.coverage/ total.coverage/ $(OSX_APP)