]> git.saurik.com Git - apple/icu.git/blame - icuSources/data/Makefile.in
ICU-491.11.1.tar.gz
[apple/icu.git] / icuSources / data / Makefile.in
CommitLineData
b75a7d8f 1## Makefile.in for ICU data
4388f060 2## Copyright (c) 1999-2012, International Business Machines Corporation and
b75a7d8f
A
3## others. All Rights Reserved.
4
5## Source directory information
6srcdir = @srcdir@
7top_srcdir = @top_srcdir@
8
9# So that you have $(top_builddir)/config.status
10top_builddir = ..
11
12## All the flags and other definitions are included here.
13include $(top_builddir)/icudefs.mk
14
15## Build directory information
16# So that $(top_builddir)/$(subdir) ~= "here"
17subdir = data
18
19#lib icu data for link
374ca955
A
20LIB_ICUDATA_NAME=$(LIBICU)$(DATA_STUBNAME)$(ICULIBSUFFIX)
21LIB_STATIC_ICUDATA_NAME=$(LIBSICU)$(DATA_STUBNAME)$(ICULIBSUFFIX)
b75a7d8f 22
374ca955
A
23# Allow Windows to override these options
24ifeq ($(PKGDATA_OPTS),)
25PKGDATA_OPTS = -O $(top_builddir)/data/icupkg.inc
26endif
27ifeq ($(PKGDATA_VERSIONING),)
28PKGDATA_VERSIONING = -r $(SO_TARGET_VERSION)
29endif
30
31# This allows all the data to be in one directory
32ifeq ($(PKGDATA_MODE),dll)
33ICUPKGDATA_OUTDIR = $(LIBDIR)
34else
729e4ab9
A
35ifeq ($(PKGDATA_MODE),static)
36ICUPKGDATA_OUTDIR = $(LIBDIR)
37else
374ca955
A
38ICUPKGDATA_OUTDIR = $(OUTDIR)
39endif
729e4ab9 40endif
b75a7d8f 41
374ca955 42CURDIR:=$(CURR_FULL_DIR)
729e4ab9
A
43# current directory should not be blank
44ifeq ($(CURDIR),)
45CURDIR=.
46endif
47PKGDATA = $(TOOLBINDIR)/pkgdata $(PKGDATA_OPTS) -q -c -s $(CURDIR)/out/build/$(ICUDATA_PLATFORM_NAME) -d $(ICUPKGDATA_OUTDIR)
4388f060 48OS390_PDS_NAME = -z -L $(BATCH_STUB_TARGET)
374ca955 49
73c04bcf
A
50ifeq ($(OS390_STUBDATA),1)
51OS390PKG=package390
52OS390INSTALL=install390
53
54# Additional data for 390
55OS390LIST=$(OUTTMPDIR)/icudata390.lst
56OUTTMPDIR_390STUB=$(top_builddir)/data/out/tmp_390stub
57endif
b75a7d8f
A
58
59# OBJDATADIR must be a short path (with ..'s) to the data.
60
374ca955
A
61ifeq ($(top_srcdir),..)
62SRCDATADIR=.
63else
b75a7d8f 64SRCDATADIR=$(top_srcdir)/data
374ca955
A
65endif
66ifeq ($(top_builddir),..)
67OUTDIR=./out
68else
b75a7d8f 69OUTDIR=$(top_builddir)/data/out
374ca955
A
70endif
71
72OUTTMPDIR=$(OUTDIR)/tmp
73c04bcf
A
73MAINBUILDDIR=$(OUTDIR)/build
74BUILDDIR=$(MAINBUILDDIR)/$(ICUDATA_PLATFORM_NAME)
b75a7d8f
A
75UNICODEDATADIR=$(SRCDATADIR)/unidata
76LOCSRCDIR=$(SRCDATADIR)/locales
729e4ab9
A
77CURRSRCDIR=$(SRCDATADIR)/curr
78CURRBLDDIR=$(BUILDDIR)/curr
79LANGSRCDIR=$(SRCDATADIR)/lang
80LANGBLDDIR=$(BUILDDIR)/lang
81REGIONSRCDIR=$(SRCDATADIR)/region
82REGIONBLDDIR=$(BUILDDIR)/region
83ZONESRCDIR=$(SRCDATADIR)/zone
84ZONEBLDDIR=$(BUILDDIR)/zone
374ca955
A
85COLSRCDIR=$(SRCDATADIR)/coll
86COLBLDDIR=$(BUILDDIR)/coll
87RBNFSRCDIR=$(SRCDATADIR)/rbnf
88RBNFBLDDIR=$(BUILDDIR)/rbnf
89TRANSLITSRCDIR=$(SRCDATADIR)/translit
90TRANSLITBLDDIR=$(BUILDDIR)/translit
91MISCSRCDIR=$(SRCDATADIR)/misc
b75a7d8f 92BRKSRCDIR=$(SRCDATADIR)/brkitr
73c04bcf 93BRKBLDDIR=$(BUILDDIR)/brkitr
b75a7d8f
A
94MISCSRCDIR=$(SRCDATADIR)/misc
95UCMSRCDIR=$(SRCDATADIR)/mappings
729e4ab9 96SPREPSRCDIR=$(SRCDATADIR)/sprep
b75a7d8f
A
97COMINCDIR=$(top_srcdir)/common/unicode
98SRCLISTDEPS=Makefile $(srcdir)/Makefile.in
729e4ab9 99BUILD_DIRS=$(OUTDIR) $(MAINBUILDDIR) $(BUILDDIR) $(CURRBLDDIR) $(LANGBLDDIR) $(REGIONBLDDIR) $(ZONEBLDDIR) $(BRKBLDDIR) $(COLBLDDIR) $(RBNFBLDDIR) $(TRANSLITBLDDIR) $(OUTTMPDIR) $(OUTTMPDIR_390STUB) $(OUTTMPDIR)/$(CURR_TREE) $(OUTTMPDIR)/$(LANG_TREE) $(OUTTMPDIR)/$(REGION_TREE) $(OUTTMPDIR)/$(ZONE_TREE) $(OUTTMPDIR)/$(COLLATION_TREE) $(OUTTMPDIR)/$(RBNF_TREE) $(OUTTMPDIR)/$(TRANSLIT_TREE) $(OUTTMPDIR)/$(BREAK_TREE)
b75a7d8f
A
100
101# relative lib links from pkgdata are the same as for tmp
102TOOLDIR=$(top_builddir)/tools
103
104## List of phony targets
374ca955 105.PHONY : all all-local all-recursive install install-local install-files \
b75a7d8f
A
106install-recursive clean clean-local clean-recursive distclean \
107distclean-local distclean-recursive dist dist-local dist-recursive \
4388f060
A
108check check-local check-recursive build-local clean-resindex build-dir icudata.jar \
109check-exhaustive
b75a7d8f
A
110
111## Clear suffix list
112.SUFFIXES :
113
114## List of standard targets
115all: all-local
116install: all-local install-local
117clean: clean-local
118distclean : distclean-local
119dist:
120check: all
121
4388f060
A
122check-exhaustive: check
123
729e4ab9
A
124-include Makefile.local
125
b75a7d8f
A
126
127distclean-local: clean
128 $(RMV) Makefile
129
374ca955 130all-local: build-dir icupkg.inc build-local packagedata $(POST_DATA_BUILD) $(OS390PKG)
b75a7d8f
A
131
132dist-local:
133
134clean-map:
135 -test -z *.map || $(RMV) *.map
136
137clean-local: cleanpackage cleanfiles clean-map
b75a7d8f
A
138
139cleanfiles:
140 test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES)
141
142cleanpackage:
143 $(RMV) $(OUTDIR)
374ca955 144 $(RMV) $(LIBDIR)/$(LIB_ICUDATA_NAME)*.$(SO)* $(LIBDIR)/$(LIB_STATIC_ICUDATA_NAME).$(A)
b75a7d8f
A
145
146check-local:
147
73c04bcf
A
148# Find out if we have a source archive.
149# If we have that, then use that instead of building everything from scratch.
150ICUDATA_SOURCE_ARCHIVE = $(wildcard $(srcdir)/in/$(ICUDATA_PLATFORM_NAME).dat)
151ifeq ($(ICUDATA_SOURCE_ARCHIVE),)
152ICUDATA_ARCHIVE = $(firstword $(wildcard $(srcdir)/in/$(ICUDATA_BASENAME_VERSION)*.dat))
153# We don't have the data in the current endianess or charset.
154# See if we can find data of any archive type,
155# and convert it to the current type.
156ifneq ($(ICUDATA_ARCHIVE),)
157ICUDATA_SOURCE_ARCHIVE = $(OUTDIR)/$(ICUDATA_PLATFORM_NAME).dat
158$(ICUDATA_SOURCE_ARCHIVE): $(ICUDATA_ARCHIVE) $(OUTDIR)
729e4ab9 159 $(INVOKE) $(TOOLBINDIR)/icupkg -t$(ICUDATA_CHAR) $(ICUDATA_ARCHIVE) $(ICUDATA_SOURCE_ARCHIVE)
73c04bcf
A
160endif
161else
162ifneq ($(ENABLE_STATIC),YES)
163ifeq ($(PKGDATA_MODE),common)
164# We have a source data common archive in the native endianess,
165# and it's what we want to build. Try to not run any of ICU's tools.
166ICUDATA_SOURCE_IS_NATIVE_TARGET=YES
167endif
168endif
169endif
170
46f4442e 171packagedata: icupkg.inc $(PKGDATA_LIST) build-local
b75a7d8f 172ifneq ($(ENABLE_STATIC),)
46f4442e 173ifeq ($(PKGDATA_MODE),dll)
729e4ab9 174 $(PKGDATA_INVOKE) $(PKGDATA) -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -p $(ICUDATA_NAME) $(PKGDATA_LIBSTATICNAME) -m static $(PKGDATA_VERSIONING) $(PKGDATA_LIST)
46f4442e 175endif
b75a7d8f 176endif
73c04bcf 177ifneq ($(ICUDATA_SOURCE_IS_NATIVE_TARGET),YES)
46f4442e 178 $(PKGDATA_INVOKE) $(PKGDATA) -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -p $(ICUDATA_NAME) -m $(PKGDATA_MODE) $(PKGDATA_VERSIONING) $(PKGDATA_LIBNAME) $(PKGDATA_LIST)
4388f060
A
179ifeq ($(OS390BATCH),1)
180 $(PKGDATA_INVOKE) $(PKGDATA) -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -p $(ICUDATA_NAME) -m $(PKGDATA_MODE) $(PKGDATA_VERSIONING) $(OS390_PDS_NAME) $(PKGDATA_LIST)
181endif
73c04bcf
A
182else
183 $(INSTALL_DATA) $(ICUDATA_SOURCE_ARCHIVE) $(OUTDIR)
184endif
b75a7d8f
A
185
186## Install ICU data.
46f4442e 187install-local: $(PKGDATA_LIST) ./icupkg.inc packagedata $(OS390INSTALL)
b75a7d8f 188 $(MKINSTALLDIRS) $(TMPDATADIR) $(DESTDIR)$(ICUPKGDATA_DIR)
729e4ab9
A
189ifeq ($(PKGDATA_MODE),files)
190 $(MKINSTALLDIRS) $(ICUPKGDATA_DIR)/$(ICUDATA_NAME)
191 $(MKINSTALLDIRS) $(ICUPKGDATA_DIR)/$(ICUDATA_NAME)/$(CURR_TREE)
192 $(MKINSTALLDIRS) $(ICUPKGDATA_DIR)/$(ICUDATA_NAME)/$(LANG_TREE)
193 $(MKINSTALLDIRS) $(ICUPKGDATA_DIR)/$(ICUDATA_NAME)/$(REGION_TREE)
194 $(MKINSTALLDIRS) $(ICUPKGDATA_DIR)/$(ICUDATA_NAME)/$(ZONE_TREE)
195 $(MKINSTALLDIRS) $(ICUPKGDATA_DIR)/$(ICUDATA_NAME)/$(BREAK_TREE)
196 $(MKINSTALLDIRS) $(ICUPKGDATA_DIR)/$(ICUDATA_NAME)/$(COLLATION_TREE)
197 $(MKINSTALLDIRS) $(ICUPKGDATA_DIR)/$(ICUDATA_NAME)/$(RBNF_TREE)
198 $(MKINSTALLDIRS) $(ICUPKGDATA_DIR)/$(ICUDATA_NAME)/$(TRANSLIT_TREE)
199endif
b75a7d8f 200ifneq ($(ENABLE_STATIC),)
46f4442e
A
201ifeq ($(PKGDATA_MODE),dll)
202 $(PKGDATA_INVOKE) $(PKGDATA) -m static -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -s $(BUILDDIR) -p $(ICUDATA_NAME) $(PKGDATA_LIBSTATICNAME) $(PKGDATA_LIST) -I $(ICUPKGDATA_INSTALL_LIBDIR)
203endif
b75a7d8f 204endif
73c04bcf 205ifneq ($(ICUDATA_SOURCE_IS_NATIVE_TARGET),YES)
46f4442e 206 $(PKGDATA_INVOKE) $(PKGDATA) -m $(PKGDATA_MODE) $(PKGDATA_VERSIONING) -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -s $(BUILDDIR) -p $(ICUDATA_NAME) $(PKGDATA_LIBNAME) $(PKGDATA_LIST) -I $(ICUPKGDATA_INSTALL_DIR)
73c04bcf
A
207else
208 $(INSTALL_DATA) $(ICUDATA_SOURCE_ARCHIVE) $(DESTDIR)$(ICUPKGDATA_DIR)
209endif
b75a7d8f 210
b75a7d8f
A
211
212####
213####
214#### 390 support
374ca955 215install390: package390
b75a7d8f 216 $(MKINSTALLDIRS) $(TMPDATADIR) $(DESTDIR)$(libdir)
374ca955 217 $(INVOKE) $(PKGDATA) -s $(BUILDDIR)$(STUB_SUFFIX) -T $(OUTTMPDIR_390STUB) -p $(ICUDATA_NAME)$(STUB_SUFFIX) $(PKGDATA_LIBNAME)$(STUB_SUFFIX) -e $(ICUDATA_ENTRY_POINT) $(OS390LIST) -m dll $(PKGDATA_VERSIONING) -I $(DESTDIR)$(ICUPKGDATA_DIR)
b75a7d8f 218ifeq ($(PKGDATA_MODE),dll)
729e4ab9 219 $(INSTALL-L) $(ICUPKGDATA_OUTDIR)/$(FINAL_IMPORT_LIB) $(DESTDIR)$(ICUPKGDATA_DIR)/$(FINAL_IMPORT_LIB)
b75a7d8f
A
220endif
221
374ca955 222#### $(LIB_ICUDATA_NAME)$(STUB_SUFFIX) is the subset data for batch mode
46f4442e 223package390: $(OUTTMPDIR)/icudata390.lst $(PKGDATA_LIST) ./icupkg.inc packagedata
374ca955
A
224 ln -s $(ICUDATA_NAME) $(OUTDIR)/build/$(ICUDATA_NAME)$(STUB_SUFFIX)
225 $(INVOKE) $(PKGDATA) -s $(BUILDDIR)$(STUB_SUFFIX) -T $(OUTTMPDIR_390STUB) -p $(ICUDATA_NAME)$(STUB_SUFFIX) $(PKGDATA_LIBNAME)$(STUB_SUFFIX) -e $(ICUDATA_ENTRY_POINT) $(OS390LIST) -m dll $(PKGDATA_VERSIONING)
226 cp $(ICUPKGDATA_OUTDIR)/$(LIB_ICUDATA_NAME)$(STUB_SUFFIX).$(SO) $(top_builddir)/stubdata/$(LIB_ICUDATA_NAME)$(STUB_SUFFIX).$(SO)
b75a7d8f
A
227
228
229##### Define all the data files. the build rule that depends on them is below.
374ca955
A
230# X_FILES_SHORT = just the base names (for lists)
231# X_FILES = full paths (for dependency)
b75a7d8f
A
232
233## DAT files - Misc. data files.
73c04bcf
A
234# 2005-may-05 Removed Unicode properties files (unorm.icu, uprops.icu, ucase.icu, ubidi.icu)
235# from data build. See Jitterbug 4497. (makedata.mak revision 1.117)
4388f060
A
236# 2010-dec Removed pnames.icu.
237# These are now hardcoded in ICU4C and only loaded in ICU4J.
73c04bcf 238#
4388f060 239DAT_FILES_SHORT=unames.icu cnvalias.icu coll/ucadata.icu coll/invuca.icu nfc.nrm nfkc.nrm nfkc_cf.nrm uts46.nrm
374ca955 240DAT_FILES=$(DAT_FILES_SHORT:%=$(BUILDDIR)/%)
b75a7d8f
A
241
242## BRK files
73c04bcf 243BREAK_TREE=brkitr
374ca955
A
244-include $(BRKSRCDIR)/brkfiles.mk
245-include $(BRKSRCDIR)/brklocal.mk
73c04bcf
A
246ALL_BRK_SOURCE= $(BRK_SOURCE) $(BRK_SOURCE_LOCAL)
247BRK_FILES_SHORT=$(ALL_BRK_SOURCE:%.txt=$(BREAK_TREE)/%.brk)
248BRK_FILES=$(ALL_BRK_SOURCE:%.txt=$(BRKBLDDIR)/%.brk)
249ifdef BRK_CTD_SOURCE
250ALL_CTD_SOURCE=$(BRK_CTD_SOURCE) $(BRK_CTD_SOURCE_LOCAL)
251CTD_FILES_SHORT=$(ALL_CTD_SOURCE:%.txt=$(BREAK_TREE)/%.ctd)
252CTD_FILES=$(ALL_CTD_SOURCE:%.txt=$(BRKBLDDIR)/%.ctd)
253endif
254ifdef BRK_RES_SOURCE
255BRS_SRC= root.txt $(BRK_RES_SOURCE) $(BRK_RES_SOURCE_LOCAL)
256BRS_SRC_FILES = $(BRS_SRC:%=$(BRKSRCDIR)/%)
257INSTALLED_BRS_FILES = $(BRK_RES_SOURCE:%.txt=%) $(BRK_RES_SOURCE_LOCAL:%.txt=%)
258endif
b75a7d8f 259
729e4ab9
A
260## Confusables (Spoofing) files
261ALL_CFU_SOURCE=$(UNICODEDATADIR)/confusables.txt $(UNICODEDATADIR)/confusablesWholeScript.txt
262CFU_FILES_SHORT=confusables.cfu
263CFU_FILES=$(BUILDDIR)/$(CFU_FILES_SHORT)
264
374ca955 265## UCM files
b75a7d8f
A
266-include $(UCMSRCDIR)/ucmcore.mk
267-include $(UCMSRCDIR)/ucmfiles.mk
268-include $(UCMSRCDIR)/ucmebcdic.mk
269-include $(UCMSRCDIR)/ucmlocal.mk
270ALL_UCM_SOURCE=ibm-37_P100-1995.ucm ibm-1047_P100-1995.ucm $(UCM_SOURCE_CORE) $(UCM_SOURCE_FILES) $(UCM_SOURCE_EBCDIC) $(UCM_SOURCE_LOCAL)
271UCM_FILES = $(ALL_UCM_SOURCE:%=$(SRCDATADIR)/%)
374ca955
A
272CNV_FILES = $(ALL_UCM_SOURCE:%.ucm=$(BUILDDIR)/%.cnv)
273CNV_FILES_SHORT = $(ALL_UCM_SOURCE:%.ucm=%.cnv)
729e4ab9
A
274UCM_SOURCE_SPECIAL=$(UCM_SOURCE_EBCDIC_IGNORE_SISO) $(UCM_SOURCE_EBCDIC_IGNORE_SISO_LOCAL)
275UCM_FILES_SPECIAL=$(UCM_SOURCE_SPECIAL:%=$(UCMSRCDIR)/%)
276CNV_FILES_SPECIAL=$(UCM_SOURCE_SPECIAL:%.ucm=$(BUILDDIR)/%.cnv)
277CNV_FILES_SHORT_SPECIAL=$(UCM_SOURCE_SPECIAL:%.ucm=%.cnv)
b75a7d8f
A
278
279## RES files
280-include $(LOCSRCDIR)/resfiles.mk
729e4ab9
A
281-include $(CURRSRCDIR)/resfiles.mk
282-include $(LANGSRCDIR)/resfiles.mk
283-include $(REGIONSRCDIR)/resfiles.mk
284-include $(ZONESRCDIR)/resfiles.mk
374ca955
A
285-include $(COLSRCDIR)/colfiles.mk
286-include $(RBNFSRCDIR)/rbnffiles.mk
287-include $(TRANSLITSRCDIR)/trnsfiles.mk
b75a7d8f 288-include $(LOCSRCDIR)/reslocal.mk
729e4ab9
A
289-include $(CURRSRCDIR)/reslocal.mk
290-include $(LANGSRCDIR)/reslocal.mk
291-include $(REGIONSRCDIR)/reslocal.mk
292-include $(ZONESRCDIR)/reslocal.mk
374ca955 293-include $(COLSRCDIR)/collocal.mk
73c04bcf 294-include $(BRKSRCDIR)/brslocal.mk
374ca955 295-include $(RBNFSRCDIR)/rbnflocal.mk
73c04bcf
A
296-include $(TRANSLITSRCDIR)/trnslocal.mk
297ifdef GENRB_SOURCE
46f4442e 298RES_SRC= root.txt $(GENRB_SOURCE) $(GENRB_ALIAS_SOURCE) $(GENRB_SOURCE_LOCAL) $(GENRB_ALIAS_SOURCE_LOCAL)
374ca955 299RES_SRC_FILES = $(RES_SRC:%=$(LOCSRCDIR)/%)
b75a7d8f 300INSTALLED_RB_FILES = $(GENRB_SOURCE:%.txt=%) $(GENRB_SOURCE_LOCAL:%.txt=%)
73c04bcf 301endif
729e4ab9
A
302ifdef CURR_SOURCE
303CURR_SRC= root.txt supplementalData.txt $(CURR_SOURCE) $(CURR_ALIAS_SOURCE) $(CURR_SOURCE_LOCAL)
304CURR_SRC_FILES = $(CURR_SRC:%=$(CURRSRCDIR)/%)
305INSTALLED_CURR_FILES = $(CURR_SOURCE:%.txt=%) $(CURR_SOURCE_LOCAL:%.txt=%)
306endif
307ifdef LANG_SOURCE
308LANG_SRC= root.txt $(LANG_SOURCE) $(LANG_ALIAS_SOURCE) $(LANG_SOURCE_LOCAL)
309LANG_SRC_FILES = $(LANG_SRC:%=$(LANGSRCDIR)/%)
310INSTALLED_LANG_FILES = $(LANG_SOURCE:%.txt=%) $(LANG_SOURCE_LOCAL:%.txt=%)
311endif
312ifdef REGION_SOURCE
313REGION_SRC= root.txt $(REGION_SOURCE) $(REGION_ALIAS_SOURCE) $(REGION_SOURCE_LOCAL)
314REGION_SRC_FILES = $(REGION_SRC:%=$(REGIONSRCDIR)/%)
315INSTALLED_REGION_FILES = $(REGION_SOURCE:%.txt=%) $(REGION_SOURCE_LOCAL:%.txt=%)
316endif
317ifdef ZONE_SOURCE
318ZONE_SRC= root.txt $(ZONE_SOURCE) $(ZONE_ALIAS_SOURCE) $(ZONE_SOURCE_LOCAL)
319ZONE_SRC_FILES = $(ZONE_SRC:%=$(ZONESRCDIR)/%)
320INSTALLED_ZONE_FILES = $(ZONE_SOURCE:%.txt=%) $(ZONE_SOURCE_LOCAL:%.txt=%)
321endif
73c04bcf 322ifdef COLLATION_SOURCE
374ca955
A
323COL_SRC= root.txt $(COLLATION_SOURCE) $(COLLATION_ALIAS_SOURCE) $(COLLATION_SOURCE_LOCAL)
324COL_SRC_FILES = $(COL_SRC:%=$(COLSRCDIR)/%)
325INSTALLED_COL_FILES = $(COLLATION_SOURCE:%.txt=%) $(COLLATION_SOURCE_LOCAL:%.txt=%)
73c04bcf
A
326endif
327ifdef RBNF_SOURCE
374ca955
A
328RBNF_SRC= root.txt $(RBNF_SOURCE) $(RBNF_ALIAS_SOURCE) $(RBNF_SOURCE_LOCAL)
329RBNF_SRC_FILES = $(RBNF_SRC:%=$(RBNFSRCDIR)/%)
330INSTALLED_RBNF_FILES = $(RBNF_SOURCE:%.txt=%) $(RBNF_SOURCE_LOCAL:%.txt=%)
73c04bcf
A
331endif
332ifdef TRANSLIT_SOURCE
333TRANSLIT_SRC= $(TRANSLIT_SOURCE) $(TRANSLIT_ALIAS_SOURCE) $(TRANSLIT_SOURCE_LOCAL)
374ca955
A
334TRANSLIT_SRC_FILES = $(TRANSLIT_SRC:%=$(TRANSLITSRCDIR)/%)
335INSTALLED_TRANSLIT_FILES = $(TRANSLIT_SOURCE:%.txt=%) $(TRANSLIT_SOURCE_LOCAL:%.txt=%)
73c04bcf 336endif
374ca955
A
337GENRBOPTS=-k
338
339## MISC files
340-include $(MISCSRCDIR)/miscfiles.mk
341-include $(MISCSRCDIR)/misclocal.mk
729e4ab9 342MSC_SOURCE= $(MISC_SOURCE) $(MISC_SOURCE_LOCAL)
374ca955
A
343MSC_SRC_FILES=$(MSC_SOURCE:%=$(MISCSRCDIR)/%)
344
345ifeq ($(ENABLE_SO_VERSION_DATA),1)
346ifeq ($(PKGDATA_MODE),dll)
347SO_VERSION_DATA = $(OUTTMPDIR)/icudata.res
348$(SO_VERSION_DATA) : $(MISCSRCDIR)/icudata.rc
4388f060 349 rc.exe /i$(srcdir)/../common /i$(top_builddir)/common /fo$@ $(CPPFLAGS) $(SOURCE_FILE)
374ca955
A
350endif
351endif
b75a7d8f 352
729e4ab9
A
353INDEX_NAME=res_index
354INDEX_FILE=$(OUTTMPDIR)/$(INDEX_NAME).txt
355
374ca955 356ALL_RES_SRC= $(RES_SRC) $(TRNS_SOURCE) $(MSC_SOURCE)
729e4ab9
A
357RES_FILES = $(ALL_RES_SRC:%.txt=$(BUILDDIR)/%.res) $(BUILDDIR)/$(INDEX_NAME).res $(BUILDDIR)/pool.res
358RES_FILES_SHORT = $(ALL_RES_SRC:%.txt=%.res) $(INDEX_NAME).res pool.res
46f4442e 359PKGDATA_LIST = $(OUTTMPDIR)/icudata.lst
374ca955 360
729e4ab9
A
361CURR_TREE=curr
362CURR_INDEX_FILE=$(OUTTMPDIR)/$(CURR_TREE)/$(INDEX_NAME).txt
363CURR_FILES = $(CURR_SRC:%.txt=$(CURRBLDDIR)/%.res) $(CURRBLDDIR)/$(INDEX_NAME).res $(CURRBLDDIR)/pool.res
364CURR_FILES_SHORT = $(CURR_SRC:%.txt=$(CURR_TREE)/%.res) $(CURR_TREE)/$(INDEX_NAME).res $(CURR_TREE)/pool.res
365
366LANG_TREE=lang
367LANG_INDEX_FILE=$(OUTTMPDIR)/$(LANG_TREE)/$(INDEX_NAME).txt
368LANG_FILES = $(LANG_SRC:%.txt=$(LANGBLDDIR)/%.res) $(LANGBLDDIR)/$(INDEX_NAME).res $(LANGBLDDIR)/pool.res
369LANG_FILES_SHORT = $(LANG_SRC:%.txt=$(LANG_TREE)/%.res) $(LANG_TREE)/$(INDEX_NAME).res $(LANG_TREE)/pool.res
370
371REGION_TREE=region
372REGION_INDEX_FILE=$(OUTTMPDIR)/$(REGION_TREE)/$(INDEX_NAME).txt
373REGION_FILES = $(REGION_SRC:%.txt=$(REGIONBLDDIR)/%.res) $(REGIONBLDDIR)/$(INDEX_NAME).res $(REGIONBLDDIR)/pool.res
374REGION_FILES_SHORT = $(REGION_SRC:%.txt=$(REGION_TREE)/%.res) $(REGION_TREE)/$(INDEX_NAME).res $(REGION_TREE)/pool.res
375
376ZONE_TREE=zone
377ZONE_INDEX_FILE=$(OUTTMPDIR)/$(ZONE_TREE)/$(INDEX_NAME).txt
378ZONE_FILES = $(ZONE_SRC:%.txt=$(ZONEBLDDIR)/%.res) $(ZONEBLDDIR)/$(INDEX_NAME).res $(ZONEBLDDIR)/pool.res
379ZONE_FILES_SHORT = $(ZONE_SRC:%.txt=$(ZONE_TREE)/%.res) $(ZONE_TREE)/$(INDEX_NAME).res $(ZONE_TREE)/pool.res
374ca955
A
380
381COLLATION_TREE=coll
382COLLATION_INDEX_FILE=$(OUTTMPDIR)/$(COLLATION_TREE)/$(INDEX_NAME).txt
383COLLATION_INDEX_RES=$(COLBLDDIR)/$(INDEX_NAME).res
384COLLATION_INDEX_RES_SHORT=$(COLLATION_TREE)/$(INDEX_NAME).res
385COLLATION_FILES = $(COL_SRC:%.txt=$(COLBLDDIR)/%.res) $(COLLATION_INDEX_RES)
386COLLATION_FILES_SHORT = $(COL_SRC:%.txt=$(COLLATION_TREE)/%.res)
387
73c04bcf
A
388BRK_RES_INDEX_FILE=$(OUTTMPDIR)/$(BREAK_TREE)/$(INDEX_NAME).txt
389BRK_RES_INDEX_RES=$(BRKBLDDIR)/$(INDEX_NAME).res
390BRK_RES_INDEX_RES_SHORT=$(BREAK_TREE)/$(INDEX_NAME).res
391BRK_RES_FILES = $(BRS_SRC:%.txt=$(BRKBLDDIR)/%.res) $(BRK_RES_INDEX_RES)
392BRK_RES_FILES_SHORT = $(BRS_SRC:%.txt=$(BREAK_TREE)/%.res)
393
374ca955
A
394RBNF_TREE=rbnf
395RBNF_INDEX_FILE=$(OUTTMPDIR)/$(RBNF_TREE)/$(INDEX_NAME).txt
396RBNF_INDEX_RES=$(RBNFBLDDIR)/$(INDEX_NAME).res
397RBNF_INDEX_RES_SHORT=$(RBNF_TREE)/$(INDEX_NAME).res
398RBNF_FILES = $(RBNF_SRC:%.txt=$(RBNFBLDDIR)/%.res) $(RBNF_INDEX_RES)
399RBNF_FILES_SHORT = $(RBNF_SRC:%.txt=$(RBNF_TREE)/%.res)
400
401TRANSLIT_TREE=translit
402#TRANSLIT_INDEX_FILE=$(OUTTMPDIR)/$(TRANSLIT_TREE)/$(INDEX_NAME).txt
403#TRANSLIT_INDEX_RES=$(TRANSLITBLDDIR)/$(INDEX_NAME).res
404#TRANSLIT_INDEX_RES_SHORT=$(TRANSLIT_TREE)/$(INDEX_NAME).res
405TRANSLIT_FILES = $(TRANSLIT_SRC:%.txt=$(TRANSLITBLDDIR)/%.res)
406TRANSLIT_FILES_SHORT = $(TRANSLIT_SRC:%.txt=$(TRANSLIT_TREE)/%.res)
b75a7d8f 407
729e4ab9
A
408## SPP files
409-include $(SPREPSRCDIR)/sprepfiles.mk
410-include $(SPREPSRCDIR)/spreplocal.mk
411ALL_SPREP_SOURCE=$(SPREP_SOURCE) $(SPREP_SOURCE_LOCAL)
412SPREP_FILES = $(ALL_SPREP_SOURCE:%.txt=$(BUILDDIR)/%.spp)
413SPREP_FILES_SHORT = $(ALL_SPREP_SOURCE:%.txt=%.spp)
414
b75a7d8f 415## All generated files
729e4ab9
A
416ALL_FILES = $(DAT_FILES) $(CNV_FILES) $(CNV_FILES_SPECIAL) $(BRK_FILES) $(CTD_FILES) $(RES_FILES) $(INDEX_RES_FILE) $(CURR_FILES) $(LANG_FILES) $(REGION_FILES) $(ZONE_FILES) $(COLLATION_FILES) $(BRK_RES_FILES) $(RBNF_FILES) $(TRANSLIT_FILES) $(SPREP_FILES) $(CFU_FILES)
417ALL_INDEX_SRC_FILES = $(PKGDATA_LIST) $(INDEX_FILE) $(CURR_INDEX_FILE) $(LANG_INDEX_FILE) $(REGION_INDEX_FILE) $(ZONE_INDEX_FILE) $(COLLATION_INDEX_FILE) $(BRK_RES_INDEX_FILE) $(RBNF_INDEX_FILE)
374ca955 418# a list to use in the .lst files (package-relative)
729e4ab9
A
419COLL_FILES_LIST=$(COLLATION_FILES_SHORT) $(COLLATION_INDEX_RES_SHORT)
420BRK_FILES_LIST=$(BRK_FILES_SHORT) $(CTD_FILES_SHORT) $(BRK_RES_FILES_SHORT) $(BRK_RES_INDEX_RES_SHORT)
421LOCALE_FILES_LIST= $(RES_FILES_SHORT) $(LANG_FILES_SHORT) $(REGION_FILES_SHORT) $(ZONE_FILES_SHORT)
422MISC_FILES_LIST=$(DAT_FILES_SHORT) $(CNV_FILES_SHORT) $(CNV_FILES_SHORT_SPECIAL) $(CURR_FILES_SHORT) $(RBNF_FILES_SHORT) $(RBNF_INDEX_RES_SHORT) $(TRANSLIT_FILES_SHORT) $(SPREP_FILES_SHORT) $(CFU_FILES_SHORT)
4388f060 423UNI_CORE_DATA=pnames.icu uprops.icu ucase.icu ubidi.icu
46f4442e
A
424UNI_CORE_TARGET_DATA=$(UNI_CORE_DATA:%=$(BUILDDIR)/%)
425
426ifneq ($(INCLUDE_UNI_CORE_DATA),)
729e4ab9 427MISC_FILES_LIST+=$(UNI_CORE_DATA)
46f4442e
A
428build-local: uni-core-data
429endif
430
b75a7d8f
A
431#####################################################
432# General data build rules
433
434## Files to remove for 'make clean'
435CLEANFILES = *~ icupkg.inc
436
73c04bcf 437ifeq ($(ICUDATA_SOURCE_ARCHIVE),)
46f4442e
A
438build-local: build-dir $(SO_VERSION_DATA) $(ALL_FILES) $(PKGDATA_LIST) $(OS390LIST)
439$(PKGDATA_LIST): $(SRCLISTDEPS)
b75a7d8f
A
440 @echo "generating $@ (list of data files)"
441 @-$(RMV) $@
729e4ab9
A
442 @for file in $(COLL_FILES_LIST); do \
443 echo $$file >> $@; \
444 done;
445 @for file in $(BRK_FILES_LIST); do \
446 echo $$file >> $@; \
447 done;
448 @for file in $(LOCALE_FILES_LIST); do \
449 echo $$file >> $@; \
450 done;
451 @for file in $(MISC_FILES_LIST); do \
b75a7d8f
A
452 echo $$file >> $@; \
453 done;
73c04bcf 454else
46f4442e
A
455build-local: build-dir $(SO_VERSION_DATA) $(PKGDATA_LIST) $(OS390LIST)
456$(PKGDATA_LIST): $(SRCLISTDEPS) $(ICUDATA_SOURCE_ARCHIVE)
73c04bcf
A
457ifneq ($(ICUDATA_SOURCE_IS_NATIVE_TARGET),YES)
458 @echo "Unpacking $(ICUDATA_SOURCE_ARCHIVE) and generating $@ (list of data files)"
459 @-$(RMV) $@
729e4ab9 460 $(INVOKE) $(TOOLBINDIR)/icupkg -d $(BUILDDIR) --list -x \* $(ICUDATA_SOURCE_ARCHIVE) -o $@
73c04bcf
A
461else
462 @echo "$@" > $@
463endif
464endif
b75a7d8f 465
b75a7d8f 466
729e4ab9
A
467$(BUILD_DIRS): build-dir
468
46f4442e
A
469build-dir:
470 @list='$(BUILD_DIRS)'; \
471 for dir in $$list; do \
472 if ! test -d $$dir; then \
473 echo $(MKINSTALLDIRS) $(BUILD_DIRS); \
474 $(MKINSTALLDIRS) $(BUILD_DIRS); \
475 fi; \
476 done
b75a7d8f 477
46f4442e
A
478# The | is an order-only prerequisite. This helps when the -j option is used,
479# and we don't want the files to be built before the directories are built.
480ifneq ($(filter order-only,$(.FEATURES)),)
481$(ALL_FILES) $(ALL_INDEX_SRC_FILES): | build-dir
482endif
b75a7d8f
A
483
484# Now, sections for building each kind of data.
485
486#################################################### DAT
487# DAT FILES
488
729e4ab9
A
489# cnvalias.icu
490$(BUILDDIR)/cnvalias.icu: $(UCMSRCDIR)/convrtrs.txt $(TOOLBINDIR)/gencnval$(TOOLEXEEXT)
491 $(INVOKE) $(TOOLBINDIR)/gencnval -d $(BUILDDIR) $(UCMSRCDIR)/convrtrs.txt
b75a7d8f 492
729e4ab9
A
493# Targets for prebuilt Unicode data
494$(BUILDDIR)/%.icu: $(SRCDATADIR)/in/%.icu
495 $(INVOKE) $(TOOLBINDIR)/icupkg -t$(ICUDATA_CHAR) $< $@
b75a7d8f 496
729e4ab9
A
497$(BUILDDIR)/%.nrm: $(SRCDATADIR)/in/%.nrm
498 $(INVOKE) $(TOOLBINDIR)/icupkg -t$(ICUDATA_CHAR) $< $@
b75a7d8f 499
729e4ab9
A
500$(BUILDDIR)/coll/%.icu: $(SRCDATADIR)/in/coll/%.icu
501 $(INVOKE) $(TOOLBINDIR)/icupkg -t$(ICUDATA_CHAR) $< $@
b75a7d8f 502
729e4ab9
A
503#################################################### SPP
504# SPP FILES
b75a7d8f 505
4388f060 506$(BUILDDIR)/%.spp: $(SPREPSRCDIR)/%.txt $(TOOLBINDIR)/gensprep$(TOOLEXEEXT) $(BUILDDIR)/unames.icu
729e4ab9 507 $(INVOKE) $(TOOLBINDIR)/gensprep -d $(BUILDDIR) -i $(BUILDDIR) -s $(SPREPSRCDIR) -b $(@F:%.spp=%) -m $(UNICODEDATADIR) -u 3.2.0 $(<F)
b75a7d8f
A
508
509#################################################### BRK
510# BRK FILES
511
73c04bcf
A
512#thaidict.brk: $(SRCDATADIR)/thaidict.brk
513# $(RMV) $@ && ln -s $(BUILDDIR) $@
b75a7d8f 514
4388f060
A
515#khmerdict.brk: $(SRCDATADIR)/khmerdict.brk
516# $(RMV) $@ && ln -s $(BUILDDIR) $@
517
729e4ab9
A
518$(BRKBLDDIR)/%.brk: $(BRKSRCDIR)/%.txt $(TOOLBINDIR)/genbrk$(TOOLEXEEXT) $(DAT_FILES)
519 $(INVOKE) $(TOOLBINDIR)/genbrk -c -i $(BUILDDIR) -r $< -o $@
b75a7d8f 520
73c04bcf
A
521#################################################### CTD
522# CTD FILES
523
729e4ab9
A
524$(BRKBLDDIR)/%.ctd: $(BRKSRCDIR)/%.txt $(TOOLBINDIR)/genctd$(TOOLEXEEXT) $(DAT_FILES)
525 $(INVOKE) $(TOOLBINDIR)/genctd -c -i $(BUILDDIR) -o $@ $<
526
527#################################################### CFU
528# CFU FILES
529# Note: gencfu requires two input files to produce a single output file.
530# There will be exactly one target file and two source files.
531# The $(word n, ...) selects the nth word from the following stuff.
532# There must be a nicer way to do this.
533
534$(CFU_FILES): $(ALL_CFU_SOURCE) $(TOOLBINDIR)/gencfu$(TOOLEXEEXT) $(DAT_FILES)
535 $(INVOKE) echo ALL_CFU_SOURCE: $(ALL_CFU_SOURCE)
536 $(INVOKE) echo CFU_FILES: $(CFU_FILES)
537 $(INVOKE) echo CFU_FILES_SHORT: $(CFU_FILES_SHORT)
538 $(INVOKE) $(TOOLBINDIR)/gencfu -c -i $(BUILDDIR) -r $(word 1,$(ALL_CFU_SOURCE)) -w $(word 2,$(ALL_CFU_SOURCE)) -o $@
539
73c04bcf 540
b75a7d8f
A
541#################################################### CNV
542# CNV FILES
729e4ab9
A
543$(CNV_FILES_SPECIAL) : $(UCM_FILES_SPECIAL) $(TOOLBINDIR)/makeconv$(TOOLEXEEXT)
544 $(INVOKE) $(TOOLBINDIR)/makeconv --ignore-siso-check -c -d $(BUILDDIR) $(UCMSRCDIR)/$(@F:%.cnv=%.ucm)
545$(BUILDDIR)/%.cnv: $(UCMSRCDIR)/%.ucm $(TOOLBINDIR)/makeconv$(TOOLEXEEXT)
546 $(INVOKE) $(TOOLBINDIR)/makeconv -c -d $(BUILDDIR) $(UCMSRCDIR)/$(<F)
b75a7d8f
A
547
548#################################################### RES
549# RES FILES
550
729e4ab9
A
551### curr res
552$(CURRBLDDIR)/%.res: $(CURRSRCDIR)/%.txt $(TOOLBINDIR)/genrb$(TOOLEXEEXT) $(DAT_FILES)
553 $(INVOKE) $(TOOLBINDIR)/genrb --usePoolBundle $(GENRBOPTS) -i $(BUILDDIR) -s $(CURRSRCDIR) -d $(CURRBLDDIR) $(<F)
554
555# copy the curr/pool.res file from the source folder to the build output folder
556# and swap it to native endianness
557$(CURRBLDDIR)/pool.res: $(CURRSRCDIR)/pool.res
558 $(INVOKE) $(TOOLBINDIR)/icupkg -t$(ICUDATA_CHAR) $(CURRSRCDIR)/pool.res $(CURRBLDDIR)/pool.res
559
560$(CURRBLDDIR)/$(INDEX_NAME).res: $(OUTTMPDIR)/$(CURR_TREE)/$(INDEX_NAME).txt $(TOOLBINDIR)/genrb$(TOOLEXEEXT)
561 $(INVOKE) $(TOOLBINDIR)/genrb $(GENRBOPTS) -i $(BUILDDIR) -s $(OUTTMPDIR)/$(CURR_TREE) -d $(CURRBLDDIR) $(INDEX_NAME).txt
562
563$(CURR_INDEX_FILE): $(SRCLISTDEPS)
564 @echo "generating $@ (list of installed currency name locales)"; \
565 $(RMV) $@; \
566 echo "// Warning this file is automatically generated" > $@; \
567 echo "$(INDEX_NAME):table(nofallback) {" >> $@; \
568 echo " InstalledLocales {" >> $@; \
569 for file in $(INSTALLED_CURR_FILES); do \
570 echo " $$file {\"\"}" >> $@; \
571 done; \
572 echo " }" >> $@; \
573 echo "}" >> $@;
574
575### lang res
576$(LANGBLDDIR)/%.res: $(LANGSRCDIR)/%.txt $(TOOLBINDIR)/genrb$(TOOLEXEEXT) $(DAT_FILES)
577 $(INVOKE) $(TOOLBINDIR)/genrb --usePoolBundle $(GENRBOPTS) -i $(BUILDDIR) -s $(LANGSRCDIR) -d $(LANGBLDDIR) $(<F)
578
579# copy the lang/pool.res file from the source folder to the build output folder
580# and swap it to native endianness
581$(LANGBLDDIR)/pool.res: $(LANGSRCDIR)/pool.res
582 $(INVOKE) $(TOOLBINDIR)/icupkg -t$(ICUDATA_CHAR) $(LANGSRCDIR)/pool.res $(LANGBLDDIR)/pool.res
583
584$(LANGBLDDIR)/$(INDEX_NAME).res: $(OUTTMPDIR)/$(LANG_TREE)/$(INDEX_NAME).txt $(TOOLBINDIR)/genrb$(TOOLEXEEXT)
585 $(INVOKE) $(TOOLBINDIR)/genrb $(GENRBOPTS) -i $(BUILDDIR) -s $(OUTTMPDIR)/$(LANG_TREE) -d $(LANGBLDDIR) $(INDEX_NAME).txt
586
587$(LANG_INDEX_FILE): $(SRCLISTDEPS)
588 @echo "generating $@ (list of installed language name locales)"; \
589 $(RMV) $@; \
590 echo "// Warning this file is automatically generated" > $@; \
591 echo "$(INDEX_NAME):table(nofallback) {" >> $@; \
592 echo " InstalledLocales {" >> $@; \
593 for file in $(INSTALLED_LANG_FILES); do \
594 echo " $$file {\"\"}" >> $@; \
595 done; \
596 echo " }" >> $@; \
597 echo "}" >> $@;
598
599### region res
600$(REGIONBLDDIR)/%.res: $(REGIONSRCDIR)/%.txt $(TOOLBINDIR)/genrb$(TOOLEXEEXT) $(DAT_FILES)
601 $(INVOKE) $(TOOLBINDIR)/genrb --usePoolBundle $(GENRBOPTS) -i $(BUILDDIR) -s $(REGIONSRCDIR) -d $(REGIONBLDDIR) $(<F)
602
603# copy the region/pool.res file from the source folder to the build output folder
604# and swap it to native endianness
605$(REGIONBLDDIR)/pool.res: $(REGIONSRCDIR)/pool.res
606 $(INVOKE) $(TOOLBINDIR)/icupkg -t$(ICUDATA_CHAR) $(REGIONSRCDIR)/pool.res $(REGIONBLDDIR)/pool.res
607
608$(REGIONBLDDIR)/$(INDEX_NAME).res: $(OUTTMPDIR)/$(REGION_TREE)/$(INDEX_NAME).txt $(TOOLBINDIR)/genrb$(TOOLEXEEXT)
609 $(INVOKE) $(TOOLBINDIR)/genrb $(GENRBOPTS) -i $(BUILDDIR) -s $(OUTTMPDIR)/$(REGION_TREE) -d $(REGIONBLDDIR) $(INDEX_NAME).txt
610
611$(REGION_INDEX_FILE): $(SRCLISTDEPS)
612 @echo "generating $@ (list of installed region name locales)"; \
613 $(RMV) $@; \
614 echo "// Warning this file is automatically generated" > $@; \
615 echo "$(INDEX_NAME):table(nofallback) {" >> $@; \
616 echo " InstalledLocales {" >> $@; \
617 for file in $(INSTALLED_REGION_FILES); do \
618 echo " $$file {\"\"}" >> $@; \
619 done; \
620 echo " }" >> $@; \
621 echo "}" >> $@;
622
623### zone res
624$(ZONEBLDDIR)/%.res: $(ZONESRCDIR)/%.txt $(TOOLBINDIR)/genrb$(TOOLEXEEXT) $(DAT_FILES)
625 $(INVOKE) $(TOOLBINDIR)/genrb --usePoolBundle $(GENRBOPTS) -i $(BUILDDIR) -s $(ZONESRCDIR) -d $(ZONEBLDDIR) $(<F)
626
627# copy the zone/pool.res file from the source folder to the build output folder
628# and swap it to native endianness
629$(ZONEBLDDIR)/pool.res: $(ZONESRCDIR)/pool.res
630 $(INVOKE) $(TOOLBINDIR)/icupkg -t$(ICUDATA_CHAR) $(ZONESRCDIR)/pool.res $(ZONEBLDDIR)/pool.res
631
632$(ZONEBLDDIR)/$(INDEX_NAME).res: $(OUTTMPDIR)/$(ZONE_TREE)/$(INDEX_NAME).txt $(TOOLBINDIR)/genrb$(TOOLEXEEXT)
633 $(INVOKE) $(TOOLBINDIR)/genrb $(GENRBOPTS) -i $(BUILDDIR) -s $(OUTTMPDIR)/$(ZONE_TREE) -d $(ZONEBLDDIR) $(INDEX_NAME).txt
634
635$(ZONE_INDEX_FILE): $(SRCLISTDEPS)
636 @echo "generating $@ (list of installed time zone name locales)"; \
637 $(RMV) $@; \
638 echo "// Warning this file is automatically generated" > $@; \
639 echo "$(INDEX_NAME):table(nofallback) {" >> $@; \
640 echo " InstalledLocales {" >> $@; \
641 for file in $(INSTALLED_ZONE_FILES); do \
642 echo " $$file {\"\"}" >> $@; \
643 done; \
644 echo " }" >> $@; \
645 echo "}" >> $@;
646
374ca955 647### collation res
729e4ab9
A
648$(COLBLDDIR)/%.res: $(COLSRCDIR)/%.txt $(TOOLBINDIR)/genrb$(TOOLEXEEXT) $(DAT_FILES)
649 $(INVOKE) $(TOOLBINDIR)/genrb --includeUnihanColl $(GENRBOPTS) -i $(BUILDDIR) -s $(COLSRCDIR) -d $(COLBLDDIR) $(<F)
374ca955 650
729e4ab9
A
651$(COLBLDDIR)/$(INDEX_NAME).res: $(OUTTMPDIR)/$(COLLATION_TREE)/$(INDEX_NAME).txt $(TOOLBINDIR)/genrb$(TOOLEXEEXT)
652 $(INVOKE) $(TOOLBINDIR)/genrb --includeUnihanColl $(GENRBOPTS) -i $(BUILDDIR) -s $(OUTTMPDIR)/$(COLLATION_TREE) -d $(COLBLDDIR) $(INDEX_NAME).txt
374ca955 653
46f4442e 654$(COLLATION_INDEX_FILE): $(SRCLISTDEPS)
374ca955
A
655 @echo "generating $@ (list of installed collation locales)"; \
656 $(RMV) $@; \
657 echo "// Warning this file is automatically generated" > $@; \
73c04bcf 658 echo "$(INDEX_NAME):table(nofallback) {" >> $@; \
374ca955
A
659 echo " InstalledLocales {" >> $@; \
660 for file in $(INSTALLED_COL_FILES); do \
661 echo " $$file {\"\"}" >> $@; \
662 done; \
663 echo " }" >> $@; \
664 echo "}" >> $@;
665
73c04bcf 666### brk res
729e4ab9
A
667$(BRKBLDDIR)/%.res: $(BRKSRCDIR)/%.txt $(TOOLBINDIR)/genrb$(TOOLEXEEXT) $(BRK_FILES) $(DAT_FILES)
668 $(INVOKE) $(TOOLBINDIR)/genrb $(GENRBOPTS) -i $(BUILDDIR) -s $(BRKSRCDIR) -d $(BRKBLDDIR) $(<F)
73c04bcf 669
729e4ab9
A
670$(BRKBLDDIR)/$(INDEX_NAME).res: $(OUTTMPDIR)/$(BREAK_TREE)/$(INDEX_NAME).txt $(TOOLBINDIR)/genrb$(TOOLEXEEXT)
671 $(INVOKE) $(TOOLBINDIR)/genrb $(GENRBOPTS) -i $(BUILDDIR) -s $(OUTTMPDIR)/$(BREAK_TREE) -d $(BRKBLDDIR) $(INDEX_NAME).txt
73c04bcf 672
46f4442e 673$(BRK_RES_INDEX_FILE): $(SRCLISTDEPS)
73c04bcf
A
674 @echo "generating $@ (list of installed break locales)"; \
675 $(RMV) $@; \
676 echo "// Warning this file is automatically generated" > $@; \
677 echo "$(INDEX_NAME):table(nofallback) {" >> $@; \
678 echo " InstalledLocales {" >> $@; \
679 for file in $(INSTALLED_BRS_FILES); do \
680 echo " $$file {\"\"}" >> $@; \
681 done; \
682 echo " }" >> $@; \
683 echo "}" >> $@;
684
374ca955 685### RBNF res
729e4ab9
A
686$(RBNFBLDDIR)/%.res: $(RBNFSRCDIR)/%.txt $(TOOLBINDIR)/genrb$(TOOLEXEEXT) $(DAT_FILES)
687 $(INVOKE) $(TOOLBINDIR)/genrb $(GENRBOPTS) -i $(BUILDDIR) -s $(RBNFSRCDIR) -d $(RBNFBLDDIR) $(<F)
374ca955 688
729e4ab9
A
689$(RBNFBLDDIR)/$(INDEX_NAME).res: $(OUTTMPDIR)/$(RBNF_TREE)/$(INDEX_NAME).txt $(TOOLBINDIR)/genrb$(TOOLEXEEXT)
690 $(INVOKE) $(TOOLBINDIR)/genrb $(GENRBOPTS) -i $(BUILDDIR) -s $(OUTTMPDIR)/$(RBNF_TREE) -d $(RBNFBLDDIR) $(INDEX_NAME).txt
374ca955 691
46f4442e 692$(RBNF_INDEX_FILE): $(SRCLISTDEPS)
374ca955
A
693 @echo "generating $@ (list of installed RBNF locales)"; \
694 $(RMV) $@; \
695 echo "// Warning this file is automatically generated" > $@; \
73c04bcf 696 echo "$(INDEX_NAME):table(nofallback) {" >> $@; \
374ca955
A
697 echo " InstalledLocales {" >> $@; \
698 for file in $(INSTALLED_RBNF_FILES); do \
699 echo " $$file {\"\"}" >> $@; \
700 done; \
701 echo " }" >> $@; \
702 echo "}" >> $@;
703
704### TRANSLIT res
729e4ab9
A
705$(TRANSLITBLDDIR)/%.res: $(TRANSLITSRCDIR)/%.txt $(TOOLBINDIR)/genrb$(TOOLEXEEXT) $(DAT_FILES)
706 $(INVOKE) $(TOOLBINDIR)/genrb $(GENRBOPTS) -i $(BUILDDIR) -s $(TRANSLITSRCDIR) -d $(TRANSLITBLDDIR) $(<F)
707
374ca955 708### normal (locale) res
b75a7d8f
A
709all-RES: $(RES_FILES)
710
729e4ab9
A
711$(BUILDDIR)/%.res: $(LOCSRCDIR)/%.txt $(TOOLBINDIR)/genrb$(TOOLEXEEXT) $(DAT_FILES)
712 $(INVOKE) $(TOOLBINDIR)/genrb --usePoolBundle $(GENRBOPTS) -i $(BUILDDIR) -s $(LOCSRCDIR) -d $(BUILDDIR) $(<F)
713
714# copy the locales/pool.res file from the source folder to the build output folder
715# and swap it to native endianness
716$(BUILDDIR)/pool.res: $(LOCSRCDIR)/pool.res
717 $(INVOKE) $(TOOLBINDIR)/icupkg -t$(ICUDATA_CHAR) $(LOCSRCDIR)/pool.res $(BUILDDIR)/pool.res
b75a7d8f 718
729e4ab9
A
719# if the tzcode directory contains a new tzdata*.tar.gz file, use it for zoneinfo
720ifeq ($(TZDATA),)
73c04bcf 721TZDATA = $(firstword $(wildcard $(top_builddir)/tools/tzcode/tzdata*.tar.gz) $(wildcard $(top_srcdir)/tools/tzcode/tzdata*.tar.gz))
729e4ab9 722endif
73c04bcf
A
723
724ifneq ($(TZDATA),)
725
726TZCODE_DIR=$(top_builddir)/tools/tzcode
729e4ab9 727ZONEINFO=$(TZCODE_DIR)/zoneinfo64.txt
73c04bcf 728
729e4ab9
A
729# Override the normal genrb for zoneinfo to always pull from
730# icu/source/tools/tzcode/zoneinfo64.txt
731$(BUILDDIR)/zoneinfo64.res: $(ZONEINFO) $(TOOLBINDIR)/genrb$(TOOLEXEEXT)
73c04bcf 732 @echo Note: $(MISCSRCDIR)/zoneinfo.txt is IGNORED because $(TZDATA) is present.
729e4ab9 733 $(INVOKE) $(TOOLBINDIR)/genrb $(GENRBOPTS) -q -i $(BUILDDIR) -d $(BUILDDIR) $(ZONEINFO)
73c04bcf 734
729e4ab9 735# Create the tzcode tool and zoneinfo as needed.
73c04bcf
A
736$(ZONEINFO): $(TZDATA)
737 @echo "$(MAKE)[$(MAKELEVEL)]: Making \`$(ZONEINFO)' in \`$(TZCODE_DIR)'"; \
738 (cd $(TZCODE_DIR) && $(MAKE)) || exit; \
739
729e4ab9 740# end of zoneinfo-generation
73c04bcf
A
741endif
742
374ca955 743# zoneinfo has some issues. Ignore some warnings with -q
729e4ab9
A
744$(BUILDDIR)/%.res: $(MISCSRCDIR)/%.txt $(TOOLBINDIR)/genrb$(TOOLEXEEXT)
745 $(INVOKE) $(TOOLBINDIR)/genrb $(GENRBOPTS) -q -i $(BUILDDIR) -s $(MISCSRCDIR) -d $(BUILDDIR) $(<F)
b75a7d8f 746
73c04bcf
A
747
748
46f4442e 749$(INDEX_FILE): $(SRCLISTDEPS)
b75a7d8f
A
750 @echo "generating $@ (list of installed locales)"; \
751 $(RMV) $@; \
752 echo "// Warning this file is automatically generated" > $@; \
73c04bcf 753 echo "$(INDEX_NAME):table(nofallback) {" >> $@; \
46f4442e 754 echo " CLDRVersion { \"$(GENRB_CLDR_VERSION)\" }" >> $@; \
b75a7d8f
A
755 echo " InstalledLocales {" >> $@; \
756 for file in $(INSTALLED_RB_FILES); do \
757 echo " $$file {\"\"}" >> $@; \
758 done; \
759 echo " }" >> $@; \
760 echo "}" >> $@;
761
374ca955 762clean-resindex:
46f4442e 763 -$(RMV) $(BUILDDIR)/$(INDEX_NAME).txt $(PKGDATA_LIST)
374ca955 764
729e4ab9
A
765$(BUILDDIR)/$(INDEX_NAME).res: $(INDEX_FILE) $(TOOLBINDIR)/genrb$(TOOLEXEEXT)
766 $(INVOKE) $(TOOLBINDIR)/genrb $(GENRBOPTS) -i $(BUILDDIR) -d $(BUILDDIR) $(INDEX_FILE)
b75a7d8f 767
4388f060 768# The core Unicode properties files (pnames.icu, uprops.icu, ucase.icu, ubidi.icu)
46f4442e
A
769# are hardcoded in the common DLL and therefore not included in the data package any more.
770# They are not built by default but need to be built for ICU4J data and for getting the .c source files
771# when updating the Unicode data.
46f4442e
A
772uni-core-data: build-dir $(UNI_CORE_TARGET_DATA)
773 @echo Unicode .icu files built to $(BUILDDIR)
729e4ab9
A
774
775# Build the ICU4J icudata.jar.
776# Command line:
777# (Run this from the output data folder which may not be .../source/data in an out-of-source build.)
778# ~/svn.icu/trunk/source/data> make JAR=jar ICU4J_ROOT=~/svn.icu4j/trunk icudata.jar
779# You can omit the ICU4J_ROOT for just building the .jar files without copying them.
780# You can omit the JAR if it's just jar.
781JAR=jar
782
783# For building the testdata.jar see ../test/testdata/Makefile.
784
4388f060
A
785ICU4J_TZDATA=$(OUTDIR)/icu4j/icutzdata.jar
786ICU4J_TZDATA_FILES=zoneinfo64 metaZones timezoneTypes windowsZones
787ICU4J_DATA_DIRNAME=com/ibm/icu/impl/data/$(ICUDATA_BASENAME_VERSION)b
788ICU4J_TZDATA_PATHS=$(ICU4J_TZDATA_FILES:%="$(ICU4J_DATA_DIRNAME)/%.res")
789
790# generate icu4j-related data to $(OUTDIR)/icu4j/com/ibm/icu/impl/data/...
791generate-data: build-dir packagedata $(OUTTMPDIR)/$(ICUDATA_PLATFORM_NAME).dat uni-core-data
792 mkdir -p $(OUTDIR)/icu4j/$(ICU4J_DATA_DIRNAME)
793 mkdir -p $(OUTDIR)/icu4j/tzdata/$(ICU4J_DATA_DIRNAME)
794 echo pnames.icu ubidi.icu ucase.icu uprops.icu > $(OUTDIR)/icu4j/add.txt
795 $(INVOKE) $(TOOLBINDIR)/icupkg $(OUTTMPDIR)/$(ICUDATA_PLATFORM_NAME).dat $(OUTDIR)/icu4j/$(ICUDATA_BASENAME_VERSION)b.dat -a $(OUTDIR)/icu4j/add.txt -s $(BUILDDIR) -x '*' -tb -d $(OUTDIR)/icu4j/$(ICU4J_DATA_DIRNAME)
796 mv $(ICU4J_TZDATA_PATHS:%=$(OUTDIR)/icu4j/%) "$(OUTDIR)/icu4j/tzdata/$(ICU4J_DATA_DIRNAME)"
797
798$(OUTDIR)/icu4j/icutzdata.jar: generate-data
799 $(JAR) cf $(OUTDIR)/icu4j/icutzdata.jar -C $(OUTDIR)/icu4j/tzdata $(ICU4J_DATA_DIRNAME)/
800
729e4ab9
A
801# Build icudata.jar:
802# - add the uni-core-data to the ICU package
803# - swap the ICU data
804# - extract all data items
805# - package them into the .jar file
4388f060
A
806$(OUTDIR)/icu4j/icudata.jar: generate-data
807 $(JAR) cf $(OUTDIR)/icu4j/icudata.jar -C $(OUTDIR)/icu4j $(ICU4J_DATA_DIRNAME)/
729e4ab9
A
808
809ICU4J_DATA=$(OUTDIR)/icu4j/icudata.jar
810
811ifdef ICU4J_ROOT
812
4388f060 813ICU4J_DATA_INSTALLED=$(ICU4J_ROOT)/main/shared/data/icudata.jar $(ICU4J_ROOT)/main/shared/data/icutzdata.jar
729e4ab9
A
814
815$(ICU4J_ROOT)/main/shared/data/icudata.jar: $(OUTDIR)/icu4j/icudata.jar
816 mkdir -p $(ICU4J_ROOT)/main/shared/data
817 cp $(OUTDIR)/icu4j/icudata.jar $(ICU4J_ROOT)/main/shared/data
818
4388f060
A
819$(ICU4J_ROOT)/main/shared/data/icutzdata.jar: $(OUTDIR)/icu4j/icutzdata.jar
820 mkdir -p $(ICU4J_ROOT)/main/shared/data
821 cp $(OUTDIR)/icu4j/icutzdata.jar $(ICU4J_ROOT)/main/shared/data
822
729e4ab9
A
823icu4j-data-install: $(ICU4J_DATA_INSTALLED)
824
825else
826
827icu4j-data-install: icu4j-data
828 @echo data is built into $(OUTDIR)/icu4j
829 @echo '** Error:' ICU4J_ROOT was not set, could not install
830 exit 1
831
832endif
833
4388f060 834icu4j-data: $(ICU4J_DATA) $(ICU4J_TZDATA)
729e4ab9 835
46f4442e 836
b75a7d8f
A
837###################################################################
838Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
839 cd $(top_builddir) \
840 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
841
729e4ab9
A
842icupkg.inc: pkgdataMakefile
843 $(MAKE) -f pkgdataMakefile
844
845pkgdataMakefile:
b75a7d8f
A
846 cd $(top_builddir) \
847 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
848
849###########
850########### 390 (z/OS) support
851UCMFILES390=ebcdic-xml-us.ucm ibm-37_P100-1995.ucm ibm-1047_P100-1995.ucm ibm-4909_P100-1999.ucm
4388f060
A
852# used to depend on pnames.icu uprops.icu ucase.icu ubidi.icu
853# These are now hardcoded in ICU4C and only loaded in ICU4J.
854ALLFILES390=cnvalias.icu $(UCMFILES390:.ucm=.cnv)
b75a7d8f 855
374ca955 856$(OUTTMPDIR)/icudata390.lst: $(SRCLISTDEPS)
b75a7d8f
A
857 @echo "generating $@ (list of 390 data files)"
858 @-$(RMV) $@
859 @for file in $(ALLFILES390); do \
b75a7d8f
A
860 echo $$file >> $@; \
861 done;
862
374ca955
A
863ifeq ($(POST_DATA_BUILD), os400-data-rebind)
864os400-data-rebind: $(LIBICUUC)
b75a7d8f 865
374ca955
A
866$(LIBICUUC): $(LIBICUDT)
867 $(RMV) $(LIBICUUC)
868 (cd ../common && $(MAKE) RECURSIVE=YES) || exit;
869endif
b75a7d8f 870