Makefile.am 7.51 KB
Newer Older
1 2 3 4 5
# Copyright (c) 2013-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.

ACLOCAL_AMFLAGS = -I build-aux/m4
6
SUBDIRS = src
7
.PHONY: deploy FORCE
8 9

GZIP_ENV="-9n"
10 11 12 13 14 15
export PYTHONPATH

if BUILD_BLACKCOIN_LIBS
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libblackcoinconsensus.pc
endif
16

17 18 19
BLACKCOIND_BIN=$(top_builddir)/src/blackcoind$(EXEEXT)
BLACKCOIN_QT_BIN=$(top_builddir)/src/qt/blackcoin-qt$(EXEEXT)
BLACKCOIN_WIN_INSTALLER=$(PACKAGE)-$(PACKAGE_VERSION)-win32-setup$(EXEEXT)
20

21 22 23 24 25
OSX_APP=Blackcoin-Qt.app
OSX_VOLNAME = $(subst $(space),-,$(PACKAGE_NAME))
OSX_DMG=Blackcoin-Qt.dmg
OSX_BACKGROUND_IMAGE=background.tiff
OSX_DSSTORE_GEN=$(top_srcdir)/contrib/macdeploy/custom_dsstore.py
26 27
OSX_DEPLOY_SCRIPT=$(top_srcdir)/contrib/macdeploy/macdeployqtplus
OSX_FANCY_PLIST=$(top_srcdir)/contrib/macdeploy/fancy.plist
28
OSX_INSTALLER_ICONS=$(top_srcdir)/src/qt/res/icons/blackcoin.icns
29
OSX_PLIST=$(top_srcdir)/share/qt/Info.plist #not installed
30
OSX_QT_TRANSLATIONS =
31

32 33
WINDOWS_PACKAGING = \
  $(top_srcdir)/share/pixmaps/blackcoin.ico \
34 35 36 37 38
  $(top_srcdir)/share/pixmaps/nsis-header.bmp \
  $(top_srcdir)/share/pixmaps/nsis-wizard.bmp \
  $(top_srcdir)/doc/README_windows.txt

OSX_PACKAGING = $(OSX_DEPLOY_SCRIPT) $(OSX_FANCY_PLIST) $(OSX_INSTALLER_ICONS) \
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
  $(top_srcdir)/contrib/macdeploy/$(OSX_BACKGROUND_IMAGE) \
  $(OSX_DSSTORE_GEN)

COVERAGE_INFO = \
  baseline_filtered_combined.info \
  baseline.info \
  block_test.info \
  leveldb_baseline.info \
  test_blackcoin_filtered.info \
  total_coverage.info \
  baseline_filtered.info \
  block_test_filtered.info \
  leveldb_baseline_filtered.info \
  test_blackcoin_coverage.info \
  test_blackcoin.info
54 55 56 57

dist-hook:
	-$(GIT) archive --format=tar HEAD -- src/version.cpp | $(AMTAR) -C $(top_distdir) -xf -

58
$(BLACKCOIN_WIN_INSTALLER): all-recursive
59
	$(MKDIR_P) $(top_builddir)/release
60 61 62 63
	STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BLACKCOIND_BIN) $(top_builddir)/release
	STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BLACKCOIN_QT_BIN) $(top_builddir)/release
	STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BLACKCOIN_CLI_BIN) $(top_builddir)/release
	@test -f $(MAKENSIS) && $(MAKENSIS) -V2 $(top_builddir)/share/setup.nsi || \
64
	  echo error: could not build $@
65
	@echo built $@
66

67 68
$(if $(findstring src/,$(MAKECMDGOALS)),$(MAKECMDGOALS), none): FORCE
	$(MAKE) -C src $(patsubst src/%,%,$@)
69 70 71 72 73 74 75 76 77 78 79

$(OSX_APP)/Contents/PkgInfo:
	$(MKDIR_P) $(@D)
	@echo "APPL????" > $@

$(OSX_APP)/Contents/Resources/empty.lproj:
	$(MKDIR_P) $(@D)
	@touch $@

