• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
10top_builddir = .
11
12include $(top_builddir)/icudefs.mk
13
14
15DISTY_TMP=dist/tmp
16DISTY_ICU=$(DISTY_TMP)/icu
17DISTY_DATA=$(DISTY_ICU)/source/data
18DISTY_RMV=brkitr coll curr lang locales mappings rbnf region translit xml zone
19DISTY_RMDIR=$(DISTY_RMV:%=$(DISTY_DATA)/%)
20DISTY_IN=$(DISTY_DATA)/in
21DOCZIP=icu-docs.zip
22
23SVNTOP=$(top_srcdir)/..
24SVNDOT=$(SVNTOP)/.svn
25SVNVER=$(shell svnversion $(SVNTOP) | cut -d: -f1 | tr -cd 'a-zA-Z0-9')
26SVNURL=$(shell svn info $(SVNTOP) | grep '^URL:' | cut -d: -f2-)
27DISTY_VER=$(shell echo $(VERSION) | tr '.' '_' )
28DISTY_PREFIX=icu4c
29DISTY_FILE_DIR=$(shell pwd)/$(DISTY_DIR)
30DISTY_FILE_TGZ=$(DISTY_FILE_DIR)/$(DISTY_PREFIX)-src-$(DISTY_VER)-r$(SVNVER).tgz
31DISTY_FILE_ZIP=$(DISTY_FILE_DIR)/$(DISTY_PREFIX)-src-$(DISTY_VER)-r$(SVNVER).zip
32DISTY_DOC_ZIP=$(DISTY_FILE_DIR)/$(DISTY_PREFIX)-docs-$(DISTY_VER)-r$(SVNVER).zip
33DISTY_DAT=$(firstword $(wildcard data/out/tmp/icudt$(SO_TARGET_VERSION_MAJOR)*.dat))
34
35DISTY_FILES_SRC=$(DISTY_FILE_TGZ) $(DISTY_FILE_ZIP)
36DISTY_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
71dist-local: $(DISTY_FILES)
72
73distcheck: distcheck-tgz
74
75DISTY_CHECK=$(DISTY_TMP)/check
76
77distcheck-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)" )
82