checkpoints: make checkpoints a member of CChainParams
[bitcoinplatinum.git] / Makefile.am
blobc59648fd02d46db7fa15fbf256e1281a3558b2a3
1 ACLOCAL_AMFLAGS = -I build-aux/m4
2 SUBDIRS = src
3 .PHONY: deploy FORCE
5 GZIP_ENV="-9n"
7 if BUILD_BITCOIN_LIBS
8 pkgconfigdir = $(libdir)/pkgconfig
9 pkgconfig_DATA = libbitcoinconsensus.pc
10 endif
12 BITCOIND_BIN=$(top_builddir)/src/bitcoind$(EXEEXT)
13 BITCOIN_QT_BIN=$(top_builddir)/src/qt/bitcoin-qt$(EXEEXT)
14 BITCOIN_CLI_BIN=$(top_builddir)/src/bitcoin-cli$(EXEEXT)
15 BITCOIN_WIN_INSTALLER=$(PACKAGE)-$(PACKAGE_VERSION)-win$(WINDOWS_BITS)-setup$(EXEEXT)
17 OSX_APP=Bitcoin-Qt.app
18 OSX_DMG=Bitcoin-Qt.dmg
19 OSX_BACKGROUND_IMAGE=background.tiff
20 OSX_DEPLOY_SCRIPT=$(top_srcdir)/contrib/macdeploy/macdeployqtplus
21 OSX_FANCY_PLIST=$(top_srcdir)/contrib/macdeploy/fancy.plist
22 OSX_INSTALLER_ICONS=$(top_srcdir)/src/qt/res/icons/bitcoin.icns
23 OSX_PLIST=$(top_srcdir)/share/qt/Info.plist #not installed
24 OSX_QT_TRANSLATIONS = da,de,es,hu,ru,uk,zh_CN,zh_TW
26 DIST_DOCS = $(wildcard doc/*.md) $(wildcard doc/release-notes/*.md)
28 WINDOWS_PACKAGING = $(top_srcdir)/share/pixmaps/bitcoin.ico \
29   $(top_srcdir)/share/pixmaps/nsis-header.bmp \
30   $(top_srcdir)/share/pixmaps/nsis-wizard.bmp \
31   $(top_srcdir)/doc/README_windows.txt
33 OSX_PACKAGING = $(OSX_DEPLOY_SCRIPT) $(OSX_FANCY_PLIST) $(OSX_INSTALLER_ICONS) \
34   $(top_srcdir)/contrib/macdeploy/$(OSX_BACKGROUND_IMAGE) \
35   $(top_srcdir)/contrib/macdeploy/DS_Store \
36   $(top_srcdir)/contrib/macdeploy/detached-sig-apply.sh \
37   $(top_srcdir)/contrib/macdeploy/detached-sig-create.sh
39 COVERAGE_INFO = baseline_filtered_combined.info baseline.info block_test.info \
40   leveldb_baseline.info test_bitcoin_filtered.info total_coverage.info \
41   baseline_filtered.info block_test_filtered.info \
42   leveldb_baseline_filtered.info test_bitcoin_coverage.info test_bitcoin.info
44 dist-hook:
45         -$(MAKE) -C $(top_distdir)/src/leveldb clean
46         -$(MAKE) -C $(top_distdir)/src/secp256k1 distclean
47         -$(GIT) archive --format=tar HEAD -- src/clientversion.cpp | $(AMTAR) -C $(top_distdir) -xf -
49 distcheck-hook:
50         $(MKDIR_P) $(top_distdir)/_build/src/leveldb
51         cp -rf $(top_srcdir)/src/leveldb/* $(top_distdir)/_build/src/leveldb/
52         -$(MAKE) -C $(top_distdir)/_build/src/leveldb clean
54 distcleancheck:
55         @:
57 $(BITCOIN_WIN_INSTALLER): all-recursive
58         $(MKDIR_P) $(top_builddir)/release
59         STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIND_BIN) $(top_builddir)/release
60         STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIN_QT_BIN) $(top_builddir)/release
61         STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIN_CLI_BIN) $(top_builddir)/release
62         @test -f $(MAKENSIS) && $(MAKENSIS) $(top_builddir)/share/setup.nsi || \
63           echo error: could not build $@
65 $(if $(findstring src/,$(MAKECMDGOALS)),$(MAKECMDGOALS), none): FORCE
66         $(MAKE) -C src $(patsubst src/%,%,$@)
68 $(OSX_APP)/Contents/PkgInfo:
69         $(MKDIR_P) $(@D)
70         @echo "APPL????" > $@
72 $(OSX_APP)/Contents/Resources/empty.lproj:
73         $(MKDIR_P) $(@D)
74         @touch $@
76 $(OSX_APP)/Contents/Info.plist: $(OSX_PLIST)
77         $(MKDIR_P) $(@D)
78         $(INSTALL_DATA) $< $@
80 $(OSX_APP)/Contents/Resources/bitcoin.icns: $(OSX_INSTALLER_ICONS)
81         $(MKDIR_P) $(@D)
82         $(INSTALL_DATA) $< $@
84 $(OSX_APP)/Contents/MacOS/Bitcoin-Qt: $(BITCOIN_QT_BIN)
85         $(MKDIR_P) $(@D)
86         STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM)  $< $@
88 OSX_APP_BUILT=$(OSX_APP)/Contents/PkgInfo $(OSX_APP)/Contents/Resources/empty.lproj \
89   $(OSX_APP)/Contents/Resources/bitcoin.icns $(OSX_APP)/Contents/Info.plist \
90   $(OSX_APP)/Contents/MacOS/Bitcoin-Qt
92 if BUILD_DARWIN
93 $(OSX_DMG): $(OSX_APP_BUILT) $(OSX_PACKAGING)
94         $(OSX_DEPLOY_SCRIPT) $(OSX_APP) -add-qt-tr $(OSX_QT_TRANSLATIONS) -translations-dir=$(QT_TRANSLATION_DIR) -dmg -fancy $(OSX_FANCY_PLIST) -verbose 2
96 deploydir: $(OSX_DMG)
97 else
98 APP_DIST_DIR=$(top_builddir)/dist
99 APP_DIST_EXTRAS=$(APP_DIST_DIR)/.background/$(OSX_BACKGROUND_IMAGE) $(APP_DIST_DIR)/.DS_Store $(APP_DIST_DIR)/Applications
101 $(APP_DIST_DIR)/Applications:
102         @rm -f $@
103         @cd $(@D); $(LN_S) /Applications $(@F)
105 $(APP_DIST_EXTRAS): $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Bitcoin-Qt
107 $(OSX_DMG): $(APP_DIST_EXTRAS)
108         $(GENISOIMAGE) -no-cache-inodes -D -l -probe -V "Bitcoin-Qt" -no-pad -r -apple -o $@ dist
110 $(APP_DIST_DIR)/.background/$(OSX_BACKGROUND_IMAGE): contrib/macdeploy/$(OSX_BACKGROUND_IMAGE)
111         $(MKDIR_P) $(@D)
112         $(INSTALL) $< $@
113 $(APP_DIST_DIR)/.DS_Store: contrib/macdeploy/DS_Store
114         $(INSTALL) $< $@
116 $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Bitcoin-Qt: $(OSX_APP_BUILT) $(OSX_PACKAGING)
117         INSTALLNAMETOOL=$(INSTALLNAMETOOL)  OTOOL=$(OTOOL) STRIP=$(STRIP) $(OSX_DEPLOY_SCRIPT) $(OSX_APP) -translations-dir=$(QT_TRANSLATION_DIR) -add-qt-tr $(OSX_QT_TRANSLATIONS) -verbose 2
119 deploydir: $(APP_DIST_EXTRAS)
120 endif
122 if TARGET_DARWIN
123 appbundle: $(OSX_APP_BUILT)
124 deploy: $(OSX_DMG)
125 endif
126 if TARGET_WINDOWS
127 deploy: $(BITCOIN_WIN_INSTALLER)
128 endif
130 $(BITCOIN_QT_BIN): FORCE
131         $(MAKE) -C src qt/$(@F)
133 $(BITCOIND_BIN): FORCE
134         $(MAKE) -C src $(@F)
136 $(BITCOIN_CLI_BIN): FORCE
137         $(MAKE) -C src $(@F)
139 if USE_LCOV
141 baseline.info:
142         $(LCOV) -c -i -d $(abs_builddir)/src -o $@
144 baseline_filtered.info: baseline.info
145         $(LCOV) -r $< "/usr/include/*" -o $@
147 leveldb_baseline.info: baseline_filtered.info
148         $(LCOV) -c -i -d $(abs_builddir)/src/leveldb -b $(abs_builddir)/src/leveldb -o $@
150 leveldb_baseline_filtered.info: leveldb_baseline.info
151         $(LCOV) -r $< "/usr/include/*" -o $@
153 baseline_filtered_combined.info: leveldb_baseline_filtered.info baseline_filtered.info
154         $(LCOV) -a leveldb_baseline_filtered.info -a baseline_filtered.info -o $@
156 test_bitcoin.info: baseline_filtered_combined.info
157         $(MAKE) -C src/ check
158         $(LCOV) -c -d $(abs_builddir)/src -t test_bitcoin -o $@
159         $(LCOV) -z -d $(abs_builddir)/src
160         $(LCOV) -z -d $(abs_builddir)/src/leveldb
162 test_bitcoin_filtered.info: test_bitcoin.info
163         $(LCOV) -r $< "/usr/include/*" -o $@
165 block_test.info: test_bitcoin_filtered.info
166         $(MKDIR_P) qa/tmp
167         -@TIMEOUT=15 qa/pull-tester/run-bitcoind-for-test.sh $(JAVA) -jar $(JAVA_COMPARISON_TOOL) qa/tmp/compTool 0
168         $(LCOV) -c -d $(abs_builddir)/src --t BitcoinJBlockTest -o $@
169         $(LCOV) -z -d $(abs_builddir)/src
170         $(LCOV) -z -d $(abs_builddir)/src/leveldb
172 block_test_filtered.info: block_test.info
173         $(LCOV) -r $< "/usr/include/*" -o $@
175 test_bitcoin_coverage.info: baseline_filtered_combined.info test_bitcoin_filtered.info
176         $(LCOV) -a baseline_filtered.info -a leveldb_baseline_filtered.info -a test_bitcoin_filtered.info -o $@
178 total_coverage.info:  baseline_filtered_combined.info test_bitcoin_filtered.info block_test_filtered.info
179         $(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
181 test_bitcoin.coverage/.dirstamp:  test_bitcoin_coverage.info
182         $(GENHTML) -s $< -o $(@D)
183         @touch $@
185 total.coverage/.dirstamp: total_coverage.info
186         $(GENHTML) -s $< -o $(@D)
187         @touch $@
189 cov: test_bitcoin.coverage/.dirstamp total.coverage/.dirstamp
191 endif
193 if USE_COMPARISON_TOOL
194 check-local:
195         $(MKDIR_P) qa/tmp
196         @qa/pull-tester/run-bitcoind-for-test.sh $(JAVA) -jar $(JAVA_COMPARISON_TOOL) qa/tmp/compTool $(COMPARISON_TOOL_REORG_TESTS) 2>&1
197 endif
199 EXTRA_DIST = $(top_srcdir)/share/genbuild.sh qa/pull-tester/rpc-tests.sh qa/pull-tester/run-bitcoin-cli qa/rpc-tests $(DIST_DOCS) $(WINDOWS_PACKAGING) $(OSX_PACKAGING)
201 CLEANFILES = $(OSX_DMG) $(BITCOIN_WIN_INSTALLER)
203 .INTERMEDIATE: $(COVERAGE_INFO)
205 clean-local:
206         rm -rf test_bitcoin.coverage/ total.coverage/ $(OSX_APP)