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