Makefile.am 11 KB

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