1 # Copyright (C) 2016 and later: Unicode, Inc. and others.
2 # License & terms of use: http://www.unicode.org/copyright.html
3 #******************************************************************************
5 # Copyright (C) 2010-2011, International Business Machines Corporation and others. All Rights Reserved.
7 #******************************************************************************
8 # This is to be called from ../Makefile.in
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.
16 include $(top_builddir)/icudefs.mk
20 DISTY_ICU=$(DISTY_TMP)/icu
21 DISTY_DATA=$(DISTY_ICU)/source/data
22 # The following line controls what is removed in the data/ subdirectory for the source tarball.
23 DISTY_RMV=brkitr coll curr lang locales mappings rbnf region translit xml zone misc/*.txt misc/*.mk unit
24 DISTY_RMDIR=$(DISTY_RMV:%=$(DISTY_DATA)/%)
25 DISTY_IN=$(DISTY_DATA)/in
28 ICU4CTOP=$(top_srcdir)/..
29 GITVER=$(shell (cd $(ICU4CTOP) && (git describe --tags --exact-match 2>/dev/null || git rev-parse --short HEAD)) || echo 'unknown')
30 DISTY_VER=$(shell echo $(VERSION) | tr '.' '_' )
32 DISTY_FILE_DIR=$(shell pwd)/$(DISTY_DIR)
33 DISTY_FILE_TGZ=$(DISTY_FILE_DIR)/$(DISTY_PREFIX)-$(DISTY_VER)-$(GITVER)-src.tgz
34 DISTY_FILE_ZIP=$(DISTY_FILE_DIR)/$(DISTY_PREFIX)-$(DISTY_VER)-$(GITVER)-src.zip
35 DISTY_DOC_ZIP=$(DISTY_FILE_DIR)/$(DISTY_PREFIX)-$(DISTY_VER)-$(GITVER)-docs.zip
36 DISTY_DATA_ZIP=$(DISTY_FILE_DIR)/$(DISTY_PREFIX)-$(DISTY_VER)-$(GITVER)-data.zip
37 DISTY_DAT:=$(firstword $(wildcard data/out/tmp/icudt$(SO_TARGET_VERSION_MAJOR)*.dat))
39 DISTY_FILES_SRC=$(DISTY_FILE_TGZ) $(DISTY_FILE_ZIP)
40 DISTY_FILES=$(DISTY_FILES_SRC) $(DISTY_DOC_ZIP)
41 # colon-equals because we watn to run this once!
42 EXCLUDES_FILE:=$(shell mktemp)
45 $(MKINSTALLDIRS) $(DISTY_FILE_DIR)
48 $(MKINSTALLDIRS) $(DISTY_TMP)
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
59 # make sure we get the non-lgpl docs
61 -$(RMV) "$(top_builddir)"/doc
62 "$(MAKE)" -C . srcdir="$(srcdir)" top_srcdir="$(top_srcdir)" builddir=. $@
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)
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 )
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)
87 dist-local: $(DISTY_FILES)
89 distcheck: distcheck-tgz
91 DISTY_CHECK=$(DISTY_TMP)/check
93 distcheck-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)" )