]> Git Repo - VerusCoin.git/blob - Makefile.am
Merge pull request #5334
[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 = libbitcoinconsensus.pc
10 endif
11
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)
16
17 OSX_APP=Bitcoin-Qt.app
18 OSX_DMG=Bitcoin-Qt.dmg
19 OSX_DEPLOY_SCRIPT=$(top_srcdir)/contrib/macdeploy/macdeployqtplus
20 OSX_FANCY_PLIST=$(top_srcdir)/contrib/macdeploy/fancy.plist
21 OSX_INSTALLER_ICONS=$(top_srcdir)/src/qt/res/icons/bitcoin.icns
22 OSX_PLIST=$(top_srcdir)/share/qt/Info.plist #not installed
23 OSX_QT_TRANSLATIONS = da,de,es,hu,ru,uk,zh_CN,zh_TW
24
25 DIST_DOCS = $(wildcard doc/*.md) $(wildcard doc/release-notes/*.md)
26
27 WINDOWS_PACKAGING = $(top_srcdir)/share/pixmaps/bitcoin.ico \
28   $(top_srcdir)/share/pixmaps/nsis-header.bmp \
29   $(top_srcdir)/share/pixmaps/nsis-wizard.bmp \
30   $(top_srcdir)/doc/README_windows.txt
31
32 OSX_PACKAGING = $(OSX_DEPLOY_SCRIPT) $(OSX_FANCY_PLIST) $(OSX_INSTALLER_ICONS) \
33   $(top_srcdir)/contrib/macdeploy/background.png \
34   $(top_srcdir)/contrib/macdeploy/DS_Store \
35   $(top_srcdir)/contrib/macdeploy/detached-sig-apply.sh \
36   $(top_srcdir)/contrib/macdeploy/detached-sig-create.sh
37
38 COVERAGE_INFO = baseline_filtered_combined.info baseline.info block_test.info \
39   leveldb_baseline.info test_bitcoin_filtered.info total_coverage.info \
40   baseline_filtered.info block_test_filtered.info \
41   leveldb_baseline_filtered.info test_bitcoin_coverage.info test_bitcoin.info
42
43 dist-hook:
44         -$(MAKE) -C $(top_distdir)/src/leveldb clean
45         -$(MAKE) -C $(top_distdir)/src/secp256k1 distclean
46         -$(GIT) archive --format=tar HEAD -- src/clientversion.cpp | $(AMTAR) -C $(top_distdir) -xf -
47
48 distcheck-hook:
49         $(MKDIR_P) $(top_distdir)/_build/src/leveldb
50         cp -rf $(top_srcdir)/src/leveldb/* $(top_distdir)/_build/src/leveldb/
51         -$(MAKE) -C $(top_distdir)/_build/src/leveldb clean
52
53 distcleancheck:
54         @:
55
56 $(BITCOIN_WIN_INSTALLER): all-recursive
57         $(MKDIR_P) $(top_builddir)/release
58         STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIND_BIN) $(top_builddir)/release
59         STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIN_QT_BIN) $(top_builddir)/release
60         STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIN_CLI_BIN) $(top_builddir)/release
61         @test -f $(MAKENSIS) && $(MAKENSIS) $(top_builddir)/share/setup.nsi || \
62           echo error: could not build $@
63
64 $(if $(findstring src/,$(MAKECMDGOALS)),$(MAKECMDGOALS), none): FORCE
65         $(MAKE) -C src $(patsubst src/%,%,$@)
66
67 $(OSX_APP)/Contents/PkgInfo:
68         $(MKDIR_P) $(@D)
69         @echo "APPL????" > $@
70
71 $(OSX_APP)/Contents/Resources/empty.lproj:
72         $(MKDIR_P) $(@D)
73         @touch $@
74
75 $(OSX_APP)/Contents/Info.plist: $(OSX_PLIST)
76         $(MKDIR_P) $(@D)
77         $(INSTALL_DATA) $< $@
78
79 $(OSX_APP)/Contents/Resources/bitcoin.icns: $(OSX_INSTALLER_ICONS)
80         $(MKDIR_P) $(@D)
81         $(INSTALL_DATA) $< $@
82
83 $(OSX_APP)/Contents/MacOS/Bitcoin-Qt: $(BITCOIN_QT_BIN)
84         $(MKDIR_P) $(@D)
85         STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM)  $< $@
86
87 OSX_APP_BUILT=$(OSX_APP)/Contents/PkgInfo $(OSX_APP)/Contents/Resources/empty.lproj \
88   $(OSX_APP)/Contents/Resources/bitcoin.icns $(OSX_APP)/Contents/Info.plist \
89   $(OSX_APP)/Contents/MacOS/Bitcoin-Qt
90
91 if BUILD_DARWIN
92 $(OSX_DMG): $(OSX_APP_BUILT) $(OSX_PACKAGING)
93         $(OSX_DEPLOY_SCRIPT) $(OSX_APP) -add-qt-tr $(OSX_QT_TRANSLATIONS) -translations-dir=$(QT_TRANSLATION_DIR) -dmg -fancy $(OSX_FANCY_PLIST) -verbose 2
94
95 deploydir: $(OSX_DMG)
96 else
97 APP_DIST_DIR=$(top_builddir)/dist
98 APP_DIST_EXTRAS=$(APP_DIST_DIR)/.background/background.png $(APP_DIST_DIR)/.DS_Store $(APP_DIST_DIR)/Applications
99
100 $(APP_DIST_DIR)/Applications:
101         @rm -f $@
102         @cd $(@D); $(LN_S) /Applications $(@F)
103
104 $(APP_DIST_EXTRAS): $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Bitcoin-Qt
105
106 $(OSX_DMG): $(APP_DIST_EXTRAS)
107         $(GENISOIMAGE) -no-cache-inodes -D -l -probe -V "Bitcoin-Qt" -no-pad -r -apple -o $@ dist
108
109 $(APP_DIST_DIR)/.background/background.png:
110         $(MKDIR_P) $(@D)
111         $(INSTALL) $(top_srcdir)/contrib/macdeploy/background.png $@
112 $(APP_DIST_DIR)/.DS_Store:
113         $(INSTALL) $(top_srcdir)/contrib/macdeploy/DS_Store $@
114
115 $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Bitcoin-Qt: $(OSX_APP_BUILT) $(OSX_PACKAGING)
116         INSTALLNAMETOOL=$(INSTALLNAMETOOL)  OTOOL=$(OTOOL) STRIP=$(STRIP) $(OSX_DEPLOY_SCRIPT) $(OSX_APP) -translations-dir=$(QT_TRANSLATION_DIR) -add-qt-tr $(OSX_QT_TRANSLATIONS) -verbose 2
117
118 deploydir: $(APP_DIST_EXTRAS)
119 endif
120
121 if TARGET_DARWIN
122 appbundle: $(OSX_APP_BUILT)
123 deploy: $(OSX_DMG)
124 endif
125 if TARGET_WINDOWS
126 deploy: $(BITCOIN_WIN_INSTALLER)
127 endif
128
129 $(BITCOIN_QT_BIN): FORCE
130         $(MAKE) -C src qt/$(@F)
131
132 $(BITCOIND_BIN): FORCE
133         $(MAKE) -C src $(@F)
134
135 $(BITCOIN_CLI_BIN): FORCE
136         $(MAKE) -C src $(@F)
137
138 if USE_LCOV
139
140 baseline.info:
141         $(LCOV) -c -i -d $(abs_builddir)/src -o $@
142
143 baseline_filtered.info: baseline.info
144         $(LCOV) -r $< "/usr/include/*" -o $@
145
146 leveldb_baseline.info: baseline_filtered.info
147         $(LCOV) -c -i -d $(abs_builddir)/src/leveldb -b $(abs_builddir)/src/leveldb -o $@
148
149 leveldb_baseline_filtered.info: leveldb_baseline.info
150         $(LCOV) -r $< "/usr/include/*" -o $@
151
152 baseline_filtered_combined.info: leveldb_baseline_filtered.info baseline_filtered.info
153         $(LCOV) -a leveldb_baseline_filtered.info -a baseline_filtered.info -o $@
154
155 test_bitcoin.info: baseline_filtered_combined.info
156         $(MAKE) -C src/ check
157         $(LCOV) -c -d $(abs_builddir)/src -t test_bitcoin -o $@
158         $(LCOV) -z -d $(abs_builddir)/src
159         $(LCOV) -z -d $(abs_builddir)/src/leveldb
160
161 test_bitcoin_filtered.info: test_bitcoin.info
162         $(LCOV) -r $< "/usr/include/*" -o $@
163
164 block_test.info: test_bitcoin_filtered.info
165         $(MKDIR_P) qa/tmp
166         -@TIMEOUT=15 qa/pull-tester/run-bitcoind-for-test.sh $(JAVA) -jar $(JAVA_COMPARISON_TOOL) qa/tmp/compTool 0
167         $(LCOV) -c -d $(abs_builddir)/src --t BitcoinJBlockTest -o $@
168         $(LCOV) -z -d $(abs_builddir)/src
169         $(LCOV) -z -d $(abs_builddir)/src/leveldb
170
171 block_test_filtered.info: block_test.info
172         $(LCOV) -r $< "/usr/include/*" -o $@
173
174 test_bitcoin_coverage.info: baseline_filtered_combined.info test_bitcoin_filtered.info
175         $(LCOV) -a baseline_filtered.info -a leveldb_baseline_filtered.info -a test_bitcoin_filtered.info -o $@
176
177 total_coverage.info:  baseline_filtered_combined.info test_bitcoin_filtered.info block_test_filtered.info
178         $(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
179
180 test_bitcoin.coverage/.dirstamp:  test_bitcoin_coverage.info
181         $(GENHTML) -s $< -o $(@D)
182         @touch $@
183
184 total.coverage/.dirstamp: total_coverage.info
185         $(GENHTML) -s $< -o $(@D)
186         @touch $@
187
188 cov: test_bitcoin.coverage/.dirstamp total.coverage/.dirstamp
189
190 endif
191
192 if USE_COMPARISON_TOOL
193 check-local:
194         $(MKDIR_P) qa/tmp
195         @qa/pull-tester/run-bitcoind-for-test.sh $(JAVA) -jar $(JAVA_COMPARISON_TOOL) qa/tmp/compTool $(COMPARISON_TOOL_REORG_TESTS) 2>&1
196 endif
197
198 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)
199
200 CLEANFILES = $(OSX_DMG) $(BITCOIN_WIN_INSTALLER)
201
202 .INTERMEDIATE: $(COVERAGE_INFO)
203
204 clean-local:
205         rm -rf test_bitcoin.coverage/ total.coverage/ $(OSX_APP)
This page took 0.035351 seconds and 4 git commands to generate.