No Description
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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. # Copyright (c) 2013-2016 The Starwels 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. export PYTHONPATH
  11. if BUILD_STARWELS_LIBS
  12. pkgconfigdir = $(libdir)/pkgconfig
  13. pkgconfig_DATA = libstarwelsconsensus.pc
  14. endif
  15. STARWELSD_BIN=$(top_builddir)/src/$(STARWELS_DAEMON_NAME)$(EXEEXT)
  16. STARWELS_QT_BIN=$(top_builddir)/src/qt/$(STARWELS_GUI_NAME)$(EXEEXT)
  17. STARWELS_CLI_BIN=$(top_builddir)/src/$(STARWELS_CLI_NAME)$(EXEEXT)
  18. STARWELS_WIN_INSTALLER=$(PACKAGE)-$(PACKAGE_VERSION)-win$(WINDOWS_BITS)-setup$(EXEEXT)
  19. empty :=
  20. space := $(empty) $(empty)
  21. OSX_APP=Starwels-Qt.app
  22. OSX_VOLNAME = $(subst $(space),-,$(PACKAGE_NAME))
  23. OSX_DMG = $(OSX_VOLNAME).dmg
  24. OSX_BACKGROUND_SVG=background.svg
  25. OSX_BACKGROUND_IMAGE=background.tiff
  26. OSX_BACKGROUND_IMAGE_DPIS=36 72
  27. OSX_DSSTORE_GEN=$(top_srcdir)/contrib/macdeploy/custom_dsstore.py
  28. OSX_DEPLOY_SCRIPT=$(top_srcdir)/contrib/macdeploy/macdeployqtplus
  29. OSX_FANCY_PLIST=$(top_srcdir)/contrib/macdeploy/fancy.plist
  30. OSX_INSTALLER_ICONS=$(top_srcdir)/src/qt/res/icons/starwels.icns
  31. OSX_PLIST=$(top_builddir)/share/qt/Info.plist #not installed
  32. OSX_QT_TRANSLATIONS = da,de,es,hu,ru,uk,zh_CN,zh_TW
  33. DIST_DOCS = $(wildcard doc/*.md) $(wildcard doc/release-notes/*.md)
  34. DIST_CONTRIB = $(top_srcdir)/contrib/starwels-cli.bash-completion \
  35. $(top_srcdir)/contrib/starwels-tx.bash-completion \
  36. $(top_srcdir)/contrib/starwelsd.bash-completion \
  37. $(top_srcdir)/contrib/init \
  38. $(top_srcdir)/contrib/install_db4.sh \
  39. $(top_srcdir)/contrib/rpm
  40. DIST_SHARE = \
  41. $(top_srcdir)/share/genbuild.sh \
  42. $(top_srcdir)/share/rpcauth
  43. BIN_CHECKS=$(top_srcdir)/contrib/devtools/symbol-check.py \
  44. $(top_srcdir)/contrib/devtools/security-check.py
  45. WINDOWS_PACKAGING = $(top_srcdir)/share/pixmaps/starwels.ico \
  46. $(top_srcdir)/share/pixmaps/nsis-header.bmp \
  47. $(top_srcdir)/share/pixmaps/nsis-wizard.bmp \
  48. $(top_srcdir)/doc/README_windows.txt
  49. OSX_PACKAGING = $(OSX_DEPLOY_SCRIPT) $(OSX_FANCY_PLIST) $(OSX_INSTALLER_ICONS) \
  50. $(top_srcdir)/contrib/macdeploy/$(OSX_BACKGROUND_SVG) \
  51. $(OSX_DSSTORE_GEN) \
  52. $(top_srcdir)/contrib/macdeploy/detached-sig-apply.sh \
  53. $(top_srcdir)/contrib/macdeploy/detached-sig-create.sh
  54. COVERAGE_INFO = baseline.info \
  55. test_starwels_filtered.info total_coverage.info \
  56. baseline_filtered.info functional_test.info functional_test_filtered.info \
  57. test_starwels_coverage.info test_starwels.info
  58. dist-hook:
  59. -$(GIT) archive --format=tar HEAD -- src/clientversion.cpp | $(AMTAR) -C $(top_distdir) -xf -
  60. $(STARWELS_WIN_INSTALLER): all-recursive
  61. $(MKDIR_P) $(top_builddir)/release
  62. STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(STARWELSD_BIN) $(top_builddir)/release
  63. STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(STARWELS_QT_BIN) $(top_builddir)/release
  64. STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(STARWELS_CLI_BIN) $(top_builddir)/release
  65. @test -f $(MAKENSIS) && $(MAKENSIS) -V2 $(top_builddir)/share/setup.nsi || \
  66. echo error: could not build $@
  67. @echo built $@
  68. $(OSX_APP)/Contents/PkgInfo:
  69. $(MKDIR_P) $(@D)
  70. @echo "APPL????" > $@
  71. $(OSX_APP)/Contents/Resources/empty.lproj:
  72. $(MKDIR_P) $(@D)
  73. @touch $@
  74. $(OSX_APP)/Contents/Info.plist: $(OSX_PLIST)
  75. $(MKDIR_P) $(@D)
  76. $(INSTALL_DATA) $< $@
  77. $(OSX_APP)/Contents/Resources/starwels.icns: $(OSX_INSTALLER_ICONS)
  78. $(MKDIR_P) $(@D)
  79. $(INSTALL_DATA) $< $@
  80. $(OSX_APP)/Contents/MacOS/Starwels-Qt: $(STARWELS_QT_BIN)
  81. $(MKDIR_P) $(@D)
  82. STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $< $@
  83. $(OSX_APP)/Contents/Resources/Base.lproj/InfoPlist.strings:
  84. $(MKDIR_P) $(@D)
  85. echo '{ CFBundleDisplayName = "$(PACKAGE_NAME)"; CFBundleName = "$(PACKAGE_NAME)"; }' > $@
  86. OSX_APP_BUILT=$(OSX_APP)/Contents/PkgInfo $(OSX_APP)/Contents/Resources/empty.lproj \
  87. $(OSX_APP)/Contents/Resources/starwels.icns $(OSX_APP)/Contents/Info.plist \
  88. $(OSX_APP)/Contents/MacOS/Starwels-Qt $(OSX_APP)/Contents/Resources/Base.lproj/InfoPlist.strings
  89. osx_volname:
  90. echo $(OSX_VOLNAME) >$@
  91. if BUILD_DARWIN
  92. $(OSX_DMG): $(OSX_APP_BUILT) $(OSX_PACKAGING) $(OSX_BACKGROUND_IMAGE)
  93. $(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)
  94. $(OSX_BACKGROUND_IMAGE).png: contrib/macdeploy/$(OSX_BACKGROUND_SVG)
  95. sed 's/PACKAGE_NAME/$(PACKAGE_NAME)/' < "$<" | $(RSVG_CONVERT) -f png -d 36 -p 36 -o $@
  96. $(OSX_BACKGROUND_IMAGE)@2x.png: contrib/macdeploy/$(OSX_BACKGROUND_SVG)
  97. sed 's/PACKAGE_NAME/$(PACKAGE_NAME)/' < "$<" | $(RSVG_CONVERT) -f png -d 72 -p 72 -o $@
  98. $(OSX_BACKGROUND_IMAGE): $(OSX_BACKGROUND_IMAGE).png $(OSX_BACKGROUND_IMAGE)@2x.png
  99. tiffutil -cathidpicheck $^ -out $@
  100. deploydir: $(OSX_DMG)
  101. else
  102. APP_DIST_DIR=$(top_builddir)/dist
  103. APP_DIST_EXTRAS=$(APP_DIST_DIR)/.background/$(OSX_BACKGROUND_IMAGE) $(APP_DIST_DIR)/.DS_Store $(APP_DIST_DIR)/Applications
  104. $(APP_DIST_DIR)/Applications:
  105. @rm -f $@
  106. @cd $(@D); $(LN_S) /Applications $(@F)
  107. $(APP_DIST_EXTRAS): $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Starwels-Qt
  108. $(OSX_DMG): $(APP_DIST_EXTRAS)
  109. $(GENISOIMAGE) -no-cache-inodes -D -l -probe -V "$(OSX_VOLNAME)" -no-pad -r -dir-mode 0755 -apple -o $@ dist
  110. dpi%.$(OSX_BACKGROUND_IMAGE): contrib/macdeploy/$(OSX_BACKGROUND_SVG)
  111. sed 's/PACKAGE_NAME/$(PACKAGE_NAME)/' < "$<" | $(RSVG_CONVERT) -f png -d $* -p $* | $(IMAGEMAGICK_CONVERT) - $@
  112. OSX_BACKGROUND_IMAGE_DPIFILES := $(foreach dpi,$(OSX_BACKGROUND_IMAGE_DPIS),dpi$(dpi).$(OSX_BACKGROUND_IMAGE))
  113. $(APP_DIST_DIR)/.background/$(OSX_BACKGROUND_IMAGE): $(OSX_BACKGROUND_IMAGE_DPIFILES)
  114. $(MKDIR_P) $(@D)
  115. $(TIFFCP) -c none $(OSX_BACKGROUND_IMAGE_DPIFILES) $@
  116. $(APP_DIST_DIR)/.DS_Store: $(OSX_DSSTORE_GEN)
  117. $(PYTHON) $< "$@" "$(OSX_VOLNAME)"
  118. $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Starwels-Qt: $(OSX_APP_BUILT) $(OSX_PACKAGING)
  119. 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
  120. deploydir: $(APP_DIST_EXTRAS)
  121. endif
  122. if TARGET_DARWIN
  123. appbundle: $(OSX_APP_BUILT)
  124. deploy: $(OSX_DMG)
  125. endif
  126. if TARGET_WINDOWS
  127. deploy: $(STARWELS_WIN_INSTALLER)
  128. endif
  129. $(STARWELS_QT_BIN): FORCE
  130. $(MAKE) -C src qt/$(@F)
  131. $(STARWELSD_BIN): FORCE
  132. $(MAKE) -C src $(@F)
  133. $(STARWELS_CLI_BIN): FORCE
  134. $(MAKE) -C src $(@F)
  135. if USE_LCOV
  136. LCOV_FILTER_PATTERN=-p "/usr/include/" -p "src/leveldb/" -p "src/bench/" -p "src/univalue" -p "src/crypto/ctaes" -p "src/secp256k1"
  137. baseline.info:
  138. $(LCOV) -c -i -d $(abs_builddir)/src -o $@
  139. baseline_filtered.info: baseline.info
  140. $(abs_builddir)/contrib/filter-lcov.py $(LCOV_FILTER_PATTERN) $< $@
  141. $(LCOV) -a $@ $(LCOV_OPTS) -o $@
  142. test_starwels.info: baseline_filtered.info
  143. $(MAKE) -C src/ check
  144. $(LCOV) -c $(LCOV_OPTS) -d $(abs_builddir)/src -t test_starwels -o $@
  145. $(LCOV) -z $(LCOV_OPTS) -d $(abs_builddir)/src
  146. test_starwels_filtered.info: test_starwels.info
  147. $(abs_builddir)/contrib/filter-lcov.py $(LCOV_FILTER_PATTERN) $< $@
  148. $(LCOV) -a $@ $(LCOV_OPTS) -o $@
  149. functional_test.info: test_starwels_filtered.info
  150. -@TIMEOUT=15 test/functional/test_runner.py $(EXTENDED_FUNCTIONAL_TESTS)
  151. $(LCOV) -c $(LCOV_OPTS) -d $(abs_builddir)/src --t functional-tests -o $@
  152. $(LCOV) -z $(LCOV_OPTS) -d $(abs_builddir)/src
  153. functional_test_filtered.info: functional_test.info
  154. $(abs_builddir)/contrib/filter-lcov.py $(LCOV_FILTER_PATTERN) $< $@
  155. $(LCOV) -a $@ $(LCOV_OPTS) -o $@
  156. test_starwels_coverage.info: baseline_filtered.info test_starwels_filtered.info
  157. $(LCOV) -a $(LCOV_OPTS) baseline_filtered.info -a test_starwels_filtered.info -o $@
  158. total_coverage.info: test_starwels_filtered.info functional_test_filtered.info
  159. $(LCOV) -a $(LCOV_OPTS) baseline_filtered.info -a test_starwels_filtered.info -a functional_test_filtered.info -o $@ | $(GREP) "\%" | $(AWK) '{ print substr($$3,2,50) "/" $$5 }' > coverage_percent.txt
  160. test_starwels.coverage/.dirstamp: test_starwels_coverage.info
  161. $(GENHTML) -s $(LCOV_OPTS) $< -o $(@D)
  162. @touch $@
  163. total.coverage/.dirstamp: total_coverage.info
  164. $(GENHTML) -s $(LCOV_OPTS) $< -o $(@D)
  165. @touch $@
  166. cov: test_starwels.coverage/.dirstamp total.coverage/.dirstamp
  167. endif
  168. dist_noinst_SCRIPTS = autogen.sh
  169. EXTRA_DIST = $(DIST_SHARE) test/functional/test_runner.py test/functional $(DIST_CONTRIB) $(DIST_DOCS) $(WINDOWS_PACKAGING) $(OSX_PACKAGING) $(BIN_CHECKS)
  170. EXTRA_DIST += \
  171. test/util/starwels-util-test.py \
  172. test/util/data/starwels-util-test.json \
  173. test/util/data/blanktxv1.hex \
  174. test/util/data/blanktxv1.json \
  175. test/util/data/blanktxv2.hex \
  176. test/util/data/blanktxv2.json \
  177. test/util/data/tt-delin1-out.hex \
  178. test/util/data/tt-delin1-out.json \
  179. test/util/data/tt-delout1-out.hex \
  180. test/util/data/tt-delout1-out.json \
  181. test/util/data/tt-locktime317000-out.hex \
  182. test/util/data/tt-locktime317000-out.json \
  183. test/util/data/tx394b54bb.hex \
  184. test/util/data/txcreate1.hex \
  185. test/util/data/txcreate1.json \
  186. test/util/data/txcreate2.hex \
  187. test/util/data/txcreate2.json \
  188. test/util/data/txcreatedata1.hex \
  189. test/util/data/txcreatedata1.json \
  190. test/util/data/txcreatedata2.hex \
  191. test/util/data/txcreatedata2.json \
  192. test/util/data/txcreatedata_seq0.hex \
  193. test/util/data/txcreatedata_seq0.json \
  194. test/util/data/txcreatedata_seq1.hex \
  195. test/util/data/txcreatedata_seq1.json \
  196. test/util/data/txcreatemultisig1.hex \
  197. test/util/data/txcreatemultisig1.json \
  198. test/util/data/txcreatemultisig2.hex \
  199. test/util/data/txcreatemultisig2.json \
  200. test/util/data/txcreatemultisig3.hex \
  201. test/util/data/txcreatemultisig3.json \
  202. test/util/data/txcreatemultisig4.hex \
  203. test/util/data/txcreatemultisig4.json \
  204. test/util/data/txcreatemultisig5.json \
  205. test/util/data/txcreateoutpubkey1.hex \
  206. test/util/data/txcreateoutpubkey1.json \
  207. test/util/data/txcreateoutpubkey2.hex \
  208. test/util/data/txcreateoutpubkey2.json \
  209. test/util/data/txcreateoutpubkey3.hex \
  210. test/util/data/txcreateoutpubkey3.json \
  211. test/util/data/txcreatescript1.hex \
  212. test/util/data/txcreatescript1.json \
  213. test/util/data/txcreatescript2.hex \
  214. test/util/data/txcreatescript2.json \
  215. test/util/data/txcreatescript3.hex \
  216. test/util/data/txcreatescript3.json \
  217. test/util/data/txcreatescript4.hex \
  218. test/util/data/txcreatescript4.json \
  219. test/util/data/txcreatesignv1.hex \
  220. test/util/data/txcreatesignv1.json \
  221. test/util/data/txcreatesignv2.hex
  222. CLEANFILES = $(OSX_DMG) $(STARWELS_WIN_INSTALLER)
  223. .INTERMEDIATE: $(COVERAGE_INFO)
  224. DISTCHECK_CONFIGURE_FLAGS = --enable-man
  225. clean-local:
  226. rm -rf coverage_percent.txt test_starwels.coverage/ total.coverage/ test/tmp/ cache/ $(OSX_APP)
  227. rm -rf test/functional/__pycache__ test/functional/test_framework/__pycache__ test/cache