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.1KB

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