1 #******************************************************************************
3 # Copyright (C) 2010, International Business Machines Corporation and others. All Rights Reserved.
5 #******************************************************************************
6 # This is to be called from ../Makefile.in
8 # This will only work if subversion is installed.
12 include $(top_builddir)/icudefs.mk
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
23 SVNTOP=$(top_srcdir)/..
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 '.' '_' )
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))
35 DISTY_FILES_SRC=$(DISTY_FILE_TGZ) $(DISTY_FILE_ZIP)
36 DISTY_FILES=$(DISTY_FILES_SRC) $(DISTY_DOC_ZIP)
39 @echo "ERROR: 'dist' will not work unless the parent of the top_srcdir ( $(SVNTOP) ) is checked out from svn, and svn is installed."
43 $(MKINSTALLDIRS) $(DISTY_FILE_DIR)
46 $(MKINSTALLDIRS) $(DISTY_TMP)
48 $(DISTY_DOC_ZIP): $(SVNDOT) $(DOCZIP) $(DISTY_FILE_DIR)
49 cp $(DOCZIP) $(DISTY_DOC_ZIP)
56 $(MAKE) -C . srcdir="$(srcdir)" top_srcdir="$(top_srcdir)" builddir=. $@
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..)"
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"
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 )
71 dist-local: $(DISTY_FILES)
73 distcheck: distcheck-tgz
75 DISTY_CHECK=$(DISTY_TMP)/check
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)" )