You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Makefile.am 7.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  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 = libbitcoinconsensus.pc
  8. endif
  9. BITCOIND_BIN=$(top_builddir)/src/bitcoind$(EXEEXT)
  10. BITCOIN_QT_BIN=$(top_builddir)/src/qt/bitcoin-qt$(EXEEXT)
  11. BITCOIN_CLI_BIN=$(top_builddir)/src/bitcoin-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. WINDOWS_PACKAGING = $(top_srcdir)/share/pixmaps/bitcoin.ico \
  24. $(top_srcdir)/share/pixmaps/nsis-header.bmp \
  25. $(top_srcdir)/share/pixmaps/nsis-wizard.bmp \
  26. $(top_srcdir)/doc/README_windows.txt
  27. OSX_PACKAGING = $(OSX_DEPLOY_SCRIPT) $(OSX_FANCY_PLIST) $(OSX_INSTALLER_ICONS) $(OSX_BASE_LPROJ_DIR) \
  28. $(top_srcdir)/contrib/macdeploy/$(OSX_BACKGROUND_IMAGE) \
  29. $(top_srcdir)/contrib/macdeploy/DS_Store \
  30. $(top_srcdir)/contrib/macdeploy/detached-sig-apply.sh \
  31. $(top_srcdir)/contrib/macdeploy/detached-sig-create.sh
  32. COVERAGE_INFO = baseline_filtered_combined.info baseline.info block_test.info \
  33. leveldb_baseline.info test_bitcoin_filtered.info total_coverage.info \
  34. baseline_filtered.info block_test_filtered.info rpc_test.info rpc_test_filtered.info \
  35. leveldb_baseline_filtered.info test_bitcoin_coverage.info test_bitcoin.info
  36. dist-hook:
  37. -$(MAKE) -C $(top_distdir)/src/leveldb clean
  38. -$(MAKE) -C $(top_distdir)/src/secp256k1 distclean
  39. -$(GIT) archive --format=tar HEAD -- src/clientversion.cpp | $(AMTAR) -C $(top_distdir) -xf -
  40. distcheck-hook:
  41. $(MKDIR_P) $(top_distdir)/_build/src/leveldb
  42. cp -rf $(top_srcdir)/src/leveldb/* $(top_distdir)/_build/src/leveldb/
  43. -$(MAKE) -C $(top_distdir)/_build/src/leveldb clean
  44. distcleancheck:
  45. @:
  46. $(BITCOIN_WIN_INSTALLER): all-recursive
  47. $(MKDIR_P) $(top_builddir)/release
  48. STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIND_BIN) $(top_builddir)/release
  49. STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIN_QT_BIN) $(top_builddir)/release
  50. STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIN_CLI_BIN) $(top_builddir)/release
  51. @test -f $(MAKENSIS) && $(MAKENSIS) -V2 $(top_builddir)/share/setup.nsi || \
  52. echo error: could not build $@
  53. @echo built $@
  54. $(if $(findstring src/,$(MAKECMDGOALS)),$(MAKECMDGOALS), none): FORCE
  55. $(MAKE) -C src $(patsubst src/%,%,$@)
  56. $(OSX_APP)/Contents/PkgInfo:
  57. $(MKDIR_P) $(@D)
  58. @echo "APPL????" > $@
  59. $(OSX_APP)/Contents/Resources/empty.lproj:
  60. $(MKDIR_P) $(@D)
  61. @touch $@
  62. $(OSX_APP)/Contents/Info.plist: $(OSX_PLIST)
  63. $(MKDIR_P) $(@D)
  64. $(INSTALL_DATA) $< $@
  65. $(OSX_APP)/Contents/Resources/bitcoin.icns: $(OSX_INSTALLER_ICONS)
  66. $(MKDIR_P) $(@D)
  67. $(INSTALL_DATA) $< $@
  68. $(OSX_APP)/Contents/MacOS/Bitcoin-Qt: $(BITCOIN_QT_BIN)
  69. $(MKDIR_P) $(@D)
  70. STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $< $@
  71. $(OSX_APP)/Contents/Resources/Base.lproj/InfoPlist.strings: $(OSX_BASE_LPROJ_DIR)
  72. $(MKDIR_P) $(@D)
  73. $(INSTALL_DATA) $< $@
  74. OSX_APP_BUILT=$(OSX_APP)/Contents/PkgInfo $(OSX_APP)/Contents/Resources/empty.lproj \
  75. $(OSX_APP)/Contents/Resources/bitcoin.icns $(OSX_APP)/Contents/Info.plist \
  76. $(OSX_APP)/Contents/MacOS/Bitcoin-Qt $(OSX_APP)/Contents/Resources/Base.lproj/InfoPlist.strings
  77. if BUILD_DARWIN
  78. $(OSX_DMG): $(OSX_APP_BUILT) $(OSX_PACKAGING)
  79. $(OSX_DEPLOY_SCRIPT) $(OSX_APP) -add-qt-tr $(OSX_QT_TRANSLATIONS) -translations-dir=$(QT_TRANSLATION_DIR) -dmg -fancy $(OSX_FANCY_PLIST) -verbose 2
  80. deploydir: $(OSX_DMG)
  81. else
  82. APP_DIST_DIR=$(top_builddir)/dist
  83. APP_DIST_EXTRAS=$(APP_DIST_DIR)/.background/$(OSX_BACKGROUND_IMAGE) $(APP_DIST_DIR)/.DS_Store $(APP_DIST_DIR)/Applications
  84. $(APP_DIST_DIR)/Applications:
  85. @rm -f $@
  86. @cd $(@D); $(LN_S) /Applications $(@F)
  87. $(APP_DIST_EXTRAS): $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Bitcoin-Qt
  88. $(OSX_DMG): $(APP_DIST_EXTRAS)
  89. $(GENISOIMAGE) -no-cache-inodes -D -l -probe -V "Bitcoin-Core" -no-pad -r -dir-mode 0755 -apple -o $@ dist
  90. $(APP_DIST_DIR)/.background/$(OSX_BACKGROUND_IMAGE): contrib/macdeploy/$(OSX_BACKGROUND_IMAGE)
  91. $(MKDIR_P) $(@D)
  92. $(INSTALL) $< $@
  93. $(APP_DIST_DIR)/.DS_Store: contrib/macdeploy/DS_Store
  94. $(INSTALL) $< $@
  95. $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Bitcoin-Qt: $(OSX_APP_BUILT) $(OSX_PACKAGING)
  96. INSTALLNAMETOOL=$(INSTALLNAMETOOL) OTOOL=$(OTOOL) STRIP=$(STRIP) $(OSX_DEPLOY_SCRIPT) $(OSX_APP) -translations-dir=$(QT_TRANSLATION_DIR) -add-qt-tr $(OSX_QT_TRANSLATIONS) -verbose 2
  97. deploydir: $(APP_DIST_EXTRAS)
  98. endif
  99. if TARGET_DARWIN
  100. appbundle: $(OSX_APP_BUILT)
  101. deploy: $(OSX_DMG)
  102. endif
  103. if TARGET_WINDOWS
  104. deploy: $(BITCOIN_WIN_INSTALLER)
  105. endif
  106. $(BITCOIN_QT_BIN): FORCE
  107. $(MAKE) -C src qt/$(@F)
  108. $(BITCOIND_BIN): FORCE
  109. $(MAKE) -C src $(@F)
  110. $(BITCOIN_CLI_BIN): FORCE
  111. $(MAKE) -C src $(@F)
  112. if USE_LCOV
  113. baseline.info:
  114. $(LCOV) -c -i -d $(abs_builddir)/src -o $@
  115. baseline_filtered.info: baseline.info
  116. $(LCOV) -r $< "/usr/include/*" -o $@
  117. leveldb_baseline.info: baseline_filtered.info
  118. $(LCOV) -c -i -d $(abs_builddir)/src/leveldb -b $(abs_builddir)/src/leveldb -o $@
  119. leveldb_baseline_filtered.info: leveldb_baseline.info
  120. $(LCOV) -r $< "/usr/include/*" -o $@
  121. baseline_filtered_combined.info: leveldb_baseline_filtered.info baseline_filtered.info
  122. $(LCOV) -a leveldb_baseline_filtered.info -a baseline_filtered.info -o $@
  123. test_bitcoin.info: baseline_filtered_combined.info
  124. $(MAKE) -C src/ check
  125. $(LCOV) -c -d $(abs_builddir)/src -t test_bitcoin -o $@
  126. $(LCOV) -z -d $(abs_builddir)/src
  127. $(LCOV) -z -d $(abs_builddir)/src/leveldb
  128. test_bitcoin_filtered.info: test_bitcoin.info
  129. $(LCOV) -r $< "/usr/include/*" -o $@
  130. block_test.info: test_bitcoin_filtered.info
  131. $(MKDIR_P) qa/tmp
  132. -@TIMEOUT=15 qa/pull-tester/run-bitcoind-for-test.sh $(JAVA) -jar $(JAVA_COMPARISON_TOOL) qa/tmp/compTool $(COMPARISON_TOOL_REORG_TESTS)
  133. $(LCOV) -c -d $(abs_builddir)/src --t BitcoinJBlockTest -o $@
  134. $(LCOV) -z -d $(abs_builddir)/src
  135. $(LCOV) -z -d $(abs_builddir)/src/leveldb
  136. block_test_filtered.info: block_test.info
  137. $(LCOV) -r $< "/usr/include/*" -o $@
  138. rpc_test.info: test_bitcoin_filtered.info
  139. -@TIMEOUT=15 python qa/pull-tester/rpc-tests.py $(EXTENDED_RPC_TESTS)
  140. $(LCOV) -c -d $(abs_builddir)/src --t rpc-tests -o $@
  141. $(LCOV) -z -d $(abs_builddir)/src
  142. $(LCOV) -z -d $(abs_builddir)/src/leveldb
  143. rpc_test_filtered.info: rpc_test.info
  144. $(LCOV) -r $< "/usr/include/*" -o $@
  145. test_bitcoin_coverage.info: baseline_filtered_combined.info test_bitcoin_filtered.info
  146. $(LCOV) -a baseline_filtered.info -a leveldb_baseline_filtered.info -a test_bitcoin_filtered.info -o $@
  147. total_coverage.info: baseline_filtered_combined.info test_bitcoin_filtered.info block_test_filtered.info rpc_test_filtered.info
  148. $(LCOV) -a baseline_filtered.info -a leveldb_baseline_filtered.info -a test_bitcoin_filtered.info -a block_test_filtered.info -a rpc_test_filtered.info -o $@ | $(GREP) "\%" | $(AWK) '{ print substr($$3,2,50) "/" $$5 }' > coverage_percent.txt
  149. test_bitcoin.coverage/.dirstamp: test_bitcoin_coverage.info
  150. $(GENHTML) -s $< -o $(@D)
  151. @touch $@
  152. total.coverage/.dirstamp: total_coverage.info
  153. $(GENHTML) -s $< -o $(@D)
  154. @touch $@
  155. cov: test_bitcoin.coverage/.dirstamp total.coverage/.dirstamp
  156. endif
  157. if USE_COMPARISON_TOOL
  158. check-local:
  159. $(MKDIR_P) qa/tmp
  160. @qa/pull-tester/run-bitcoind-for-test.sh $(JAVA) -jar $(JAVA_COMPARISON_TOOL) qa/tmp/compTool $(COMPARISON_TOOL_REORG_TESTS) 2>&1
  161. endif
  162. dist_noinst_SCRIPTS = autogen.sh
  163. EXTRA_DIST = $(top_srcdir)/share/genbuild.sh qa/pull-tester/rpc-tests.py qa/rpc-tests $(DIST_DOCS) $(WINDOWS_PACKAGING) $(OSX_PACKAGING)
  164. CLEANFILES = $(OSX_DMG) $(BITCOIN_WIN_INSTALLER)
  165. .INTERMEDIATE: $(COVERAGE_INFO)
  166. clean-local:
  167. rm -rf coverage_percent.txt test_bitcoin.coverage/ total.coverage/ qa/tmp/ cache/ $(OSX_APP)