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 12 top_builddir = . 13 14 include $(top_builddir)/icudefs.mk 15 16 17 DISTY_TMP=dist/tmp 18 DISTY_ICU=$(DISTY_TMP)/icu 19 DISTY_DATA=$(DISTY_ICU)/source/data 20 DISTY_RMV=brkitr coll curr lang locales mappings rbnf region translit xml zone 21 DISTY_RMDIR=$(DISTY_RMV:%=$(DISTY_DATA)/%) 22 DISTY_IN=$(DISTY_DATA)/in 23 DOCZIP=icu-docs.zip 24 25 SVNTOP=$(top_srcdir)/.. 26 SVNDOT=$(SVNTOP)/.svn 27 SVNVER=$(shell svnversion $(SVNTOP) | cut -d: -f1 | tr -cd 'a-zA-Z0-9') 28 SVNURL=$(shell svn info $(SVNTOP) | grep '^URL:' | cut -d: -f2-) 29 DISTY_VER=$(shell echo $(VERSION) | tr '.' '_' ) 30 DISTY_PREFIX=icu4c 31 DISTY_FILE_DIR=$(shell pwd)/$(DISTY_DIR) 32 DISTY_FILE_TGZ=$(DISTY_FILE_DIR)/$(DISTY_PREFIX)-src-$(DISTY_VER)-r$(SVNVER).tgz 33 DISTY_FILE_ZIP=$(DISTY_FILE_DIR)/$(DISTY_PREFIX)-src-$(DISTY_VER)-r$(SVNVER).zip 34 DISTY_DOC_ZIP=$(DISTY_FILE_DIR)/$(DISTY_PREFIX)-docs-$(DISTY_VER)-r$(SVNVER).zip 35 DISTY_DATA_ZIP=$(DISTY_FILE_DIR)/$(DISTY_PREFIX)-data-$(DISTY_VER)-r$(SVNVER).zip 36 DISTY_DAT=$(firstword $(wildcard data/out/tmp/icudt$(SO_TARGET_VERSION_MAJOR)*.dat)) 37 38 DISTY_FILES_SRC=$(DISTY_FILE_TGZ) $(DISTY_FILE_ZIP) 39 DISTY_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 76 dist-local: $(DISTY_FILES) 77 78 distcheck: distcheck-tgz 79 80 DISTY_CHECK=$(DISTY_TMP)/check 81 82 distcheck-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