$(OSX_APP)/Contents/Info.plist: $(OSX_PLIST)
	$(MKDIR_P) $(@D)
80
	$(INSTALL_DATA) $< $@
81 82 83

$(OSX_APP)/Contents/Resources/bitcoin.icns: $(OSX_INSTALLER_ICONS)
	$(MKDIR_P) $(@D)
84
	$(INSTALL_DATA) $< $@
85 86 87

$(OSX_APP)/Contents/MacOS/Bitcoin-Qt: $(BITCOIN_QT_BIN)
	$(MKDIR_P) $(@D)
88 89 90 91 92
	STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM)  $< $@

$(OSX_APP)/Contents/Resources/Base.lproj/InfoPlist.strings:
	$(MKDIR_P) $(@D)
	echo '{	CFBundleDisplayName = "$(PACKAGE_NAME)"; CFBundleName = "$(PACKAGE_NAME)"; }' > $@
93 94 95

OSX_APP_BUILT=$(OSX_APP)/Contents/PkgInfo $(OSX_APP)/Contents/Resources/empty.lproj \
  $(OSX_APP)/Contents/Resources/bitcoin.icns $(OSX_APP)/Contents/Info.plist \
96 97 98 99
  $(OSX_APP)/Contents/MacOS/Bitcoin-Qt $(OSX_APP)/Contents/Resources/Base.lproj/InfoPlist.strings

osx_volname:
	echo $(OSX_VOLNAME) >$@
100

101
if BUILD_DARWIN
102
$(OSX_DMG): $(OSX_APP_BUILT) $(OSX_PACKAGING)
103 104 105 106 107 108
	$(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)

deploydir: $(OSX_DMG)
else
APP_DIST_DIR=$(top_builddir)/dist
APP_DIST_EXTRAS=$(APP_DIST_DIR)/.background/$(OSX_BACKGROUND_IMAGE) $(APP_DIST_DIR)/.DS_Store $(APP_DIST_DIR)/Applications
109

110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133
$(APP_DIST_DIR)/Applications:
	@rm -f $@
	@cd $(@D); $(LN_S) /Applications $(@F)

$(APP_DIST_EXTRAS): $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Blackcoin-Qt

$(OSX_DMG): $(APP_DIST_EXTRAS)
	$(GENISOIMAGE) -no-cache-inodes -D -l -probe -V "$(OSX_VOLNAME)" -no-pad -r -dir-mode 0755 -apple -o $@ dist

dpi%.$(OSX_BACKGROUND_IMAGE): contrib/macdeploy/$(OSX_BACKGROUND_SVG)
	sed 's/PACKAGE_NAME/$(PACKAGE_NAME)/' < "$<" | $(RSVG_CONVERT) -f png -d $* -p $* | $(IMAGEMAGICK_CONVERT) - $@
OSX_BACKGROUND_IMAGE_DPIFILES := $(foreach dpi,$(OSX_BACKGROUND_IMAGE_DPIS),dpi$(dpi).$(OSX_BACKGROUND_IMAGE))
$(APP_DIST_DIR)/.background/$(OSX_BACKGROUND_IMAGE): $(OSX_BACKGROUND_IMAGE_DPIFILES)
	$(MKDIR_P) $(@D)
	$(TIFFCP) -c none $(OSX_BACKGROUND_IMAGE_DPIFILES) $@

$(APP_DIST_DIR)/.DS_Store: $(OSX_DSSTORE_GEN)
	$(PYTHON) $< "$@" "$(OSX_VOLNAME)"

