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