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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  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. $(OSX_APP)/Contents/PkgInfo:
  66. $(MKDIR_P) $(@D)
  67. @echo "APPL????" > $@
  68. $(OSX_APP)/Contents/Resources/empty.lproj:
  69. $(MKDIR_P) $(@D)
  70. @touch $@
  71. $(OSX_APP)/Contents/Info.plist: $(OSX_PLIST)
  72. $(MKDIR_P) $(@D)
  73. $(INSTALL_DATA) $< $@
  74. $(OSX_APP)/Contents/Resources/bitcoin.icns: $(OSX_INSTALLER_ICONS)
  75. $(MKDIR_P) $(@D)
  76. $(INSTALL_DATA) $< $@
  77. $(OSX_APP)/Contents/MacOS/Bitcoin-Qt: $(BITCOIN_QT_BIN)
  78. $(MKDIR_P) $(@D)
  79. STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $< $@
  80. $(OSX_APP)/Contents/Resources/Base.lproj/InfoPlist.strings:
  81. $(MKDIR_P) $(@D)
  82. echo '{ CFBundleDisplayName = "$(PACKAGE_NAME)"; CFBundleName = "$(PACKAGE_NAME)"; }' > $@
  83. OSX_APP_BUILT=$(OSX_APP)/Contents/PkgInfo $(OSX_APP)/Contents/Resources/empty.lproj \
  84. $(OSX_APP)/Contents/Resources/bitcoin.icns $(OSX_APP)/Contents/Info.plist \
  85. $(OSX_APP)/Contents/MacOS/Bitcoin-Qt $(OSX_APP)/Contents/Resources/Base.lproj/InfoPlist.strings
  86. osx_volname:
  87. echo $(OSX_VOLNAME) >$@
  88. if BUILD_DARWIN
  89. $(OSX_DMG): $(OSX_APP_BUILT) $(OSX_PACKAGING) $(OSX_BACKGROUND_IMAGE)
  90. $(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)
  91. $(OSX_BACKGROUND_IMAGE).png: contrib/macdeploy/$(OSX_BACKGROUND_SVG)
  92. sed 's/PACKAGE_NAME/$(PACKAGE_NAME)/' < "$<" | $(RSVG_CONVERT) -f png -d 36 -p 36 -o $@
  93. $(OSX_BACKGROUND_IMAGE)@2x.png: contrib/macdeploy/$(OSX_BACKGROUND_SVG)
  94. sed 's/PACKAGE_NAME/$(PACKAGE_NAME)/' < "$<" | $(RSVG_CONVERT) -f png -d 72 -p 72 -o $@
  95. $(OSX_BACKGROUND_IMAGE): $(OSX_BACKGROUND_IMAGE).png $(OSX_BACKGROUND_IMAGE)@2x.png
  96. tiffutil -cathidpicheck $^ -out $@
  97. deploydir: $(OSX_DMG)
  98. else
  99. APP_DIST_DIR=$(top_builddir)/dist
  100. APP_DIST_EXTRAS=$(APP_DIST_DIR)/.background/$(OSX_BACKGROUND_IMAGE) $(APP_DIST_DIR)/.DS_Store $(APP_DIST_DIR)/Applications
  101. $(APP_DIST_DIR)/Applications:
  102. @rm -f $@
  103. @cd $(@D); $(LN_S) /Applications $(@F)
  104. $(APP_DIST_EXTRAS): $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Bitcoin-Qt
  105. $(OSX_DMG): $(APP_DIST_EXTRAS)
  106. $(GENISOIMAGE) -no-cache-inodes -D -l -probe -V "$(OSX_VOLNAME)" -no-pad -r -dir-mode 0755 -apple -o $@ dist
  107. dpi%.$(OSX_BACKGROUND_IMAGE): contrib/macdeploy/$(OSX_BACKGROUND_SVG)
  108. sed 's/PACKAGE_NAME/$(PACKAGE_NAME)/' < "$<" | $(RSVG_CONVERT) -f png -d $* -p $* | $(IMAGEMAGICK_CONVERT) - $@
  109. OSX_BACKGROUND_IMAGE_DPIFILES := $(foreach dpi,$(OSX_BACKGROUND_IMAGE_DPIS),dpi$(dpi).$(OSX_BACKGROUND_IMAGE))
  110. $(APP_DIST_DIR)/.background/$(OSX_BACKGROUND_IMAGE): $(OSX_BACKGROUND_IMAGE_DPIFILES)
  111. $(MKDIR_P) $(@D)
  112. $(TIFFCP) -c none $(OSX_BACKGROUND_IMAGE_DPIFILES) $@
  113. $(APP_DIST_DIR)/.DS_Store: $(OSX_DSSTORE_GEN)
  114. $(PYTHON) $< "$@" "$(OSX_VOLNAME)"
  115. $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Bitcoin-Qt: $(OSX_APP_BUILT) $(OSX_PACKAGING)
  116. 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
  117. deploydir: $(APP_DIST_EXTRAS)
  118. endif
  119. if TARGET_DARWIN
  120. appbundle: $(OSX_APP_BUILT)
  121. deploy: $(OSX_DMG)
  122. endif
  123. if TARGET_WINDOWS
  124. deploy: $(BITCOIN_WIN_INSTALLER)
  125. endif
  126. $(BITCOIN_QT_BIN): FORCE
  127. $(MAKE) -C src qt/$(@F)
  128. $(BITCOIND_BIN): FORCE
  129. $(MAKE) -C src $(@F)
  130. $(BITCOIN_CLI_BIN): FORCE
  131. $(MAKE) -C src $(@F)
  132. if USE_LCOV
  133. baseline.info:
  134. $(LCOV) -c -i -d $(abs_builddir)/src -o $@
  135. baseline_filtered.info: baseline.info
  136. $(LCOV) -r $< "/usr/include/*" -o $@
  137. leveldb_baseline.info: baseline_filtered.info
  138. $(LCOV) -c -i -d $(abs_builddir)/src/leveldb -b $(abs_builddir)/src/leveldb -o $@
  139. leveldb_baseline_filtered.info: leveldb_baseline.info
  140. $(LCOV) -r $< "/usr/include/*" -o $@
  141. baseline_filtered_combined.info: leveldb_baseline_filtered.info baseline_filtered.info
  142. $(LCOV) -a leveldb_baseline_filtered.info -a baseline_filtered.info -o $@
  143. test_bitcoin.info: baseline_filtered_combined.info
  144. $(MAKE) -C src/ check
  145. $(LCOV) -c -d $(abs_builddir)/src -t test_bitcoin -o $@
  146. $(LCOV) -z -d $(abs_builddir)/src
  147. $(LCOV) -z -d $(abs_builddir)/src/leveldb
  148. test_bitcoin_filtered.info: test_bitcoin.info
  149. $(LCOV) -r $< "/usr/include/*" -o $@
  150. functional_test.info: test_bitcoin_filtered.info
  151. -@TIMEOUT=15 python test/functional/test_runner.py $(EXTENDED_FUNCTIONAL_TESTS)
  152. $(LCOV) -c -d $(abs_builddir)/src --t functional-tests -o $@
  153. $(LCOV) -z -d $(abs_builddir)/src
  154. $(LCOV) -z -d $(abs_builddir)/src/leveldb
  155. functional_test_filtered.info: functional_test.info
  156. $(LCOV) -r $< "/usr/include/*" -o $@
  157. test_bitcoin_coverage.info: baseline_filtered_combined.info test_bitcoin_filtered.info
  158. $(LCOV) -a baseline_filtered.info -a leveldb_baseline_filtered.info -a test_bitcoin_filtered.info -o $@
  159. total_coverage.info: baseline_filtered_combined.info test_bitcoin_filtered.info functional_test_filtered.info
  160. $(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
  161. test_bitcoin.coverage/.dirstamp: test_bitcoin_coverage.info
  162. $(GENHTML) -s $< -o $(@D)
  163. @touch $@
  164. total.coverage/.dirstamp: total_coverage.info
  165. $(GENHTML) -s $< -o $(@D)
  166. @touch $@
  167. cov: test_bitcoin.coverage/.dirstamp total.coverage/.dirstamp
  168. endif
  169. dist_noinst_SCRIPTS = autogen.sh
  170. EXTRA_DIST = $(top_srcdir)/share/genbuild.sh test/functional/test_runner.py test/functional $(DIST_CONTRIB) $(DIST_DOCS) $(WINDOWS_PACKAGING) $(OSX_PACKAGING) $(BIN_CHECKS)
  171. EXTRA_DIST += \
  172. test/util/bctest.py \
  173. test/util/bitcoin-util-test.py \
  174. test/util/data/bitcoin-util-test.json \
  175. test/util/data/blanktxv1.hex \
  176. test/util/data/blanktxv1.json \
  177. test/util/data/blanktxv2.hex \
  178. test/util/data/blanktxv2.json \
  179. test/util/data/tt-delin1-out.hex \
  180. test/util/data/tt-delin1-out.json \
  181. test/util/data/tt-delout1-out.hex \
  182. test/util/data/tt-delout1-out.json \
  183. test/util/data/tt-locktime317000-out.hex \
  184. test/util/data/tt-locktime317000-out.json \
  185. test/util/data/tx394b54bb.hex \
  186. test/util/data/txcreate1.hex \
  187. test/util/data/txcreate1.json \
  188. test/util/data/txcreate2.hex \
  189. test/util/data/txcreate2.json \
  190. test/util/data/txcreatedata1.hex \
  191. test/util/data/txcreatedata1.json \
  192. test/util/data/txcreatedata2.hex \
  193. test/util/data/txcreatedata2.json \
  194. test/util/data/txcreatedata_seq0.hex \
  195. test/util/data/txcreatedata_seq0.json \
  196. test/util/data/txcreatedata_seq1.hex \
  197. test/util/data/txcreatedata_seq1.json \
  198. test/util/data/txcreatemultisig1.hex \
  199. test/util/data/txcreatemultisig1.json \
  200. test/util/data/txcreatemultisig2.hex \
  201. test/util/data/txcreatemultisig2.json \
  202. test/util/data/txcreatemultisig3.hex \
  203. test/util/data/txcreatemultisig3.json \
  204. test/util/data/txcreatemultisig4.hex \
  205. test/util/data/txcreatemultisig4.json \
  206. test/util/data/txcreateoutpubkey1.hex \
  207. test/util/data/txcreateoutpubkey1.json \
  208. test/util/data/txcreateoutpubkey2.hex \
  209. test/util/data/txcreateoutpubkey2.json \
  210. test/util/data/txcreateoutpubkey3.hex \
  211. test/util/data/txcreateoutpubkey3.json \
  212. test/util/data/txcreatescript1.hex \
  213. test/util/data/txcreatescript1.json \
  214. test/util/data/txcreatescript2.hex \
  215. test/util/data/txcreatescript2.json \
  216. test/util/data/txcreatescript3.hex \
  217. test/util/data/txcreatescript3.json \
  218. test/util/data/txcreatescript4.hex \
  219. test/util/data/txcreatescript4.json \
  220. test/util/data/txcreatesignv1.hex \
  221. test/util/data/txcreatesignv1.json \
  222. test/util/data/txcreatesignv2.hex
  223. CLEANFILES = $(OSX_DMG) $(BITCOIN_WIN_INSTALLER)
  224. # This file is problematic for out-of-tree builds if it exists.
  225. DISTCLEANFILES = test/util/buildenv.pyc
  226. .INTERMEDIATE: $(COVERAGE_INFO)
  227. DISTCHECK_CONFIGURE_FLAGS = --enable-man
  228. clean-local:
  229. rm -rf coverage_percent.txt test_bitcoin.coverage/ total.coverage/ test/tmp/ cache/ $(OSX_APP)
  230. rm -rf test/functional/__pycache__