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