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