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