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

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