1# Copyright (C) 2016 and later: Unicode, Inc. and others. 2# License & terms of use: http://www.unicode.org/copyright.html 3#****************************************************************************** 4# 5# Copyright (C) 2010-2011, International Business Machines Corporation and others. All Rights Reserved. 6# 7#****************************************************************************** 8# This is to be called from ../Makefile.in 9# 10# This will only work if subversion is installed. 11 12top_builddir = . 13 14include $(top_builddir)/icudefs.mk 15 16 17DISTY_TMP=dist/tmp 18DISTY_ICU=$(DISTY_TMP)/icu 19DISTY_DATA=$(DISTY_ICU)/source/data 20DISTY_RMV=brkitr coll curr lang locales mappings rbnf region translit xml zone 21DISTY_RMDIR=$(DISTY_RMV:%=$(DISTY_DATA)/%) 22DISTY_IN=$(DISTY_DATA)/in 23DOCZIP=icu-docs.zip 24 25SVNTOP=$(top_srcdir)/.. 26SVNDOT=$(SVNTOP)/.svn 27SVNVER=$(shell svnversion $(SVNTOP) | cut -d: -f1 | tr -cd 'a-zA-Z0-9') 28SVNURL=$(shell svn info $(SVNTOP) | grep '^URL:' | cut -d: -f2-) 29DISTY_VER=$(shell echo $(VERSION) | tr '.' '_' ) 30DISTY_PREFIX=icu4c 31DISTY_FILE_DIR=$(shell pwd)/$(DISTY_DIR) 32DISTY_FILE_TGZ=$(DISTY_FILE_DIR)/$(DISTY_PREFIX)-src-$(DISTY_VER)-r$(SVNVER).tgz 33DISTY_FILE_ZIP=$(DISTY_FILE_DIR)/$(DISTY_PREFIX)-src-$(DISTY_VER)-r$(SVNVER).zip 34DISTY_DOC_ZIP=$(DISTY_FILE_DIR)/$(DISTY_PREFIX)-docs-$(DISTY_VER)-r$(SVNVER).zip 35DISTY_DATA_ZIP=$(DISTY_FILE_DIR)/$(DISTY_PREFIX)-data-$(DISTY_VER)-r$(SVNVER).zip 36DISTY_DAT=$(firstword $(wildcard data/out/tmp/icudt$(SO_TARGET_VERSION_MAJOR)*.dat)) 37 38DISTY_FILES_SRC=$(DISTY_FILE_TGZ) $(DISTY_FILE_ZIP) 39DISTY_FILES=$(DISTY_FILES_SRC) $(DISTY_DOC_ZIP) 40 41$(SVNDOT): 42 @echo "ERROR: 'dist' will not work unless the parent of the top_srcdir ( $(SVNTOP) ) is checked out from svn, and svn is installed." 43 false 44 45$(DISTY_FILE_DIR): 46 $(MKINSTALLDIRS) $(DISTY_FILE_DIR) 47 48$(DISTY_TMP): 49 $(MKINSTALLDIRS) $(DISTY_TMP) 50 51$(DISTY_DOC_ZIP): $(SVNDOT) $(DOCZIP) $(DISTY_FILE_DIR) 52 cp $(DOCZIP) $(DISTY_DOC_ZIP) 53 54$(DISTY_DAT): 55 echo Missing $@ 56 /bin/false 57 58$(DOCZIP): 59 $(MAKE) -C . srcdir="$(srcdir)" top_srcdir="$(top_srcdir)" builddir=. $@ 60 61$(DISTY_FILE_TGZ) $(DISTY_FILE_ZIP) $(DISTY_DATA_ZIP): $(SVNDOT) $(DISTY_DAT) $(DISTY_TMP) 62 @echo "svnversion of $(SVNTOP) is as follows (if this fails, make sure svn is installed..)" 63 svnversion $(SVNTOP) 64 -$(RMV) $(DISTY_FILE) $(DISTY_TMP) 65 $(MKINSTALLDIRS) $(DISTY_TMP) 66 svn export -r $(shell echo $(SVNVER) | tr -d 'a-zA-Z' ) $(SVNURL) "$(DISTY_TMP)/icu" 67 ( cd $(DISTY_TMP)/icu/source ; zip -rlq $(DISTY_DATA_ZIP) data ) 68 $(RMV) $(DISTY_RMDIR) 69 $(MKINSTALLDIRS) $(DISTY_IN) 70 cp $(DISTY_DAT) $(DISTY_IN) 71 ( cd $(DISTY_TMP)/icu ; python as_is/bomlist.py > as_is/bomlist.txt || rm -f as_is/bomlist.txt ) 72 ( cd $(DISTY_TMP) ; tar cfpz $(DISTY_FILE_TGZ) icu ) 73 ( cd $(DISTY_TMP) ; zip -rlq $(DISTY_FILE_ZIP) icu ) 74 ls -l $(DISTY_FILE) 75 76dist-local: $(DISTY_FILES) 77 78distcheck: distcheck-tgz 79 80DISTY_CHECK=$(DISTY_TMP)/check 81 82distcheck-tgz: $(DISTY_FILE_TGZ) 83 @echo Checking $(DISTY_FILE_TGZ) 84 @-$(RMV) $(DISTY_CHECK) 85 @$(MKINSTALLDIRS) $(DISTY_CHECK) 86 @(cd $(DISTY_CHECK) && tar xfpz $(DISTY_FILE_TGZ) && cd icu/source && $(SHELL) ./configure $(DISTCHECK_CONFIG_OPTIONS) && $(MAKE) check $(DISTCHECK_MAKE_OPTIONS) ) && (echo "!!! PASS: $(DISTY_FILE_TGZ)" ) 87