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