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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  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 functional_test.info functional_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) $(OSX_BACKGROUND_IMAGE)
  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. $(OSX_BACKGROUND_IMAGE).png: contrib/macdeploy/$(OSX_BACKGROUND_SVG)
  94. sed 's/PACKAGE_NAME/$(PACKAGE_NAME)/' < "$<" | $(RSVG_CONVERT) -f png -d 36 -p 36 -o $@
  95. $(OSX_BACKGROUND_IMAGE)@2x.png: contrib/macdeploy/$(OSX_BACKGROUND_SVG)
  96. sed 's/PACKAGE_NAME/$(PACKAGE_NAME)/' < "$<" | $(RSVG_CONVERT) -f png -d 72 -p 72 -o $@
  97. $(OSX_BACKGROUND_IMAGE): $(OSX_BACKGROUND_IMAGE).png $(OSX_BACKGROUND_IMAGE)@2x.png
  98. tiffutil -cathidpicheck $^ -out $@
  99. deploydir: $(OSX_DMG)
  100. else
  101. APP_DIST_DIR=$(top_builddir)/dist
  102. APP_DIST_EXTRAS=$(APP_DIST_DIR)/.background/$(OSX_BACKGROUND_IMAGE) $(APP_DIST_DIR)/.DS_Store $(APP_DIST_DIR)/Applications
  103. $(APP_DIST_DIR)/Applications:
  104. @rm -f $@
  105. @cd $(@D); $(LN_S) /Applications $(@F)
  106. $(APP_DIST_EXTRAS): $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Bitcoin-Qt
  107. $(OSX_DMG): $(APP_DIST_EXTRAS)
  108. $(GENISOIMAGE) -no-cache-inodes -D -l -probe -V "$(OSX_VOLNAME)" -no-pad -r -dir-mode 0755 -apple -o $@ dist
  109. dpi%.$(OSX_BACKGROUND_IMAGE): contrib/macdeploy/$(OSX_BACKGROUND_SVG)
  110. sed 's/PACKAGE_NAME/$(PACKAGE_NAME)/' < "$<" | $(RSVG_CONVERT) -f png -d $* -p $* | $(IMAGEMAGICK_CONVERT) - $@
  111. OSX_BACKGROUND_IMAGE_DPIFILES := $(foreach dpi,$(OSX_BACKGROUND_IMAGE_DPIS),dpi$(dpi).$(OSX_BACKGROUND_IMAGE))
  112. $(APP_DIST_DIR)/.background/$(OSX_BACKGROUND_IMAGE): $(OSX_BACKGROUND_IMAGE_DPIFILES)
  113. $(MKDIR_P) $(@D)
  114. $(TIFFCP) -c none $(OSX_BACKGROUND_IMAGE_DPIFILES) $@
  115. $(APP_DIST_DIR)/.DS_Store: $(OSX_DSSTORE_GEN)
  116. $(PYTHON) $< "$@" "$(OSX_VOLNAME)"
  117. $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Bitcoin-Qt: $(OSX_APP_BUILT) $(OSX_PACKAGING)
  118. 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
  119. deploydir: $(APP_DIST_EXTRAS)
  120. endif
  121. if TARGET_DARWIN
  122. appbundle: $(OSX_APP_BUILT)
  123. deploy: $(OSX_DMG)
  124. endif
  125. if TARGET_WINDOWS
  126. deploy: $(BITCOIN_WIN_INSTALLER)
  127. endif
  128. $(BITCOIN_QT_BIN): FORCE
  129. $(MAKE) -C src qt/$(@F)
  130. $(BITCOIND_BIN): FORCE
  131. $(MAKE) -C src $(@F)
  132. $(BITCOIN_CLI_BIN): FORCE
  133. $(MAKE) -C src $(@F)
  134. if USE_LCOV
  135. baseline.info:
  136. $(LCOV) -c -i -d $(abs_builddir)/src -o $@
  137. baseline_filtered.info: baseline.info
  138. $(LCOV) -r $< "/usr/include/*" -o $@
  139. leveldb_baseline.info: baseline_filtered.info
  140. $(LCOV) -c -i -d $(abs_builddir)/src/leveldb -b $(abs_builddir)/src/leveldb -o $@
  141. leveldb_baseline_filtered.info: leveldb_baseline.info
  142. $(LCOV) -r $< "/usr/include/*" -o $@
  143. baseline_filtered_combined.info: leveldb_baseline_filtered.info baseline_filtered.info
  144. $(LCOV) -a leveldb_baseline_filtered.info -a baseline_filtered.info -o $@
  145. test_bitcoin.info: baseline_filtered_combined.info
  146. $(MAKE) -C src/ check
  147. $(LCOV) -c -d $(abs_builddir)/src -t test_bitcoin -o $@
  148. $(LCOV) -z -d $(abs_builddir)/src
  149. $(LCOV) -z -d $(abs_builddir)/src/leveldb
  150. test_bitcoin_filtered.info: test_bitcoin.info
  151. $(LCOV) -r $< "/usr/include/*" -o $@
  152. functional_test.info: test_bitcoin_filtered.info
  153. -@TIMEOUT=15 python test/pull-tester/rpc-tests.py $(EXTENDED_RPC_TESTS)
  154. $(LCOV) -c -d $(abs_builddir)/src --t functional-tests -o $@
  155. $(LCOV) -z -d $(abs_builddir)/src
  156. $(LCOV) -z -d $(abs_builddir)/src/leveldb
  157. functional_test_filtered.info: functional_test.info
  158. $(LCOV) -r $< "/usr/include/*" -o $@
  159. test_bitcoin_coverage.info: baseline_filtered_combined.info test_bitcoin_filtered.info
  160. $(LCOV) -a baseline_filtered.info -a leveldb_baseline_filtered.info -a test_bitcoin_filtered.info -o $@
  161. total_coverage.info: baseline_filtered_combined.info test_bitcoin_filtered.info functional_test_filtered.info
  162. $(LCOV) -a baseline_filtered.info -a leveldb_baseline_filtered.info -a test_bitcoin_filtered.info -a functional_test_filtered.info -o $@ | $(GREP) "\%" | $(AWK) '{ print substr($$3,2,50) "/" $$5 }' > coverage_percent.txt
  163. test_bitcoin.coverage/.dirstamp: test_bitcoin_coverage.info
  164. $(GENHTML) -s $< -o $(@D)
  165. @touch $@
  166. total.coverage/.dirstamp: total_coverage.info
  167. $(GENHTML) -s $< -o $(@D)
  168. @touch $@
  169. cov: test_bitcoin.coverage/.dirstamp total.coverage/.dirstamp
  170. endif
  171. dist_noinst_SCRIPTS = autogen.sh
  172. EXTRA_DIST = $(top_srcdir)/share/genbuild.sh test/pull-tester/rpc-tests.py test/functional $(DIST_CONTRIB) $(DIST_DOCS) $(WINDOWS_PACKAGING) $(OSX_PACKAGING) $(BIN_CHECKS)
  173. CLEANFILES = $(OSX_DMG) $(BITCOIN_WIN_INSTALLER)
  174. .INTERMEDIATE: $(COVERAGE_INFO)
  175. DISTCHECK_CONFIGURE_FLAGS = --enable-man
  176. clean-local:
  177. rm -rf coverage_percent.txt test_bitcoin.coverage/ total.coverage/ test/tmp/ cache/ $(OSX_APP)
  178. rm -rf test/pull-tester/__pycache__