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