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 8.6KB

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