]> git.saurik.com Git - apple/icu.git/blame - icuSources/config/dist.mk
ICU-66108.tar.gz
[apple/icu.git] / icuSources / config / dist.mk
CommitLineData
f3c0d7a5
A
1# Copyright (C) 2016 and later: Unicode, Inc. and others.
2# License & terms of use: http://www.unicode.org/copyright.html
729e4ab9
A
3#******************************************************************************
4#
4388f060 5# Copyright (C) 2010-2011, International Business Machines Corporation and others. All Rights Reserved.
729e4ab9
A
6#
7#******************************************************************************
8# This is to be called from ../Makefile.in
9#
10# This will only work if subversion is installed.
f3c0d7a5 11# You must checkout ICU4C at the `/icu` or `/icu/icu4c` level - not just `…/source`
3d1f044b 12# also note that `make dist` does NOT reflect any local modifications, but pulls from HEAD.
729e4ab9
A
13
14top_builddir = .
15
16include $(top_builddir)/icudefs.mk
17
0f5d89e8 18DISTY_DIR=dist
729e4ab9
A
19DISTY_TMP=dist/tmp
20DISTY_ICU=$(DISTY_TMP)/icu
21DISTY_DATA=$(DISTY_ICU)/source/data
3d1f044b 22# The following line controls what is removed in the data/ subdirectory for the source tarball.
0f5d89e8 23DISTY_RMV=brkitr coll curr lang locales mappings rbnf region translit xml zone misc/*.txt misc/*.mk unit
729e4ab9
A
24DISTY_RMDIR=$(DISTY_RMV:%=$(DISTY_DATA)/%)
25DISTY_IN=$(DISTY_DATA)/in
26DOCZIP=icu-docs.zip
27
3d1f044b
A
28ICU4CTOP=$(top_srcdir)/..
29GITVER=$(shell (cd $(ICU4CTOP) && (git describe --tags --exact-match 2>/dev/null || git rev-parse --short HEAD)) || echo 'unknown')
729e4ab9
A
30DISTY_VER=$(shell echo $(VERSION) | tr '.' '_' )
31DISTY_PREFIX=icu4c
32DISTY_FILE_DIR=$(shell pwd)/$(DISTY_DIR)
3d1f044b
A
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
0f5d89e8 37DISTY_DAT:=$(firstword $(wildcard data/out/tmp/icudt$(SO_TARGET_VERSION_MAJOR)*.dat))
729e4ab9
A
38
39DISTY_FILES_SRC=$(DISTY_FILE_TGZ) $(DISTY_FILE_ZIP)
40DISTY_FILES=$(DISTY_FILES_SRC) $(DISTY_DOC_ZIP)
0f5d89e8
A
41# colon-equals because we watn to run this once!
42EXCLUDES_FILE:=$(shell mktemp)
729e4ab9 43
729e4ab9
A
44$(DISTY_FILE_DIR):
45 $(MKINSTALLDIRS) $(DISTY_FILE_DIR)
46
47$(DISTY_TMP):
48 $(MKINSTALLDIRS) $(DISTY_TMP)
49
f3c0d7a5 50$(DISTY_DOC_ZIP): $(DOCZIP) $(DISTY_FILE_DIR)
729e4ab9 51 cp $(DOCZIP) $(DISTY_DOC_ZIP)
0f5d89e8 52 ln -sf $(shell basename $(DISTY_DOC_ZIP)) $(DISTY_FILE_DIR)/icu4c-docs.zip
3d1f044b 53 ln -f $(DISTY_DOC_ZIP) $(DISTY_FILE_DIR)/icu4c-$(DISTY_VER)-docs.zip
729e4ab9 54
3d1f044b 55$(DISTY_DAT):
729e4ab9
A
56 echo Missing $@
57 /bin/false
58
0f5d89e8 59# make sure we get the non-lgpl docs
729e4ab9 60$(DOCZIP):
0f5d89e8
A
61 -$(RMV) "$(top_builddir)"/doc
62 "$(MAKE)" -C . srcdir="$(srcdir)" top_srcdir="$(top_srcdir)" builddir=. $@
729e4ab9 63
f3c0d7a5 64$(DISTY_FILE_TGZ) $(DISTY_FILE_ZIP) $(DISTY_DATA_ZIP): $(DISTY_DAT) $(DISTY_TMP)
3d1f044b 65 @echo Export icu4c@$(GITVER) to "$(DISTY_TMP)/icu"
729e4ab9
A
66 -$(RMV) $(DISTY_FILE) $(DISTY_TMP)
67 $(MKINSTALLDIRS) $(DISTY_TMP)
3d1f044b 68 ( cd $(ICU4CTOP)/.. && git archive --format=tar --prefix=icu/ HEAD:icu4c/ ) | ( cd "$(DISTY_TMP)" && tar xf - )
4388f060 69 ( cd $(DISTY_TMP)/icu/source ; zip -rlq $(DISTY_DATA_ZIP) data )
729e4ab9 70 $(MKINSTALLDIRS) $(DISTY_IN)
f3c0d7a5 71 echo DISTY_DAT=$(DISTY_DAT)
729e4ab9 72 cp $(DISTY_DAT) $(DISTY_IN)
f3c0d7a5
A
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 )
0f5d89e8
A
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
3d1f044b
A
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
0f5d89e8
A
84 ls -l $(DISTY_FILE_TGZ) $(DISTY_FILE_ZIP) $(DISTY_DATA_ZIP)
85
729e4ab9
A
86
87dist-local: $(DISTY_FILES)
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)" )