]> Git Repo - VerusCoin.git/blob - Makefile.am
Merge branch 'beta' into dev
[VerusCoin.git] / Makefile.am
1 ACLOCAL_AMFLAGS = -I build-aux/m4
2 SUBDIRS = src
3 if ENABLE_MAN
4 SUBDIRS += doc/man
5 endif
6 .PHONY: deploy FORCE
7
8 GZIP_ENV="-9n"
9
10 if BUILD_BITCOIN_LIBS
11 pkgconfigdir = $(libdir)/pkgconfig
12 pkgconfig_DATA = libzcashconsensus.pc
13 endif
14
15
16 BITCOIND_BIN=$(top_builddir)/src/zcashd$(EXEEXT)
17 BITCOIN_CLI_BIN=$(top_builddir)/src/zcash-cli$(EXEEXT)
18 #WALLET_UTILITY_BIN=$(top_builddir)/src/wallet-utility$(EXEEXT)
19 BITCOIN_WIN_INSTALLER=$(PACKAGE)-$(PACKAGE_VERSION)-win$(WINDOWS_BITS)-setup$(EXEEXT)
20
21 if TARGET_DARWIN
22 OSX_APP=Bitcoin-Qt.app
23 OSX_DMG=Bitcoin-Core.dmg
24 OSX_BACKGROUND_IMAGE=background.tiff
25 OSX_DEPLOY_SCRIPT=$(top_srcdir)/contrib/macdeploy/macdeployqtplus
26 OSX_FANCY_PLIST=$(top_srcdir)/contrib/macdeploy/fancy.plist
27 OSX_BASE_LPROJ_DIR=$(top_srcdir)/contrib/macdeploy/Base.lproj/InfoPlist.strings
28 OSX_INSTALLER_ICONS=$(top_srcdir)/src/qt/res/icons/bitcoin.icns
29 OSX_PLIST=$(top_srcdir)/share/qt/Info.plist #not installed
30 OSX_QT_TRANSLATIONS = da,de,es,hu,ru,uk,zh_CN,zh_TW
31 endif
32
33 DIST_DOCS = $(wildcard doc/*.md) $(wildcard doc/release-notes/*.md)
34
35 BIN_CHECKS=$(top_srcdir)/contrib/devtools/symbol-check.py \
36         $(top_srcdir)/contrib/devtools/security-check.py
37
38
39 WINDOWS_PACKAGING = $(top_srcdir)/share/pixmaps/bitcoin.ico \
40         $(top_srcdir)/share/pixmaps/nsis-header.bmp \
41         $(top_srcdir)/share/pixmaps/nsis-wizard.bmp
42
43 if TARGET_DARWIN
44 OSX_PACKAGING = $(OSX_DEPLOY_SCRIPT) $(OSX_FANCY_PLIST) $(OSX_INSTALLER_ICONS) $(OSX_BASE_LPROJ_DIR) \
45         $(top_srcdir)/contrib/macdeploy/$(OSX_BACKGROUND_IMAGE) \
46         $(top_srcdir)/contrib/macdeploy/DS_Store \
47         $(top_srcdir)/contrib/macdeploy/detached-sig-apply.sh \
48         $(top_srcdir)/contrib/macdeploy/detached-sig-create.sh
49 endif
50
51 if TARGET_DARWIN
52 COVERAGE_INFO = baseline_filtered_combined.info baseline.info block_test.info \
53         leveldb_baseline.info test_bitcoin_filtered.info total_coverage.info \
54         baseline_filtered.info block_test_filtered.info \
55         leveldb_baseline_filtered.info test_bitcoin_coverage.info test_bitcoin.info
56 #  zcash-gtest.info zcash-gtest_filtered.info zcash-gtest_coverage.info
57 else
58 COVERAGE_INFO = baseline_filtered_combined.info baseline.info block_test.info \
59   leveldb_baseline.info test_bitcoin_filtered.info total_coverage.info \
60   baseline_filtered.info \
61   leveldb_baseline_filtered.info test_bitcoin_coverage.info test_bitcoin.info \
62   #zcash-gtest.info zcash-gtest_filtered.info zcash-gtest_coverage.info
63 endif
64
65 dist-hook:
66         -$(MAKE) -C $(top_distdir)/src/leveldb clean
67         -$(MAKE) -C $(top_distdir)/src/secp256k1 distclean
68         -$(GIT) archive --format=tar HEAD -- src/clientversion.cpp | $(AMTAR) -C $(top_distdir) -xf -
69
70 distcheck-hook:
71         $(MKDIR_P) $(top_distdir)/_build/src/leveldb
72         cp -rf $(top_srcdir)/src/leveldb/* $(top_distdir)/_build/src/leveldb/
73         -$(MAKE) -C $(top_distdir)/_build/src/leveldb clean
74
75 distcleancheck:
76         @:
77
78 $(if $(findstring src/,$(MAKECMDGOALS)),$(MAKECMDGOALS), none): FORCE
79         $(MAKE) -C src $(patsubst src/%,%,$@)
80
81 if TARGET_DARWIN
82
83 $(OSX_APP)/Contents/PkgInfo:
84         $(MKDIR_P) $(@D)
85         @echo "APPL????" > $@
86
87 $(OSX_APP)/Contents/Resources/empty.lproj:
88         $(MKDIR_P) $(@D)
89         @touch $@
90
91 $(OSX_APP)/Contents/Info.plist: $(OSX_PLIST)
92         $(MKDIR_P) $(@D)
93         $(INSTALL_DATA) $< $@
94
95 $(OSX_APP)/Contents/Resources/bitcoin.icns: $(OSX_INSTALLER_ICONS)
96         $(MKDIR_P) $(@D)
97         $(INSTALL_DATA) $< $@
98
99 $(OSX_APP)/Contents/MacOS/Bitcoin-Qt: $(BITCOIN_QT_BIN)
100         $(MKDIR_P) $(@D)
101         STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM)  $< $@
102
103 $(OSX_APP)/Contents/Resources/Base.lproj/InfoPlist.strings: $(OSX_BASE_LPROJ_DIR)
104         $(MKDIR_P) $(@D)
105         $(INSTALL_DATA) $< $@
106
107 OSX_APP_BUILT=$(OSX_APP)/Contents/PkgInfo $(OSX_APP)/Contents/Resources/empty.lproj \
108         $(OSX_APP)/Contents/Resources/bitcoin.icns $(OSX_APP)/Contents/Info.plist \
109         $(OSX_APP)/Contents/MacOS/Bitcoin-Qt $(OSX_APP)/Contents/Resources/Base.lproj/InfoPlist.strings
110
111 endif
112
113 if BUILD_DARWIN
114 $(OSX_DMG): $(OSX_APP_BUILT) $(OSX_PACKAGING)
115         $(OSX_DEPLOY_SCRIPT) $(OSX_APP) -add-qt-tr $(OSX_QT_TRANSLATIONS) -translations-dir=$(QT_TRANSLATION_DIR) -dmg -fancy $(OSX_FANCY_PLIST) -verbose 2
116 deploydir: $(OSX_DMG)
117 else
118 APP_DIST_DIR=$(top_builddir)/dist
119 APP_DIST_EXTRAS=$(APP_DIST_DIR)/.background/$(OSX_BACKGROUND_IMAGE) $(APP_DIST_DIR)/.DS_Store $(APP_DIST_DIR)/Applications
120 endif
121
122 if TARGET_DARWIN
123 $(APP_DIST_DIR)/Applications:
124         @rm -f $@
125         @cd $(@D); $(LN_S) /Applications $(@F)
126
127 $(APP_DIST_EXTRAS): $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Bitcoin-Qt
128
129 $(OSX_DMG): $(APP_DIST_EXTRAS)
130         $(GENISOIMAGE) -no-cache-inodes -D -l -probe -V "Bitcoin-Core" -no-pad -r -apple -o $@ dist
131
132 $(APP_DIST_DIR)/.background/$(OSX_BACKGROUND_IMAGE): contrib/macdeploy/$(OSX_BACKGROUND_IMAGE)
133         $(MKDIR_P) $(@D)
134         $(INSTALL) $< $@
135 $(APP_DIST_DIR)/.DS_Store: contrib/macdeploy/DS_Store
136         $(INSTALL) $< $@
137
138 $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Bitcoin-Qt: $(OSX_APP_BUILT) $(OSX_PACKAGING)
139         INSTALLNAMETOOL=$(INSTALLNAMETOOL)  OTOOL=$(OTOOL) STRIP=$(STRIP) $(OSX_DEPLOY_SCRIPT) $(OSX_APP) -translations-dir=$(QT_TRANSLATION_DIR) -add-qt-tr $(OSX_QT_TRANSLATIONS) -verbose 2
140
141 deploydir: $(APP_DIST_EXTRAS)
142 endif
143
144 if TARGET_DARWIN
145 appbundle: $(OSX_APP_BUILT)
146 deploy: $(OSX_DMG)
147 endif
148
149 if TARGET_WINDOWS
150 deploy: $(BITCOIN_WIN_INSTALLER)
151 endif
152
153 $(BITCOIND_BIN): FORCE
154         $(MAKE) -C src $(@F)
155
156 $(BITCOIN_CLI_BIN): FORCE
157         $(MAKE) -C src $(@F)
158
159 #$(WALLET_UTILITY_BIN): FORCE
160 #       $(MAKE) -C src $(@F)
161
162 if USE_LCOV
163
164 baseline.info:
165         $(LCOV) -c -i -d $(abs_builddir)/src -o $@
166
167 if BUILD_DARWIN
168 baseline_filtered.info: baseline.info
169         $(LCOV) -r $< "/usr/include/*" \
170         "$(abs_builddir)/depends/$(BUILD)/include/*.h" \
171         "$(abs_builddir)/depends/$(BUILD)/include/boost/*" \
172         "$(abs_builddir)/depends/$(BUILD)/include/gmock/*" \
173         "$(abs_builddir)/depends/$(BUILD)/include/gtest/*" \
174         "$(abs_builddir)/src/gtest/*" \
175         "$(abs_builddir)/src/test/*" \
176         "$(abs_builddir)/src/wallet/gtest/*" \
177         "$(abs_builddir)/src/wallet/test/*" \
178         -o $@
179 else
180 baseline_filtered.info: baseline.info
181         $(LCOV) -r $< "/usr/include/*" \
182         "$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/*.h" \
183         "$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/boost/*" \
184         "$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/gmock/*" \
185         "$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/gtest/*" \
186         "$(abs_builddir)/src/gtest/*" \
187         "$(abs_builddir)/src/test/*" \
188         "$(abs_builddir)/src/wallet/gtest/*" \
189         "$(abs_builddir)/src/wallet/test/*" \
190         -o $@
191 endif
192
193 leveldb_baseline.info: baseline_filtered.info
194         $(LCOV) -c -i -d $(abs_builddir)/src/leveldb -b $(abs_builddir)/src/leveldb -o $@
195
196 if BUILD_DARWIN
197 leveldb_baseline_filtered.info: leveldb_baseline.info
198         $(LCOV) -r $< "/usr/include/*" \
199         "$(abs_builddir)/depends/$(BUILD)/include/*.h" \
200         "$(abs_builddir)/depends/$(BUILD)/include/boost/*" \
201         "$(abs_builddir)/depends/$(BUILD)/include/gmock/*" \
202         "$(abs_builddir)/depends/$(BUILD)/include/gtest/*" \
203         "$(abs_builddir)/src/gtest/*" \
204         "$(abs_builddir)/src/test/*" \
205         "$(abs_builddir)/src/wallet/gtest/*" \
206         "$(abs_builddir)/src/wallet/test/*" \
207         -o $@
208 else
209 leveldb_baseline_filtered.info: leveldb_baseline.info
210         $(LCOV) -r $< "/usr/include/*" \
211         "$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/*.h" \
212         "$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/boost/*" \
213         "$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/gmock/*" \
214         "$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/gtest/*" \
215         "$(abs_builddir)/src/gtest/*" \
216         "$(abs_builddir)/src/test/*" \
217         "$(abs_builddir)/src/wallet/gtest/*" \
218         "$(abs_builddir)/src/wallet/test/*" \
219         -o $@
220 endif
221
222 baseline_filtered_combined.info: leveldb_baseline_filtered.info baseline_filtered.info
223         $(LCOV) -a leveldb_baseline_filtered.info -a baseline_filtered.info -o $@
224
225 test_bitcoin.info: baseline_filtered_combined.info
226         $(MAKE) -C src/ bitcoin_test_check
227         $(LCOV) -c -d $(abs_builddir)/src -t test_bitcoin -o $@
228         $(LCOV) -z -d $(abs_builddir)/src
229         $(LCOV) -z -d $(abs_builddir)/src/leveldb
230
231 if BUILD_DARWIN
232 test_bitcoin_filtered.info: test_bitcoin.info
233         $(LCOV) -r $< "/usr/include/*" \
234         "$(abs_builddir)/depends/$(BUILD)/include/*.h" \
235         "$(abs_builddir)/depends/$(BUILD)/include/boost/*" \
236         "$(abs_builddir)/depends/$(BUILD)/include/gmock/*" \
237         "$(abs_builddir)/depends/$(BUILD)/include/gtest/*" \
238         "$(abs_builddir)/src/gtest/*" \
239         "$(abs_builddir)/src/test/*" \
240         "$(abs_builddir)/src/wallet/gtest/*" \
241         "$(abs_builddir)/src/wallet/test/*" \
242         -o $@
243 else
244 test_bitcoin_filtered.info: test_bitcoin.info
245         $(LCOV) -r $< "/usr/include/*" \
246         "$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/*.h" \
247         "$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/boost/*" \
248         "$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/gmock/*" \
249         "$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/gtest/*" \
250         "$(abs_builddir)/src/gtest/*" \
251         "$(abs_builddir)/src/test/*" \
252         "$(abs_builddir)/src/wallet/gtest/*" \
253         "$(abs_builddir)/src/wallet/test/*" \
254         -o $@
255 endif
256
257
258 block_test.info: test_bitcoin_filtered.info
259         $(MKDIR_P) qa/tmp
260         -@TIMEOUT=15 qa/pull-tester/run-bitcoind-for-test.sh $(JAVA) -jar $(JAVA_COMPARISON_TOOL) qa/tmp/compTool 0
261         $(LCOV) -c -d $(abs_builddir)/src --t BitcoinJBlockTest -o $@
262         $(LCOV) -z -d $(abs_builddir)/src
263         $(LCOV) -z -d $(abs_builddir)/src/leveldb
264
265 if BUILD_DARWIN
266 block_test_filtered.info: block_test.info
267         $(LCOV) -r $< "/usr/include/*" \
268         "$(abs_builddir)/depends/$(BUILD)/include/*.h" \
269         "$(abs_builddir)/depends/$(BUILD)/include/boost/*" \
270         "$(abs_builddir)/depends/$(BUILD)/include/gmock/*" \
271         "$(abs_builddir)/depends/$(BUILD)/include/gtest/*" \
272         "$(abs_builddir)/src/gtest/*" \
273         "$(abs_builddir)/src/test/*" \
274         "$(abs_builddir)/src/wallet/gtest/*" \
275         "$(abs_builddir)/src/wallet/test/*" \
276         -o $@
277 else
278 block_test_filtered.info: block_test.info
279         $(LCOV) -r $< "/usr/include/*" \
280         "$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/*.h" \
281         "$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/boost/*" \
282         "$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/gmock/*" \
283         "$(abs_builddir)/depends/x86_64-unknown-linux-gnu/include/gtest/*" \
284         "$(abs_builddir)/src/gtest/*" \
285         "$(abs_builddir)/src/test/*" \
286         "$(abs_builddir)/src/wallet/gtest/*" \
287         "$(abs_builddir)/src/wallet/test/*" \
288         -o $@
289 endif
290
291
292 test_bitcoin_coverage.info: baseline_filtered_combined.info test_bitcoin_filtered.info
293         $(LCOV) -a baseline_filtered.info -a leveldb_baseline_filtered.info -a test_bitcoin_filtered.info -o $@
294
295 if ! BUILD_DARWIN
296 zcash-gtest_coverage.info: baseline_filtered_combined.info zcash-gtest_filtered.info
297         $(LCOV) -a baseline_filtered.info -a leveldb_baseline_filtered.info -a zcash-gtest_filtered.info -o $@
298 endif
299
300 if BUILD_DARWIN
301 total_coverage.info:  baseline_filtered_combined.info test_bitcoin_filtered.info zcash-gtest_filtered.info block_test_filtered.info
302         $(LCOV) -a baseline_filtered.info -a leveldb_baseline_filtered.info -a test_bitcoin_filtered.info -a zcash-gtest_filtered.info -a block_test_filtered.info -o $@ | $(GREP) "\%" | $(AWK) '{ print substr($$3,2,50) "/" $$5 }' > coverage_percent.txt
303 else
304 total_coverage.info:  baseline_filtered_combined.info test_bitcoin_filtered.info zcash-gtest_filtered.info block_test_filtered.info
305         $(LCOV) -a baseline_filtered.info -a leveldb_baseline_filtered.info -a test_bitcoin_filtered.info -a zcash-gtest_filtered.info -a block_test_filtered.info -o $@ | $(GREP) "\%" | $(AWK) '{ print substr($$3,2,50) "/" $$5 }' > coverage_percent.txt
306 endif
307
308
309 test_bitcoin.coverage/.dirstamp:  test_bitcoin_coverage.info
310         $(GENHTML) -s $< -o $(@D)
311         @touch $@
312
313 if TARGET_DARWIN
314 zcash-gtest.coverage/.dirstamp:  zcash-gtest_coverage.info
315         $(GENHTML) -s $< -o $(@D)
316         @touch $@
317 cov-zcash: zcash-gtest.coverage/.dirstamp
318 endif
319
320 total.coverage/.dirstamp: total_coverage.info
321         $(GENHTML) -s $< -o $(@D)
322         @touch $@
323
324 if BUILD_DARWIN
325 cov: test_bitcoin.coverage/.dirstamp cov-zcash total.coverage/.dirstamp
326 else
327 cov: test_bitcoin.coverage/.dirstamp cov-zcash total.coverage/.dirstamp
328 endif
329
330 endif
331
332 dist_bin_SCRIPTS = zcutil/fetch-params.sh
333 dist_noinst_SCRIPTS = autogen.sh zcutil/build-debian-package.sh zcutil/build.sh
334
335 EXTRA_DIST = $(top_srcdir)/share/genbuild.sh qa/pull-tester/rpc-tests.sh qa/pull-tester/run-bitcoin-cli qa/rpc-tests qa/zcash $(DIST_DOCS) $(BIN_CHECKS)
336
337 install-exec-hook:
338         mv $(DESTDIR)$(bindir)/fetch-params.sh $(DESTDIR)$(bindir)/zcash-fetch-params
339
340 .INTERMEDIATE: $(COVERAGE_INFO)
341
342 DISTCHECK_CONFIGURE_FLAGS = --enable-man
343
344 clean-local:
345         rm -rf test_bitcoin.coverage/ zcash-gtest.coverage/ total.coverage/
This page took 0.041091 seconds and 4 git commands to generate.