1 ## Makefile.in for ICU data 2 ## Copyright (c) 1999-2009, 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 16 17 ## Build directory information 18 # So that $(top_builddir)/$(subdir) ~= "here" 19 subdir = data 20 21 #lib icu data for link 22 LIB_ICUDATA_NAME=$(LIBICU)$(DATA_STUBNAME)$(ICULIBSUFFIX) 23 LIB_STATIC_ICUDATA_NAME=$(LIBSICU)$(DATA_STUBNAME)$(ICULIBSUFFIX) 24 25 # Allow Windows to override these options 26 ifeq ($(PKGDATA_OPTS),) 27 PKGDATA_OPTS = -O $(top_builddir)/data/icupkg.inc 28 endif 29 ifeq ($(PKGDATA_VERSIONING),) 30 PKGDATA_VERSIONING = -r $(SO_TARGET_VERSION) 31 endif 32 33 # This allows all the data to be in one directory 34 ifeq ($(PKGDATA_MODE),dll) 35 ICUPKGDATA_OUTDIR = $(LIBDIR) 36 else 37 ICUPKGDATA_OUTDIR = $(OUTDIR) 38 endif 39 40 CURDIR:=$(CURR_FULL_DIR) 41 PKGDATA = $(TOOLBINDIR)/pkgdata $(PKGDATA_OPTS) -q -c -s $(CURDIR)/out/build/$(ICUDATA_PLATFORM_NAME) -d $(ICUPKGDATA_OUTDIR) 42 43 ifeq ($(OS390_STUBDATA),1) 44 OS390PKG=package390 45 OS390INSTALL=install390 46 47 # Additional data for 390 48 OS390LIST=$(OUTTMPDIR)/icudata390.lst 49 OUTTMPDIR_390STUB=$(top_builddir)/data/out/tmp_390stub 50 endif 51 52 # OBJDATADIR must be a short path (with ..'s) to the data. 53 54 ifeq ($(top_srcdir),..) 55 SRCDATADIR=. 56 else 57 SRCDATADIR=$(top_srcdir)/data 58 endif 59 ifeq ($(top_builddir),..) 60 OUTDIR=./out 61 else 62 OUTDIR=$(top_builddir)/data/out 63 endif 64 65 OUTTMPDIR=$(OUTDIR)/tmp 66 MAINBUILDDIR=$(OUTDIR)/build 67 BUILDDIR=$(MAINBUILDDIR)/$(ICUDATA_PLATFORM_NAME) 68 UNICODEDATADIR=$(SRCDATADIR)/unidata 69 LOCSRCDIR=$(SRCDATADIR)/locales 70 COLSRCDIR=$(SRCDATADIR)/coll 71 COLBLDDIR=$(BUILDDIR)/coll 72 RBNFSRCDIR=$(SRCDATADIR)/rbnf 73 RBNFBLDDIR=$(BUILDDIR)/rbnf 74 TRANSLITSRCDIR=$(SRCDATADIR)/translit 75 TRANSLITBLDDIR=$(BUILDDIR)/translit 76 MISCSRCDIR=$(SRCDATADIR)/misc 77 BRKSRCDIR=$(SRCDATADIR)/brkitr 78 BRKBLDDIR=$(BUILDDIR)/brkitr 79 MISCSRCDIR=$(SRCDATADIR)/misc 80 UCMSRCDIR=$(SRCDATADIR)/mappings 81 SPREPSRCDIR=$(SRCDATADIR)/sprep 82 COMINCDIR=$(top_srcdir)/common/unicode 83 SRCLISTDEPS=Makefile $(srcdir)/Makefile.in 84 BUILD_DIRS=$(OUTDIR) $(MAINBUILDDIR) $(BUILDDIR) $(BRKBLDDIR) $(COLBLDDIR) $(RBNFBLDDIR) $(TRANSLITBLDDIR) $(OUTTMPDIR) $(OUTTMPDIR_390STUB) $(OUTTMPDIR)/$(COLLATION_TREE) $(OUTTMPDIR)/$(RBNF_TREE) $(OUTTMPDIR)/$(TRANSLIT_TREE) $(OUTTMPDIR)/$(BREAK_TREE) 85 86 # relative lib links from pkgdata are the same as for tmp 87 TOOLDIR=$(top_builddir)/tools 88 89 ## List of phony targets 90 .PHONY : all all-local all-recursive install install-local install-files \ 91 install-recursive clean clean-local clean-recursive distclean \ 92 distclean-local distclean-recursive dist dist-local dist-recursive \ 93 check check-local check-recursive build-local clean-resindex build-dir 94 95 ## Clear suffix list 96 .SUFFIXES : 97 98 ## List of standard targets 99 all: all-local 100 install: all-local install-local 101 clean: clean-local 102 distclean : distclean-local 103 dist: 104 check: all 105 106 107 distclean-local: clean 108 $(RMV) Makefile 109 110 all-local: build-dir icupkg.inc build-local packagedata $(POST_DATA_BUILD) $(OS390PKG) 111 112 dist-local: 113 114 clean-map: 115 -test -z *.map || $(RMV) *.map 116 117 clean-local: cleanpackage cleanfiles clean-map 118 119 cleanfiles: 120 test -z "$(CLEANFILES)" || $(RMV) $(CLEANFILES) 121 122 cleanpackage: 123 $(RMV) $(OUTDIR) 124 $(RMV) $(LIBDIR)/$(LIB_ICUDATA_NAME)*.$(SO)* $(LIBDIR)/$(LIB_STATIC_ICUDATA_NAME).$(A) 125 126 check-local: 127 128 # Find out if we have a source archive. 129 # If we have that, then use that instead of building everything from scratch. 130 ICUDATA_SOURCE_ARCHIVE = $(wildcard $(srcdir)/in/$(ICUDATA_PLATFORM_NAME).dat) 131 ifeq ($(ICUDATA_SOURCE_ARCHIVE),) 132 ICUDATA_ARCHIVE = $(firstword $(wildcard $(srcdir)/in/$(ICUDATA_BASENAME_VERSION)*.dat)) 133 # We don't have the data in the current endianess or charset. 134 # See if we can find data of any archive type, 135 # and convert it to the current type. 136 ifneq ($(ICUDATA_ARCHIVE),) 137 ICUDATA_SOURCE_ARCHIVE = $(OUTDIR)/$(ICUDATA_PLATFORM_NAME).dat 138 $(ICUDATA_SOURCE_ARCHIVE): $(ICUDATA_ARCHIVE) $(OUTDIR) 139 $(INVOKE) $(TOOLBINDIR)/icupkg -t$(ICUDATA_CHAR) $(ICUDATA_ARCHIVE) $(ICUDATA_SOURCE_ARCHIVE) 140 endif 141 else 142 ifneq ($(ENABLE_STATIC),YES) 143 ifeq ($(PKGDATA_MODE),common) 144 # We have a source data common archive in the native endianess, 145 # and it's what we want to build. Try to not run any of ICU's tools. 146 ICUDATA_SOURCE_IS_NATIVE_TARGET=YES 147 endif 148 endif 149 endif 150 151 packagedata: icupkg.inc $(PKGDATA_LIST) build-local 152 ifneq ($(ENABLE_STATIC),) 153 ifeq ($(PKGDATA_MODE),dll) 154 $(PKGDATA_INVOKE) $(PKGDATA) -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -p $(ICUDATA_NAME) $(PKGDATA_LIBSTATICNAME) -m static $(PKGDATA_LIST) 155 endif 156 endif 157 ifneq ($(ICUDATA_SOURCE_IS_NATIVE_TARGET),YES) 158 $(PKGDATA_INVOKE) $(PKGDATA) -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -p $(ICUDATA_NAME) -m $(PKGDATA_MODE) $(PKGDATA_VERSIONING) $(PKGDATA_LIBNAME) $(PKGDATA_LIST) 159 else 160 $(INSTALL_DATA) $(ICUDATA_SOURCE_ARCHIVE) $(OUTDIR) 161 endif 162 163 ## Install ICU data. 164 install-local: $(PKGDATA_LIST) ./icupkg.inc packagedata $(OS390INSTALL) 165 $(MKINSTALLDIRS) $(TMPDATADIR) $(DESTDIR)$(ICUPKGDATA_DIR) 166 ifeq ($(PKGDATA_MODE),files) 167 $(MKINSTALLDIRS) $(ICUPKGDATA_DIR)/$(ICUDATA_NAME) 168 $(MKINSTALLDIRS) $(ICUPKGDATA_DIR)/$(ICUDATA_NAME)/$(BREAK_TREE) 169 $(MKINSTALLDIRS) $(ICUPKGDATA_DIR)/$(ICUDATA_NAME)/$(COLLATION_TREE) 170 $(MKINSTALLDIRS) $(ICUPKGDATA_DIR)/$(ICUDATA_NAME)/$(RBNF_TREE) 171 $(MKINSTALLDIRS) $(ICUPKGDATA_DIR)/$(ICUDATA_NAME)/$(TRANSLIT_TREE) 172 endif 173 ifneq ($(ENABLE_STATIC),) 174 ifeq ($(PKGDATA_MODE),dll) 175 $(PKGDATA_INVOKE) $(PKGDATA) -m static -e $(ICUDATA_ENTRY_POINT) -T $(OUTTMPDIR) -s $(BUILDDIR) -p $(ICUDATA_NAME) $(PKGDATA_LIBSTATICNAME) $(PKGDATA_LIST) -I $(ICUPKGDATA_INSTALL_LIBDIR) 176 endif 177 endif 178 ifneq ($(ICUDATA_SOURCE_IS_NATIVE_TARGET),YES) 179 $(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) 180 else 181 $(INSTALL_DATA) $(ICUDATA_SOURCE_ARCHIVE) $(DESTDIR)$(ICUPKGDATA_DIR) 182 endif 183 184 185 #### 186 #### 187 #### 390 support 188 install390: package390 189 $(MKINSTALLDIRS) $(TMPDATADIR) $(DESTDIR)$(libdir) 190 $(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) 191 ifeq ($(PKGDATA_MODE),dll) 192 $(INSTALL-L) $(ICUPKGDATA_OUTDIR)/$(FINAL_IMPORT_LIB) $(DESTDIR)$(ICUPKGDATA_DIR)/$(FINAL_IMPORT_LIB) 193 endif 194 195 #### $(LIB_ICUDATA_NAME)$(STUB_SUFFIX) is the subset data for batch mode 196 package390: $(OUTTMPDIR)/icudata390.lst $(PKGDATA_LIST) ./icupkg.inc packagedata 197 ln -s $(ICUDATA_NAME) $(OUTDIR)/build/$(ICUDATA_NAME)$(STUB_SUFFIX) 198 $(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) 199 cp $(ICUPKGDATA_OUTDIR)/$(LIB_ICUDATA_NAME)$(STUB_SUFFIX).$(SO) $(top_builddir)/stubdata/$(LIB_ICUDATA_NAME)$(STUB_SUFFIX).$(SO) 200 201 202 ##### Define all the data files. the build rule that depends on them is below. 203 # X_FILES_SHORT = just the base names (for lists) 204 # X_FILES = full paths (for dependency) 205 206 ## DAT files - Misc. data files. 207 # 2005-may-05 Removed Unicode properties files (unorm.icu, uprops.icu, ucase.icu, ubidi.icu) 208 # from data build. See Jitterbug 4497. (makedata.mak revision 1.117) 209 # 210 DAT_FILES_SHORT=pnames.icu unames.icu cnvalias.icu coll/ucadata.icu coll/invuca.icu 211 DAT_FILES=$(DAT_FILES_SHORT:%=$(BUILDDIR)/%) 212 213 ## BRK files 214 BREAK_TREE=brkitr 215 -include $(BRKSRCDIR)/brkfiles.mk 216 -include $(BRKSRCDIR)/brklocal.mk 217 ALL_BRK_SOURCE= $(BRK_SOURCE) $(BRK_SOURCE_LOCAL) 218 BRK_FILES_SHORT=$(ALL_BRK_SOURCE:%.txt=$(BREAK_TREE)/%.brk) 219 BRK_FILES=$(ALL_BRK_SOURCE:%.txt=$(BRKBLDDIR)/%.brk) 220 ifdef BRK_CTD_SOURCE 221 ALL_CTD_SOURCE=$(BRK_CTD_SOURCE) $(BRK_CTD_SOURCE_LOCAL) 222 CTD_FILES_SHORT=$(ALL_CTD_SOURCE:%.txt=$(BREAK_TREE)/%.ctd) 223 CTD_FILES=$(ALL_CTD_SOURCE:%.txt=$(BRKBLDDIR)/%.ctd) 224 endif 225 ifdef BRK_RES_SOURCE 226 BRS_SRC= root.txt $(BRK_RES_SOURCE) $(BRK_RES_SOURCE_LOCAL) 227 BRS_SRC_FILES = $(BRS_SRC:%=$(BRKSRCDIR)/%) 228 INSTALLED_BRS_FILES = $(BRK_RES_SOURCE:%.txt=%) $(BRK_RES_SOURCE_LOCAL:%.txt=%) 229 endif 230 231 ## Confusables (Spoofing) files 232 ALL_CFU_SOURCE=$(UNICODEDATADIR)/confusables.txt $(UNICODEDATADIR)/confusablesWholeScript.txt 233 CFU_FILES_SHORT=confusables.cfu 234 CFU_FILES=$(BUILDDIR)/$(CFU_FILES_SHORT) 235 236 ## UCM files 237 -include $(UCMSRCDIR)/ucmcore.mk 238 -include $(UCMSRCDIR)/ucmfiles.mk 239 -include $(UCMSRCDIR)/ucmebcdic.mk 240 -include $(UCMSRCDIR)/ucmlocal.mk 241 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) 242 UCM_FILES = $(ALL_UCM_SOURCE:%=$(SRCDATADIR)/%) 243 CNV_FILES = $(ALL_UCM_SOURCE:%.ucm=$(BUILDDIR)/%.cnv) 244 CNV_FILES_SHORT = $(ALL_UCM_SOURCE:%.ucm=%.cnv) 245 246 ## RES files 247 -include $(LOCSRCDIR)/resfiles.mk 248 -include $(COLSRCDIR)/colfiles.mk 249 -include $(RBNFSRCDIR)/rbnffiles.mk 250 -include $(TRANSLITSRCDIR)/trnsfiles.mk 251 -include $(LOCSRCDIR)/reslocal.mk 252 -include $(COLSRCDIR)/collocal.mk 253 -include $(BRKSRCDIR)/brslocal.mk 254 -include $(RBNFSRCDIR)/rbnflocal.mk 255 -include $(TRANSLITSRCDIR)/trnslocal.mk 256 ifdef GENRB_SOURCE 257 RES_SRC= root.txt $(GENRB_SOURCE) $(GENRB_ALIAS_SOURCE) $(GENRB_SOURCE_LOCAL) $(GENRB_ALIAS_SOURCE_LOCAL) 258 RES_SRC_FILES = $(RES_SRC:%=$(LOCSRCDIR)/%) 259 INSTALLED_RB_FILES = $(GENRB_SOURCE:%.txt=%) $(GENRB_SOURCE_LOCAL:%.txt=%) 260 endif 261 ifdef COLLATION_SOURCE 262 COL_SRC= root.txt $(COLLATION_SOURCE) $(COLLATION_ALIAS_SOURCE) $(COLLATION_SOURCE_LOCAL) 263 COL_SRC_FILES = $(COL_SRC:%=$(COLSRCDIR)/%) 264 INSTALLED_COL_FILES = $(COLLATION_SOURCE:%.txt=%) $(COLLATION_SOURCE_LOCAL:%.txt=%) 265 endif 266 ifdef RBNF_SOURCE 267 RBNF_SRC= root.txt $(RBNF_SOURCE) $(RBNF_ALIAS_SOURCE) $(RBNF_SOURCE_LOCAL) 268 RBNF_SRC_FILES = $(RBNF_SRC:%=$(RBNFSRCDIR)/%) 269 INSTALLED_RBNF_FILES = $(RBNF_SOURCE:%.txt=%) $(RBNF_SOURCE_LOCAL:%.txt=%) 270 endif 271 ifdef TRANSLIT_SOURCE 272 TRANSLIT_SRC= $(TRANSLIT_SOURCE) $(TRANSLIT_ALIAS_SOURCE) $(TRANSLIT_SOURCE_LOCAL) 273 TRANSLIT_SRC_FILES = $(TRANSLIT_SRC:%=$(TRANSLITSRCDIR)/%) 274 INSTALLED_TRANSLIT_FILES = $(TRANSLIT_SOURCE:%.txt=%) $(TRANSLIT_SOURCE_LOCAL:%.txt=%) 275 endif 276 GENRBOPTS=-k 277 278 ## MISC files 279 -include $(MISCSRCDIR)/miscfiles.mk 280 -include $(MISCSRCDIR)/misclocal.mk 281 MSC_SOURCE= $(MISC_SOURCE) $(MISC_SOURCE_LOCAL) 282 MSC_SRC_FILES=$(MSC_SOURCE:%=$(MISCSRCDIR)/%) 283 284 ifeq ($(ENABLE_SO_VERSION_DATA),1) 285 ifeq ($(PKGDATA_MODE),dll) 286 SO_VERSION_DATA = $(OUTTMPDIR)/icudata.res 287 $(SO_VERSION_DATA) : $(MISCSRCDIR)/icudata.rc 288 rc.exe /i$(srcdir)/../common /fo$@ $(CPPFLAGS) $(SOURCE_FILE) 289 endif 290 endif 291 292 ALL_RES_SRC= $(RES_SRC) $(TRNS_SOURCE) $(MSC_SOURCE) 293 RES_FILES = $(ALL_RES_SRC:%.txt=$(BUILDDIR)/%.res) 294 RES_FILES_SHORT = $(ALL_RES_SRC:%.txt=%.res) 295 PKGDATA_LIST = $(OUTTMPDIR)/icudata.lst 296 297 INDEX_NAME=res_index 298 INDEX_FILE=$(OUTTMPDIR)/$(INDEX_NAME).txt 299 INDEX_RES_FILE=$(INDEX_FILE:$(OUTTMPDIR)/%.txt=$(BUILDDIR)/%.res) 300 INDEX_RES_FILE_SHORT=$(INDEX_FILE:$(OUTTMPDIR)/%.txt=%.res) 301 302 COLLATION_TREE=coll 303 COLLATION_INDEX_FILE=$(OUTTMPDIR)/$(COLLATION_TREE)/$(INDEX_NAME).txt 304 COLLATION_INDEX_RES=$(COLBLDDIR)/$(INDEX_NAME).res 305 COLLATION_INDEX_RES_SHORT=$(COLLATION_TREE)/$(INDEX_NAME).res 306 COLLATION_FILES = $(COL_SRC:%.txt=$(COLBLDDIR)/%.res) $(COLLATION_INDEX_RES) 307 COLLATION_FILES_SHORT = $(COL_SRC:%.txt=$(COLLATION_TREE)/%.res) 308 309 BRK_RES_INDEX_FILE=$(OUTTMPDIR)/$(BREAK_TREE)/$(INDEX_NAME).txt 310 BRK_RES_INDEX_RES=$(BRKBLDDIR)/$(INDEX_NAME).res 311 BRK_RES_INDEX_RES_SHORT=$(BREAK_TREE)/$(INDEX_NAME).res 312 BRK_RES_FILES = $(BRS_SRC:%.txt=$(BRKBLDDIR)/%.res) $(BRK_RES_INDEX_RES) 313 BRK_RES_FILES_SHORT = $(BRS_SRC:%.txt=$(BREAK_TREE)/%.res) 314 315 RBNF_TREE=rbnf 316 RBNF_INDEX_FILE=$(OUTTMPDIR)/$(RBNF_TREE)/$(INDEX_NAME).txt 317 RBNF_INDEX_RES=$(RBNFBLDDIR)/$(INDEX_NAME).res 318 RBNF_INDEX_RES_SHORT=$(RBNF_TREE)/$(INDEX_NAME).res 319 RBNF_FILES = $(RBNF_SRC:%.txt=$(RBNFBLDDIR)/%.res) $(RBNF_INDEX_RES) 320 RBNF_FILES_SHORT = $(RBNF_SRC:%.txt=$(RBNF_TREE)/%.res) 321 322 TRANSLIT_TREE=translit 323 #TRANSLIT_INDEX_FILE=$(OUTTMPDIR)/$(TRANSLIT_TREE)/$(INDEX_NAME).txt 324 #TRANSLIT_INDEX_RES=$(TRANSLITBLDDIR)/$(INDEX_NAME).res 325 #TRANSLIT_INDEX_RES_SHORT=$(TRANSLIT_TREE)/$(INDEX_NAME).res 326 TRANSLIT_FILES = $(TRANSLIT_SRC:%.txt=$(TRANSLITBLDDIR)/%.res) 327 TRANSLIT_FILES_SHORT = $(TRANSLIT_SRC:%.txt=$(TRANSLIT_TREE)/%.res) 328 329 ## SPP files 330 -include $(SPREPSRCDIR)/sprepfiles.mk 331 -include $(SPREPSRCDIR)/spreplocal.mk 332 ALL_SPREP_SOURCE=$(SPREP_SOURCE) $(SPREP_SOURCE_LOCAL) 333 SPREP_FILES = $(ALL_SPREP_SOURCE:%.txt=$(BUILDDIR)/%.spp) 334 SPREP_FILES_SHORT = $(ALL_SPREP_SOURCE:%.txt=%.spp) 335 336 ## All generated files 337 ALL_FILES = $(DAT_FILES) $(CNV_FILES) $(BRK_FILES) $(CTD_FILES) $(RES_FILES) $(INDEX_RES_FILE) $(COLLATION_FILES) $(BRK_RES_FILES) $(RBNF_FILES) $(TRANSLIT_FILES) $(SPREP_FILES) $(CFU_FILES) 338 ALL_INDEX_SRC_FILES = $(PKGDATA_LIST) $(INDEX_FILE) $(COLLATION_INDEX_FILE) $(BRK_RES_INDEX_FILE) $(RBNF_INDEX_FILE) 339 # a list to use in the .lst files (package-relative) 340 ALL_FILES_LIST = $(DAT_FILES_SHORT) $(CNV_FILES_SHORT) $(BRK_FILES_SHORT) $(CTD_FILES_SHORT) $(RES_FILES_SHORT) $(INDEX_RES_FILE_SHORT) $(COLLATION_FILES_SHORT) $(COLLATION_INDEX_RES_SHORT) $(BRK_RES_FILES_SHORT) $(BRK_RES_INDEX_RES_SHORT) $(RBNF_FILES_SHORT) $(RBNF_INDEX_RES_SHORT) $(TRANSLIT_FILES_SHORT) $(SPREP_FILES_SHORT) $(CFU_FILES_SHORT) 341 342 UNI_CORE_DATA=uprops.icu ucase.icu ubidi.icu unorm.icu 343 UNI_CORE_TARGET_DATA=$(UNI_CORE_DATA:%=$(BUILDDIR)/%) 344 345 ifneq ($(INCLUDE_UNI_CORE_DATA),) 346 ALL_FILES_LIST+=$(UNI_CORE_DATA) 347 build-local: uni-core-data 348 endif 349 350 ##################################################### 351 # General data build rules 352 353 ## Files to remove for 'make clean' 354 CLEANFILES = *~ icupkg.inc 355 356 ifeq ($(ICUDATA_SOURCE_ARCHIVE),) 357 build-local: build-dir $(SO_VERSION_DATA) $(ALL_FILES) $(PKGDATA_LIST) $(OS390LIST) 358 $(PKGDATA_LIST): $(SRCLISTDEPS) 359 @echo "generating $@ (list of data files)" 360 @-$(RMV) $@ 361 @for file in $(ALL_FILES_LIST); do \ 362 echo $$file >> $@; \ 363 done; 364 else 365 build-local: build-dir $(SO_VERSION_DATA) $(PKGDATA_LIST) $(OS390LIST) 366 $(PKGDATA_LIST): $(SRCLISTDEPS) $(ICUDATA_SOURCE_ARCHIVE) 367 ifneq ($(ICUDATA_SOURCE_IS_NATIVE_TARGET),YES) 368 @echo "Unpacking $(ICUDATA_SOURCE_ARCHIVE) and generating $@ (list of data files)" 369 @-$(RMV) $@ 370 $(INVOKE) $(TOOLBINDIR)/icupkg -d $(BUILDDIR) --list -x \* $(ICUDATA_SOURCE_ARCHIVE) -o $@ 371 else 372 @echo "$@" > $@ 373 endif 374 endif 375 376 377 $(BUILD_DIRS): build-dir 378 379 build-dir: 380 @list='$(BUILD_DIRS)'; \ 381 for dir in $$list; do \ 382 if ! test -d $$dir; then \ 383 echo $(MKINSTALLDIRS) $(BUILD_DIRS); \ 384 $(MKINSTALLDIRS) $(BUILD_DIRS); \ 385 fi; \ 386 done 387 388 # The | is an order-only prerequisite. This helps when the -j option is used, 389 # and we don't want the files to be built before the directories are built. 390 ifneq ($(filter order-only,$(.FEATURES)),) 391 $(ALL_FILES) $(ALL_INDEX_SRC_FILES): | build-dir 392 endif 393 394 # Now, sections for building each kind of data. 395 396 #################################################### DAT 397 # DAT FILES 398 399 # uprops.icu 400 $(BUILDDIR)/uprops.icu: $(UNICODEDATADIR)/UnicodeData.txt $(UNICODEDATADIR)/BidiMirroring.txt $(TOOLBINDIR)/genprops$(TOOLEXEEXT) $(BUILDDIR)/$(ICUDT)pnames.icu 401 $(INVOKE) $(TOOLBINDIR)/genprops -s $(UNICODEDATADIR) -i $(BUILDDIR) -d $(BUILDDIR) -u $(UNICODE_VERSION) 402 $(INVOKE) $(TOOLBINDIR)/genprops --csource -s $(UNICODEDATADIR) -i $(BUILDDIR) -d $(OUTTMPDIR) -u $(UNICODE_VERSION) 403 404 # ubidi.icu 405 $(BUILDDIR)/ubidi.icu: $(UNICODEDATADIR)/UnicodeData.txt $(TOOLBINDIR)/genbidi$(TOOLEXEEXT) 406 $(INVOKE) $(TOOLBINDIR)/genbidi -s $(UNICODEDATADIR) -i $(BUILDDIR) -d $(BUILDDIR) -u $(UNICODE_VERSION) 407 $(INVOKE) $(TOOLBINDIR)/genbidi --csource -s $(UNICODEDATADIR) -i $(BUILDDIR) -d $(OUTTMPDIR) -u $(UNICODE_VERSION) 408 409 # ucase.icu 410 $(BUILDDIR)/ucase.icu: $(UNICODEDATADIR)/UnicodeData.txt $(TOOLBINDIR)/gencase$(TOOLEXEEXT) 411 $(INVOKE) $(TOOLBINDIR)/gencase -s $(UNICODEDATADIR) -i $(BUILDDIR) -d $(BUILDDIR) -u $(UNICODE_VERSION) 412 $(INVOKE) $(TOOLBINDIR)/gencase --csource -s $(UNICODEDATADIR) -i $(BUILDDIR) -d $(OUTTMPDIR) -u $(UNICODE_VERSION) 413 414 # pnames.icu 415 $(BUILDDIR)/pnames.icu: $(UNICODEDATADIR)/PropertyAliases.txt $(UNICODEDATADIR)/PropertyValueAliases.txt $(UNICODEDATADIR)/Blocks.txt $(COMINCDIR)/uscript.h $(COMINCDIR)/uchar.h $(TOOLBINDIR)/genpname$(TOOLEXEEXT) 416 $(INVOKE) $(TOOLBINDIR)/genpname -d $(BUILDDIR) 417 418 # unorm.icu 419 $(BUILDDIR)/unorm.icu: $(UNICODEDATADIR)/UnicodeData.txt $(UNICODEDATADIR)/DerivedNormalizationProps.txt $(UNICODEDATADIR)/BidiMirroring.txt $(TOOLBINDIR)/gennorm$(TOOLEXEEXT) $(BUILDDIR)/$(ICUDT)pnames.icu $(BUILDDIR)/$(ICUDT)uprops.icu $(BUILDDIR)/$(ICUDT)ucase.icu 420 $(INVOKE) $(TOOLBINDIR)/gennorm -s $(UNICODEDATADIR) -i $(BUILDDIR) -d $(BUILDDIR) -u $(UNICODE_VERSION) 421 $(INVOKE) $(TOOLBINDIR)/gennorm --csource -s $(UNICODEDATADIR) -i $(BUILDDIR) -d $(OUTTMPDIR) -u $(UNICODE_VERSION) 422 423 # ucadata.icu 424 # used to depend on $(BUILDDIR)/$(ICUDT)unorm.icu $(BUILDDIR)/$(ICUDT)ucase.icu 425 # see Jitterbug 4497 426 $(COLBLDDIR)/ucadata.icu $(COLBLDDIR)/invuca.icu: $(UNICODEDATADIR)/FractionalUCA.txt $(TOOLBINDIR)/genuca$(TOOLEXEEXT) 427 $(INVOKE) $(TOOLBINDIR)/genuca -s $(UNICODEDATADIR) -d $(COLBLDDIR) -i $(BUILDDIR) 428 429 # unames.icu 430 $(BUILDDIR)/unames.icu: $(UNICODEDATADIR)/UnicodeData.txt $(TOOLBINDIR)/gennames$(TOOLEXEEXT) 431 $(INVOKE) $(TOOLBINDIR)/gennames -1 -d $(BUILDDIR) $(UNICODEDATADIR)/UnicodeData.txt -u $(UNICODE_VERSION) 432 433 # cnvalias.icu 434 $(BUILDDIR)/cnvalias.icu: $(UCMSRCDIR)/convrtrs.txt $(TOOLBINDIR)/gencnval$(TOOLEXEEXT) 435 $(INVOKE) $(TOOLBINDIR)/gencnval -d $(BUILDDIR) $(UCMSRCDIR)/convrtrs.txt 436 437 #################################################### SPP 438 # SPP FILES 439 440 $(BUILDDIR)/%.spp: $(SPREPSRCDIR)/%.txt $(TOOLBINDIR)/gensprep$(TOOLEXEEXT) $(BUILDDIR)/unames.icu $(BUILDDIR)/pnames.icu 441 $(INVOKE) $(TOOLBINDIR)/gensprep -d $(BUILDDIR) -i $(BUILDDIR) -s $(SPREPSRCDIR) -b $(@F:%.spp=%) -m $(UNICODEDATADIR) -u 3.2.0 $(<F) 442 443 #################################################### BRK 444 # BRK FILES 445 446 #thaidict.brk: $(SRCDATADIR)/thaidict.brk 447 # $(RMV) $@ && ln -s $(BUILDDIR) $@ 448 449 $(BRKBLDDIR)/%.brk: $(BRKSRCDIR)/%.txt $(TOOLBINDIR)/genbrk$(TOOLEXEEXT) $(DAT_FILES) 450 $(INVOKE) $(TOOLBINDIR)/genbrk -c -i $(BUILDDIR) -r $< -o $@ 451 452 #################################################### CTD 453 # CTD FILES 454 455 $(BRKBLDDIR)/%.ctd: $(BRKSRCDIR)/%.txt $(TOOLBINDIR)/genctd$(TOOLEXEEXT) $(DAT_FILES) 456 $(INVOKE) $(TOOLBINDIR)/genctd -c -i $(BUILDDIR) -o $@ $< 457 458 #################################################### CFU 459 # CFU FILES 460 # Note: gencfu requires two input files to produce a single output file. 461 # There will be exactly one target file and two source files. 462 # The $(word n, ...) selects the nth word from the following stuff. 463 # There must be a nicer way to do this. 464 465 $(CFU_FILES): $(ALL_CFU_SOURCE) $(TOOLBINDIR)/gencfu$(EXEEXT) $(DAT_FILES) 466 $(INVOKE) echo ALL_CFU_SOURCE: $(ALL_CFU_SOURCE) 467 $(INVOKE) echo CFU_FILES: $(CFU_FILES) 468 $(INVOKE) echo CFU_FILES_SHORT: $(CFU_FILES_SHORT) 469 $(INVOKE) $(TOOLBINDIR)/gencfu -c -i $(BUILDDIR) -r $(word 1,$(ALL_CFU_SOURCE)) -w $(word 2,$(ALL_CFU_SOURCE)) -o $@ 470 471 472 #################################################### CNV 473 # CNV FILES 474 $(BUILDDIR)/%.cnv: $(UCMSRCDIR)/%.ucm $(TOOLBINDIR)/makeconv$(TOOLEXEEXT) 475 $(INVOKE) $(TOOLBINDIR)/makeconv -c -d $(BUILDDIR) $(UCMSRCDIR)/$(<F) 476 477 #################################################### RES 478 # RES FILES 479 480 ### collation res 481 $(COLBLDDIR)/%.res: $(COLSRCDIR)/%.txt $(TOOLBINDIR)/genrb$(TOOLEXEEXT) $(DAT_FILES) 482 $(INVOKE) $(TOOLBINDIR)/genrb $(GENRBOPTS) -i $(BUILDDIR) -s $(COLSRCDIR) -d $(COLBLDDIR) $(<F) 483 484 $(COLBLDDIR)/$(INDEX_NAME).res: $(OUTTMPDIR)/$(COLLATION_TREE)/$(INDEX_NAME).txt $(TOOLBINDIR)/genrb$(TOOLEXEEXT) 485 $(INVOKE) $(TOOLBINDIR)/genrb $(GENRBOPTS) -i $(BUILDDIR) -s $(OUTTMPDIR)/$(COLLATION_TREE) -d $(COLBLDDIR) $(INDEX_NAME).txt 486 487 $(COLLATION_INDEX_FILE): $(SRCLISTDEPS) 488 @echo "generating $@ (list of installed collation locales)"; \ 489 $(RMV) $@; \ 490 echo "// Warning this file is automatically generated" > $@; \ 491 echo "$(INDEX_NAME):table(nofallback) {" >> $@; \ 492 echo " InstalledLocales {" >> $@; \ 493 for file in $(INSTALLED_COL_FILES); do \ 494 echo " $$file {\"\"}" >> $@; \ 495 done; \ 496 echo " }" >> $@; \ 497 echo "}" >> $@; 498 499 ### brk res 500 $(BRKBLDDIR)/%.res: $(BRKSRCDIR)/%.txt $(TOOLBINDIR)/genrb$(TOOLEXEEXT) $(BRK_FILES) $(DAT_FILES) 501 $(INVOKE) $(TOOLBINDIR)/genrb $(GENRBOPTS) -i $(BUILDDIR) -s $(BRKSRCDIR) -d $(BRKBLDDIR) $(<F) 502 503 $(BRKBLDDIR)/$(INDEX_NAME).res: $(OUTTMPDIR)/$(BREAK_TREE)/$(INDEX_NAME).txt $(TOOLBINDIR)/genrb$(TOOLEXEEXT) 504 $(INVOKE) $(TOOLBINDIR)/genrb $(GENRBOPTS) -i $(BUILDDIR) -s $(OUTTMPDIR)/$(BREAK_TREE) -d $(BRKBLDDIR) $(INDEX_NAME).txt 505 506 $(BRK_RES_INDEX_FILE): $(SRCLISTDEPS) 507 @echo "generating $@ (list of installed break locales)"; \ 508 $(RMV) $@; \ 509 echo "// Warning this file is automatically generated" > $@; \ 510 echo "$(INDEX_NAME):table(nofallback) {" >> $@; \ 511 echo " InstalledLocales {" >> $@; \ 512 for file in $(INSTALLED_BRS_FILES); do \ 513 echo " $$file {\"\"}" >> $@; \ 514 done; \ 515 echo " }" >> $@; \ 516 echo "}" >> $@; 517 518 ### RBNF res 519 $(RBNFBLDDIR)/%.res: $(RBNFSRCDIR)/%.txt $(TOOLBINDIR)/genrb$(TOOLEXEEXT) $(DAT_FILES) 520 $(INVOKE) $(TOOLBINDIR)/genrb $(GENRBOPTS) -i $(BUILDDIR) -s $(RBNFSRCDIR) -d $(RBNFBLDDIR) $(<F) 521 522 $(RBNFBLDDIR)/$(INDEX_NAME).res: $(OUTTMPDIR)/$(RBNF_TREE)/$(INDEX_NAME).txt $(TOOLBINDIR)/genrb$(TOOLEXEEXT) 523 $(INVOKE) $(TOOLBINDIR)/genrb $(GENRBOPTS) -i $(BUILDDIR) -s $(OUTTMPDIR)/$(RBNF_TREE) -d $(RBNFBLDDIR) $(INDEX_NAME).txt 524 525 $(RBNF_INDEX_FILE): $(SRCLISTDEPS) 526 @echo "generating $@ (list of installed RBNF locales)"; \ 527 $(RMV) $@; \ 528 echo "// Warning this file is automatically generated" > $@; \ 529 echo "$(INDEX_NAME):table(nofallback) {" >> $@; \ 530 echo " InstalledLocales {" >> $@; \ 531 for file in $(INSTALLED_RBNF_FILES); do \ 532 echo " $$file {\"\"}" >> $@; \ 533 done; \ 534 echo " }" >> $@; \ 535 echo "}" >> $@; 536 537 ### TRANSLIT res 538 $(TRANSLITBLDDIR)/%.res: $(TRANSLITSRCDIR)/%.txt $(TOOLBINDIR)/genrb$(TOOLEXEEXT) $(DAT_FILES) 539 $(INVOKE) $(TOOLBINDIR)/genrb $(GENRBOPTS) -i $(BUILDDIR) -s $(TRANSLITSRCDIR) -d $(TRANSLITBLDDIR) $(<F) 540 541 ### normal (locale) res 542 all-RES: $(RES_FILES) 543 544 $(BUILDDIR)/%.res: $(LOCSRCDIR)/%.txt $(TOOLBINDIR)/genrb$(TOOLEXEEXT) $(DAT_FILES) 545 $(INVOKE) $(TOOLBINDIR)/genrb $(GENRBOPTS) -i $(BUILDDIR) -s $(LOCSRCDIR) -d $(BUILDDIR) $(<F) 546 547 # if the tzcode directory contains a new tzdata*.tar.gz file, use it for zoneinfo.txt 548 TZDATA = $(firstword $(wildcard $(top_builddir)/tools/tzcode/tzdata*.tar.gz) $(wildcard $(top_srcdir)/tools/tzcode/tzdata*.tar.gz)) 549 550 ifneq ($(TZDATA),) 551 552 TZCODE_DIR=$(top_builddir)/tools/tzcode 553 ZONEINFO=$(TZCODE_DIR)/zoneinfo.txt 554 555 # Override the normal genrb for zoneinfo.txt to always pull from 556 # icu/source/tools/tzcode/zoneinfo.txt 557 $(BUILDDIR)/zoneinfo.res: $(ZONEINFO) $(TOOLBINDIR)/genrb$(TOOLEXEEXT) 558 @echo Note: $(MISCSRCDIR)/zoneinfo.txt is IGNORED because $(TZDATA) is present. 559 $(INVOKE) $(TOOLBINDIR)/genrb $(GENRBOPTS) -q -i $(BUILDDIR) -d $(BUILDDIR) $(ZONEINFO) 560 561 # Create the tzcode tool and zoneinfo.txt as needed. 562 $(ZONEINFO): $(TZDATA) 563 @echo "$(MAKE)[$(MAKELEVEL)]: Making \`$(ZONEINFO)' in \`$(TZCODE_DIR)'"; \ 564 (cd $(TZCODE_DIR) && $(MAKE)) || exit; \ 565 566 # end of zoneinfo.txt-generation 567 endif 568 569 # zoneinfo has some issues. Ignore some warnings with -q 570 $(BUILDDIR)/%.res: $(MISCSRCDIR)/%.txt $(TOOLBINDIR)/genrb$(TOOLEXEEXT) 571 $(INVOKE) $(TOOLBINDIR)/genrb $(GENRBOPTS) -q -i $(BUILDDIR) -s $(MISCSRCDIR) -d $(BUILDDIR) $(<F) 572 573 574 575 $(INDEX_FILE): $(SRCLISTDEPS) 576 @echo "generating $@ (list of installed locales)"; \ 577 $(RMV) $@; \ 578 echo "// Warning this file is automatically generated" > $@; \ 579 echo "$(INDEX_NAME):table(nofallback) {" >> $@; \ 580 echo " CLDRVersion { \"$(GENRB_CLDR_VERSION)\" }" >> $@; \ 581 echo " InstalledLocales {" >> $@; \ 582 for file in $(INSTALLED_RB_FILES); do \ 583 echo " $$file {\"\"}" >> $@; \ 584 done; \ 585 echo " }" >> $@; \ 586 echo "}" >> $@; 587 588 clean-resindex: 589 -$(RMV) $(BUILDDIR)/$(INDEX_NAME).txt $(PKGDATA_LIST) 590 591 $(INDEX_RES_FILE): $(INDEX_FILE) $(TOOLBINDIR)/genrb$(TOOLEXEEXT) 592 $(INVOKE) $(TOOLBINDIR)/genrb $(GENRBOPTS) -i $(BUILDDIR) -d $(BUILDDIR) $(INDEX_FILE) 593 594 # Starting with ICU4C 3.4, the core Unicode properties files (uprops.icu, ucase.icu, ubidi.icu, unorm.icu) 595 # are hardcoded in the common DLL and therefore not included in the data package any more. 596 # They are not built by default but need to be built for ICU4J data and for getting the .c source files 597 # when updating the Unicode data. 598 # Changed in Makefile.in revision 1.147. See Jitterbug 4497. 599 uni-core-data: build-dir $(UNI_CORE_TARGET_DATA) 600 @echo Unicode .icu files built to $(BUILDDIR) 601 @echo Unicode .c source files built to $(OUTTMPDIR) 602 603 build-icu4j: all 604 $(MAKE) -C ../tools/genrb $@ 605 606 ################################################################### 607 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status 608 cd $(top_builddir) \ 609 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status 610 611 icupkg.inc: pkgdataMakefile 612 $(MAKE) -f pkgdataMakefile 613 614 pkgdataMakefile: 615 cd $(top_builddir) \ 616 && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status 617 618 ########### 619 ########### 390 (z/OS) support 620 UCMFILES390=ebcdic-xml-us.ucm ibm-37_P100-1995.ucm ibm-1047_P100-1995.ucm ibm-4909_P100-1999.ucm 621 # used to depend on uprops.icu ucase.icu ubidi.icu unorm.icu 622 # see Jitterbug 4497 623 ALLFILES390=pnames.icu cnvalias.icu $(UCMFILES390:.ucm=.cnv) 624 625 $(OUTTMPDIR)/icudata390.lst: $(SRCLISTDEPS) 626 @echo "generating $@ (list of 390 data files)" 627 @-$(RMV) $@ 628 @for file in $(ALLFILES390); do \ 629 echo $$file >> $@; \ 630 done; 631 632 ifeq ($(POST_DATA_BUILD), os400-data-rebind) 633 os400-data-rebind: $(LIBICUUC) 634 635 $(LIBICUUC): $(LIBICUDT) 636 $(RMV) $(LIBICUUC) 637 (cd ../common && $(MAKE) RECURSIVE=YES) || exit; 638 endif 639 640