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# You must checkout ICU4C at the `/icu` or `/icu/icu4c` level - not just `…/source` 12# also note that `make dist` does NOT reflect any local modifications, but pulls from HEAD. 13 14top_builddir = . 15 16include $(top_builddir)/icudefs.mk 17 18DISTY_DIR=dist 19DISTY_TMP=dist/tmp 20DISTY_ICU=$(DISTY_TMP)/icu 21DISTY_DATA=$(DISTY_ICU)/source/data 22# The following line controls what is removed in the data/ subdirectory for the source tarball. 23DISTY_RMV=brkitr coll curr lang locales mappings rbnf region translit xml zone misc/*.txt misc/*.mk unit 24DISTY_RMDIR=$(DISTY_RMV:%=$(DISTY_DATA)/%) 25DISTY_IN=$(DISTY_DATA)/in 26DOCZIP=icu-docs.zip 27 28ICU4CTOP=$(top_srcdir)/.. 29GITVER=$(shell (cd $(ICU4CTOP) && (git describe --tags --exact-match 2>/dev/null || git rev-parse --short HEAD)) || echo 'unknown') 30DISTY_VER=$(shell echo $(VERSION) | tr '.' '_' ) 31DISTY_PREFIX=icu4c 32DISTY_FILE_DIR=$(shell pwd)/$(DISTY_DIR) 33DISTY_FILE_TGZ=$(DISTY_FILE_DIR)/$(DISTY_PREFIX)-$(DISTY_VER)-$(GITVER)-src.tgz 34DISTY_FILE_ZIP=$(DISTY_FILE_DIR)/$(DISTY_PREFIX)-$(DISTY_VER)-$(GITVER)-src.zip 35DISTY_DOC_ZIP=$(DISTY_FILE_DIR)/$(DISTY_PREFIX)-$(DISTY_VER)-$(GITVER)-docs.zip 36DISTY_DATA_ZIP=$(DISTY_FILE_DIR)/$(DISTY_PREFIX)-$(DISTY_VER)-$(GITVER)-data.zip 37DISTY_DAT:=$(firstword $(wildcard data/out/tmp/icudt$(SO_TARGET_VERSION_MAJOR)*.dat)) 38 39DISTY_FILES_SRC=$(DISTY_FILE_TGZ) $(DISTY_FILE_ZIP) 40DISTY_FILES=$(DISTY_FILES_SRC) $(DISTY_DOC_ZIP) 41# colon-equals because we watn to run this once! 42EXCLUDES_FILE:=$(shell mktemp) 43 44$(DISTY_FILE_DIR): 45 $(MKINSTALLDIRS) $(DISTY_FILE_DIR) 46 47$(DISTY_TMP): 48 $(MKINSTALLDIRS) $(DISTY_TMP) 49 50$(DISTY_DOC_ZIP): $(DOCZIP) $(DISTY_FILE_DIR) 51 cp $(DOCZIP) $(DISTY_DOC_ZIP) 52 ln -sf $(shell basename $(DISTY_DOC_ZIP)) $(DISTY_FILE_DIR)/icu4c-docs.zip 53 ln -f $(DISTY_DOC_ZIP) $(DISTY_FILE_DIR)/icu4c-$(DISTY_VER)-docs.zip 54 55$(DISTY_DAT): 56 echo Missing $@ 57 /bin/false 58 59# make sure we get the non-lgpl docs 60$(DOCZIP): 61 -$(RMV) "$(top_builddir)"/doc 62 "$(MAKE)" -C . srcdir="$(srcdir)" top_srcdir="$(top_srcdir)" builddir=. $@ 63 64$(DISTY_FILE_TGZ) $(DISTY_FILE_ZIP) $(DISTY_DATA_ZIP): $(DISTY_DAT) $(DISTY_TMP) 65 @echo Export icu4c@$(GITVER) to "$(DISTY_TMP)/icu" 66 -$(RMV) $(DISTY_FILE) $(DISTY_TMP) 67 $(MKINSTALLDIRS) $(DISTY_TMP) 68 ( cd $(ICU4CTOP)/.. && git archive --format=tar --prefix=icu/ HEAD:icu4c/ ) | ( cd "$(DISTY_TMP)" && tar xf - ) 69 ( cd $(DISTY_TMP)/icu/source ; zip -rlq $(DISTY_DATA_ZIP) data ) 70 $(MKINSTALLDIRS) $(DISTY_IN) 71 echo DISTY_DAT=$(DISTY_DAT) 72 cp $(DISTY_DAT) $(DISTY_IN) 73 $(RMV) $(DISTY_RMDIR) 74 ( cd $(DISTY_TMP)/icu ; python as_is/bomlist.py > as_is/bomlist.txt || rm -f as_is/bomlist.txt ) 75 ( cd $(DISTY_TMP) ; tar cfpz $(DISTY_FILE_TGZ) icu ) 76 ( cd $(DISTY_TMP) ; zip -rlq $(DISTY_FILE_ZIP) icu ) 77 $(RMV) $(DISTY_TMP) 78 ln -sf $(shell basename $(DISTY_FILE_ZIP)) $(DISTY_FILE_DIR)/icu4c-src.zip 79 ln -sf $(shell basename $(DISTY_FILE_TGZ)) $(DISTY_FILE_DIR)/icu4c-src.tgz 80 ln -sf $(shell basename $(DISTY_DATA_ZIP)) $(DISTY_FILE_DIR)/icu4c-data.zip 81 ln -f $(DISTY_FILE_ZIP) $(DISTY_FILE_DIR)/icu4c-$(DISTY_VER)-src.zip 82 ln -f $(DISTY_FILE_TGZ) $(DISTY_FILE_DIR)/icu4c-$(DISTY_VER)-src.tgz 83 ln -f $(DISTY_DATA_ZIP) $(DISTY_FILE_DIR)/icu4c-$(DISTY_VER)-data.zip 84 ls -l $(DISTY_FILE_TGZ) $(DISTY_FILE_ZIP) $(DISTY_DATA_ZIP) 85 86dist-local: $(DISTY_FILES) 87 VERSION=$(VERSION) $(SHELL) $(top_srcdir)/config/dist-data.sh 88 89distcheck: distcheck-tgz 90 91DISTY_CHECK=$(DISTY_TMP)/check 92 93distcheck-tgz: $(DISTY_FILE_TGZ) 94 @echo Checking $(DISTY_FILE_TGZ) 95 @-$(RMV) $(DISTY_CHECK) 96 @$(MKINSTALLDIRS) $(DISTY_CHECK) 97 @(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)" ) 98