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