$(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Blackcoin-Qt: $(OSX_APP_BUILT) $(OSX_PACKAGING)
	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

deploydir: $(APP_DIST_EXTRAS)
endif
134 135

if TARGET_DARWIN
136
appbundle: $(OSX_APP_BUILT)
137 138 139
deploy: $(OSX_DMG)
endif
if TARGET_WINDOWS
140
deploy: $(BLACKCOIN_WIN_INSTALLER)
141 142
endif

143 144 145 146 147 148 149 150 151
$(BLACKCOIN_QT_BIN): FORCE
	$(MAKE) -C src qt/$(@F)

$(BLACKCOIND_BIN): FORCE
	$(MAKE) -C src $(@F)

$(BLACKCOIN_CLI_BIN): FORCE
	$(MAKE) -C src $(@F)

152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168
if USE_LCOV

baseline.info:
	$(LCOV) -c -i -d $(abs_builddir)/src -o $@

baseline_filtered.info: baseline.info
	$(LCOV) -r $< "/usr/include/*" -o $@

leveldb_baseline.info: baseline_filtered.info
	$(LCOV) -c -i -d $(abs_builddir)/src/leveldb -b $(abs_builddir)/src/leveldb -o $@

leveldb_baseline_filtered.info: leveldb_baseline.info
	$(LCOV) -r $< "/usr/include/*" -o $@

baseline_filtered_combined.info: leveldb_baseline_filtered.info baseline_filtered.info
	$(LCOV) -a leveldb_baseline_filtered.info -a baseline_filtered.info -o $@

169
test_blackcoin.info: baseline_filtered_combined.info
170
	$(MAKE) -C src/ check
171
	$(LCOV) -c -d $(abs_builddir)/src -t test_blackcoin -o $@
172 173 174
	$(LCOV) -z -d $(abs_builddir)/src
	$(LCOV) -z -d $(abs_builddir)/src/leveldb

175
test_blackcoin_filtered.info: test_blackcoin.info
176 177
	$(LCOV) -r $< "/usr/include/*" -o $@

178 179 180
block_test.info: test_blackcoin_filtered.info
	-@TIMEOUT=15 qa/pull-tester/run-blackcoind-for-test.sh $(JAVA) -Xmx2G -jar $(JAVA_COMPARISON_TOOL) 1 18444
	$(LCOV) -c -d $(abs_builddir)/src --t BlackcoinJBlockTest -o $@
181 182 183 184 185 186
	$(LCOV) -z -d $(abs_builddir)/src
	$(LCOV) -z -d $(abs_builddir)/src/leveldb

block_test_filtered.info: block_test.info
	$(LCOV) -r $< "/usr/include/*" -o $@

187 188
test_blackcoin_coverage.info: baseline_filtered_combined.info test_blackcoin_filtered.info
	$(LCOV) -a baseline_filtered.info -a leveldb_baseline_filtered.info -a test_blackcoin_filtered.info -o $@
189

190 191
total_coverage.info:  baseline_filtered_combined.info test_blackcoin_filtered.info block_test_filtered.info
	$(LCOV) -a baseline_filtered.info -a leveldb_baseline_filtered.info -a test_blackcoin_filtered.info -a block_test_filtered.info -o $@ | $(GREP) "\%" | $(AWK) '{ print substr($$3,2,50) "/" $$5 }' > coverage_percent.txt
192

193
test_blackcoin.coverage/.dirstamp:  test_blackcoin_coverage.info
194 195 196 197 198 199 200
	$(GENHTML) -s $< -o $(@D)
	@touch $@

total.coverage/.dirstamp: total_coverage.info
	$(GENHTML) -s $< -o $(@D)
	@touch $@

201
cov: test_blackcoin.coverage/.dirstamp total.coverage/.dirstamp
202 203 204 205 206

endif

if USE_COMPARISON_TOOL
check-local:
207
	@qa/pull-tester/run-blackcoind-for-test.sh $(JAVA) -Xmx2G -jar $(JAVA_COMPARISON_TOOL) 1 18444
208 209 210 211
endif

EXTRA_DIST = $(top_srcdir)/share/genbuild.sh qa/pull-tester/pull-tester.sh $(WINDOWS_PACKAGING) $(OSX_PACKAGING)

212
CLEANFILES = $(OSX_DMG) $(Blackcoin_WIN_INSTALLER)
213 214 215 216

.INTERMEDIATE: $(OSX_APP_BUILT) $(COVERAGE_INFO)

clean-local:
217
	rm -rf test_blackcoin.coverage/ total.coverage/