1# Copyright (C) 2016 and later: Unicode, Inc. and others. 2# License & terms of use: http://www.unicode.org/copyright.html 3#********************************************************************** 4#* Copyright (C) 1999-2016, International Business Machines Corporation 5#* and others. All Rights Reserved. 6#********************************************************************** 7# nmake file for creating data files on win32 8# invoke with 9# nmake /f makedata.mak icumake=$(ProjectDir) 10# 11# 12/10/1999 weiv Created 12 13############################################################################## 14# Keep the following in sync with the version - see common/unicode/uvernum.h 15U_ICUDATA_NAME=icudt72 16############################################################################## 17!IF "$(UWP)" == "UWP" 18# Optionally change the name of the data file for the UWP version. 19U_ICUDATA_NAME=icudt72 20!ENDIF 21U_ICUDATA_ENDIAN_SUFFIX=l 22UNICODE_VERSION=15.0 23ICU_LIB_TARGET=$(DLL_OUTPUT)\$(U_ICUDATA_NAME).dll 24 25# ICUMAKE 26# Must be provided by whoever runs this makefile. 27# Is the directory containing this file (makedata.mak) 28# Is the directory into which most data is built (prior to packaging) 29# Is icu\source\data\ 30# 31!IF "$(ICUMAKE)"=="" 32!ERROR Can't find ICUMAKE (ICU Data Make dir, should point to icu\source\data\ )! 33!ENDIF 34!MESSAGE ICU data make path is $(ICUMAKE) 35 36!IF [py -3 -c "exit(0)"]!=0 37!MESSAGE Information: Unable to find Python 3. Data will fail to build from source. 38!ENDIF 39 40# Suffixes for data files 41.SUFFIXES : .nrm .icu .ucm .cnv .dll .dat .res .txt .c 42 43ICUOUT=$(ICUMAKE)\out 44 45# the prefix "icudt62_" for use in filenames 46ICUPKG=$(U_ICUDATA_NAME)$(U_ICUDATA_ENDIAN_SUFFIX) 47 48# need to nuke \\ for .NET... 49ICUOUT=$(ICUOUT:\\=\) 50 51ICUBLD=$(ICUOUT)\build 52ICUBLD_PKG=$(ICUBLD)\$(ICUPKG) 53ICUTMP=$(ICUOUT)\tmp 54 55# ICUP 56# The root of the ICU source directory tree 57# 58ICUP=$(ICUMAKE)\..\.. 59ICUP=$(ICUP:\source\data\..\..=) 60# In case the first one didn't do it, try this one. .NET would do the second one. 61ICUP=$(ICUP:\source\data\\..\..=) 62!MESSAGE ICU root path is $(ICUP) 63 64 65# ICUSRCDATA 66# The data directory in source 67# 68ICUSRCDATA=$(ICUP)\source\data 69ICUSRCDATA_RELATIVE_PATH=..\..\.. 70 71# Timestamp files to keep track of current build state 72TOOLS_TS=$(ICUTMP)\tools.timestamp 73COREDATA_TS=$(ICUTMP)\coredata.timestamp 74ARM_CROSSBUILD_TS= 75 76# ICUCOL 77# The directory that contains *.txt collation data files 78# 79ICUCOL=coll 80 81# ICURBNF 82# The directory that contains *.txt RBNF data files 83# 84ICURBNF=rbnf 85 86# ICUTRNS 87# The directory that contains *.txt transliterator files 88# 89ICUTRNS=translit 90 91# ICUBRK 92# The directory that contains *.txt break iterator files 93# 94ICUBRK=brkitr 95 96# 97# ICUDATA 98# The source directory. Contains the source files for the common data to be built. 99# WARNING: NOT THE SAME AS ICU_DATA environment variable. Confusing. 100ICUDATA=$(ICUP)\source\data 101 102# 103# DLL_OUTPUT 104# Destination directory for the common data DLL file. 105# This is the same place that all of the other ICU DLLs go (the code-containing DLLs) 106# The lib file for the data DLL goes in $(DLL_OUTPUT)/../lib/ 107# 108!IF "$(CFG)" == "ARM\Release" || "$(CFG)" == "ARM\Debug" 109DLL_OUTPUT=$(ICUP)\binARM$(UWP) 110!ELSE IF "$(CFG)" == "ARM64\Release" || "$(CFG)" == "ARM64\Debug" 111DLL_OUTPUT=$(ICUP)\binARM64$(UWP) 112!ELSE IF "$(CFG)" == "x64\Release" || "$(CFG)" == "x64\Debug" 113DLL_OUTPUT=$(ICUP)\bin64$(UWP) 114!ELSE IF "$(UWP)" == "UWP" 115DLL_OUTPUT=$(ICUP)\bin32$(UWP) 116!ELSE 117DLL_OUTPUT=$(ICUP)\bin$(UWP) 118!ENDIF 119!MESSAGE ICU data DLL_OUTPUT path is $(DLL_OUTPUT) 120 121# 122# TESTDATA 123# The source directory for data needed for test programs. 124TESTDATA=$(ICUP)\source\test\testdata 125 126# 127# TESTDATAOUT 128# The destination directory for the built test data .dat file 129TESTDATAOUT=$(ICUP)\source\test\testdata\out 130 131# 132# TESTDATABLD 133# The build directory for test data intermediate files 134# (Tests are NOT run from this makefile, 135# only the data is put in place.) 136TESTDATABLD=$(ICUP)\source\test\testdata\out\build 137 138# 139# ICUTOOLS 140# Directory under which all of the ICU data building tools live. 141# 142ICUTOOLS=$(ICUP)\source\tools 143!MESSAGE ICU tools path is $(ICUTOOLS) 144 145NATIVE_ARM= 146!IF "$(PROCESSOR_ARCHITECTURE)" == "ARM64" || "$(PROCESSOR_ARCHITEW6432)" == "ARM64" 147NATIVE_ARM=ARM64 148!ELSE IF "$(PROCESSOR_ARCHITECTURE)" == "ARM" || "$(PROCESSOR_ARCHITEW6432)" == "ARM" 149NATIVE_ARM=ARM 150!ENDIF 151 152# ARM_CROSS_BUILD 153# In order to support cross-compiling for ARM/ARM64 using the x64 tools 154# we need to know if we're building the ARM/ARM64 data DLL, otherwise 155# the existence of the x64 bits will cause us to think we are already done. 156# Note: This is only for the "regular" builds, the UWP builds have a separate project file entirely. 157ARM_CROSS_BUILD= 158!IF "$(UWP)" == "" && "$(NATIVE_ARM)" == "" 159!IF "$(CFG)" == "ARM\Release" || "$(CFG)" == "ARM\Debug" 160ARM_CROSS_BUILD=ARM 161ARM_CROSSBUILD_TS=$(ICUTMP)\$(ARM_CROSS_BUILD).timestamp 162!ELSE IF "$(CFG)" == "ARM64\Release" || "$(CFG)" == "ARM64\Debug" 163ARM_CROSS_BUILD=ARM64 164ARM_CROSSBUILD_TS=$(ICUTMP)\$(ARM_CROSS_BUILD).timestamp 165!ENDIF 166!ENDIF 167 168# 169# TOOLS CFG PATH 170# Generally the tools want to run on the same architecture as is being built. 171# Thus ARM and ARM64 need to use another build of the other tools, so make sure to get an usable CFG path. 172# Since tools, particularly pkggen, have architecture built-in, we made x64 on 173# Windows be machine-independent and use those tools for both ARM and ARM64. 174# Note: If we're building ARM/ARM64 Debug, then we'll use the x64 Debug tools. 175# If we're building ARM/ARM64 Release, then we'll use the x64 Release tools. 176# 177!IF "$(ARM_CROSS_BUILD)" == "" 178CFGTOOLS=$(CFG) 179!ELSE 180!IF "$(CFG)" == "ARM\Release" || "$(CFG)" == "ARM64\Release" 181CFGTOOLS=x64\Release 182!ENDIF 183!IF "$(CFG)" == "ARM\Debug" || "$(CFG)" == "ARM64\Debug" 184CFGTOOLS=x64\Debug 185!ENDIF 186!ENDIF 187!MESSAGE ICU tools CFG subpath is $(CFGTOOLS) 188 189 190# The current ICU tools need to be in the path first. 191# x86 uses x86; x64, arm, and arm64 use x64 192!IF "$(CFG)" == "x86\Release" || "$(CFG)" == "x86\Debug" 193PATH = $(ICUP)\bin;$(PATH) 194ICUPBIN=$(ICUP)\bin 195# Use these path whether or not it's UWP build. 196!ELSE IF "$(NATIVE_ARM)" != "" 197!IF "$(CFG)" == "ARM\Release" || "$(CFG)" == "ARM\Debug" 198PATH = $(ICUP)\binARM;$(PATH) 199ICUPBIN=$(ICUP)\binARM 200!ELSE IF "$(CFG)" == "ARM64\Release" || "$(CFG)" == "ARM64\Debug" 201PATH = $(ICUP)\binARM64;$(PATH) 202ICUPBIN=$(ICUP)\binARM64 203!ELSE 204!ERROR Cross-build from ARM to x86 is not supported! 205!ENDIF 206# Build x86_64 or cross-build ARM 207!ELSE 208PATH = $(ICUP)\bin64;$(PATH) 209ICUPBIN=$(ICUP)\bin64 210!ENDIF 211 212 213# This variable can be overridden to "-m static" by the project settings, 214# if you want a static data library. 215!IF "$(ICU_PACKAGE_MODE)"=="" 216ICU_PACKAGE_MODE=-m dll 217!ENDIF 218 219# If this archive exists, build from that 220# instead of building everything from scratch. 221ICUDATA_SOURCE_ARCHIVE=$(ICUSRCDATA)\in\$(ICUPKG).dat 222!IF !EXISTS("$(ICUDATA_SOURCE_ARCHIVE)") 223# Does a big endian version exist either? 224ICUDATA_ARCHIVE=$(ICUSRCDATA)\in\$(U_ICUDATA_NAME)b.dat 225!IF EXISTS("$(ICUDATA_ARCHIVE)") 226ICUDATA_SOURCE_ARCHIVE=$(ICUTMP)\$(ICUPKG).dat 227!ELSE 228# Nothing was usable for input 229!UNDEF ICUDATA_SOURCE_ARCHIVE 230!ENDIF 231!ENDIF 232 233!IFDEF ICUDATA_SOURCE_ARCHIVE 234!MESSAGE ICU data source archive is $(ICUDATA_SOURCE_ARCHIVE) 235!ENDIF 236 237# Common defines for both ways of building ICU's data library. 238COMMON_ICUDATA_DEPENDENCIES="$(ICUPBIN)\pkgdata.exe" "$(ICUTMP)\icudata.res" "$(ICUP)\source\stubdata\stubdatabuilt.txt" 239COMMON_ICUDATA_ARGUMENTS=-f -e $(U_ICUDATA_NAME) -v $(ICU_PACKAGE_MODE) -c -p $(ICUPKG) -T "$(ICUTMP)" -L $(U_ICUDATA_NAME) -d "$(ICUBLD_PKG)" -s . 240!IF "$(UWP)" == "UWP" 241COMMON_ICUDATA_ARGUMENTS=$(COMMON_ICUDATA_ARGUMENTS) -u 242!ENDIF 243!IF "$(CFG)" == "x64\Release" || "$(CFG)" == "x64\Debug" 244COMMON_ICUDATA_ARGUMENTS=$(COMMON_ICUDATA_ARGUMENTS) -a X64 245!ENDIF 246!IF "$(CFG)" == "ARM\Release" || "$(CFG)" == "ARM\Debug" 247COMMON_ICUDATA_ARGUMENTS=$(COMMON_ICUDATA_ARGUMENTS) -a ARM 248!ENDIF 249!IF "$(CFG)" == "ARM64\Release" || "$(CFG)" == "ARM64\Debug" 250COMMON_ICUDATA_ARGUMENTS=$(COMMON_ICUDATA_ARGUMENTS) -a ARM64 251!ENDIF 252 253############################################################################# 254# 255# ALL 256# This target builds all the data files. The world starts here. 257# Note: we really want the common data dll to go to $(DLL_OUTPUT), not $(ICUBLD_PKG). But specifying 258# that here seems to cause confusion with the building of the stub library of the same name. 259# Building the common dll in $(ICUBLD_PKG) unconditionally copies it to $(DLL_OUTPUT) too. 260# 261############################################################################# 262!IF "$(ARM_CROSS_BUILD)" == "" 263ALL : GODATA "$(ICU_LIB_TARGET)" "$(TESTDATAOUT)\testdata.dat" 264 @echo All targets are up to date 265 266!IF "$(UWP)" == "UWP" 267 @if not exist "$(ICUMAKE)\..\..\commondata\" mkdir "$(ICUMAKE)\..\..\commondata\" 268 copy "$(ICUOUT)\$(U_ICUDATA_NAME)$(U_ICUDATA_ENDIAN_SUFFIX).dat" "$(ICUMAKE)\..\..\commondata\" 269!ENDIF 270 271!ELSE 272ALL : GODATA "$(ICU_LIB_TARGET)" "$(TESTDATAOUT)\testdata.dat" $(ARM_CROSSBUILD_TS) 273 @echo All targets are up to date 274 275!ENDIF 276 277# Verbose output when building the data for Debug builds. 278!IF "$(DEBUG)" == "true" 279ICU_DATA_BUILD_VERBOSE=--verbose 280!ELSE 281ICU_DATA_BUILD_VERBOSE= 282!ENDIF 283 284# Three main targets: tools, core data, and test data. 285# Keep track of whether they are built via timestamp files. 286 287$(TOOLS_TS): "$(ICUTOOLS)\genrb\$(CFGTOOLS)\genrb.exe" "$(ICUTOOLS)\gencnval\$(CFGTOOLS)\gencnval.exe" "$(ICUTOOLS)\gencfu\$(CFGTOOLS)\gencfu.exe" "$(ICUTOOLS)\icupkg\$(CFGTOOLS)\icupkg.exe" "$(ICUTOOLS)\makeconv\$(CFGTOOLS)\makeconv.exe" "$(ICUPBIN)\pkgdata.exe" 288 @echo "timestamp" > $(TOOLS_TS) 289 290# On Unix, Python generates at configure time a list of Makefile rules. 291# On Windows, however, we run the Python data build script at build time instead. 292# The alternative would be to use a preprocessor macro to generate rules for nmake. 293# However, this approach was abandoned for reasons including: 294# 295# - nmake imposes more stringent restrictions on command line length. 296# - The lack of gnumake features makes nmake file construction more complex. 297# - Windows builds are single-threaded, giving less advantage to a Makefile approach. 298# 299# Currently, the entire script needs to run even for small changes to data. Maybe consider 300# checking file-changed timestamps in Python to build only the required subset of data. 301 302$(COREDATA_TS): 303 @cd "$(ICUSRCDATA)" 304 set PYTHONPATH=$(ICUP)\source\python;%PYTHONPATH% 305 py -3 -B -m icutools.databuilder \ 306 --mode windows-exec \ 307 --src_dir "$(ICUSRCDATA)" \ 308 --tool_dir "$(ICUTOOLS)" \ 309 --tool_cfg "$(CFGTOOLS)" \ 310 --out_dir "$(ICUBLD_PKG)" \ 311 --tmp_dir "$(ICUTMP)" \ 312 --filter_file "$(ICU_DATA_FILTER_FILE)" \ 313 $(ICU_DATA_BUILD_VERBOSE) \ 314 $(ICU_DATA_BUILDTOOL_OPTS) 315 @echo "timestamp" > $(COREDATA_TS) 316 317 318# The core Unicode properties files (uprops.icu, ucase.icu, ubidi.icu) 319# are hardcoded in the common DLL and therefore not included in the data package any more. 320# They are not built by default but need to be built for ICU4J data and for getting the .c source files 321# when updating the Unicode data. 322# Changed in makedata.mak revision 1.117. See Jitterbug 4497. 323# 2010-dec Removed pnames.icu. 324# Command line: 325# C:\svn\icuproj\icu\trunk\source\data>nmake -f makedata.mak ICUMAKE=C:\svn\icuproj\icu\trunk\source\data\ CFG=x86\Debug uni-core-data 326uni-core-data: GODATA "$(ICUBLD_PKG)\pnames.icu" "$(ICUBLD_PKG)\uprops.icu" "$(ICUBLD_PKG)\ucase.icu" "$(ICUBLD_PKG)\ubidi.icu" "$(ICUBLD_PKG)\nfc.nrm" 327 @echo Unicode .icu files built to "$(ICUBLD_PKG)" 328 329# Build the ICU4J icudata.jar and testdata.jar. 330# see icu4j-readme.txt 331 332ICU4J_TZDATA="$(ICUOUT)\icu4j\icutzdata.jar" 333ICU4J_DATA_DIRNAME=com\ibm\icu\impl\data\$(U_ICUDATA_NAME)b 334ICU4J_TZDATA_PATHS=$(ICU4J_DATA_DIRNAME)\zoneinfo64.res $(ICU4J_DATA_DIRNAME)\metaZones.res $(ICU4J_DATA_DIRNAME)\timezoneTypes.res $(ICU4J_DATA_DIRNAME)\windowsZones.res 335 336generate-data: GODATA "$(ICUOUT)\$(ICUPKG).dat" uni-core-data 337 if not exist "$(ICUOUT)\icu4j\$(ICU4J_DATA_DIRNAME)" mkdir "$(ICUOUT)\icu4j\$(ICU4J_DATA_DIRNAME)" 338 if not exist "$(ICUOUT)\icu4j\tzdata\$(ICU4J_DATA_DIRNAME)" mkdir "$(ICUOUT)\icu4j\tzdata\$(ICU4J_DATA_DIRNAME)" 339 echo pnames.icu ubidi.icu ucase.icu uprops.icu nfc.nrm > "$(ICUOUT)\icu4j\add.txt" 340 "$(ICUPBIN)\icupkg" "$(ICUOUT)\$(ICUPKG).dat" "$(ICUOUT)\icu4j\$(U_ICUDATA_NAME)b.dat" -a "$(ICUOUT)\icu4j\add.txt" -s "$(ICUBLD_PKG)" -x * -tb -d "$(ICUOUT)\icu4j\$(ICU4J_DATA_DIRNAME)" 341 @for %f in ($(ICU4J_TZDATA_PATHS)) do @move "$(ICUOUT)\icu4j\%f" "$(ICUOUT)\icu4j\tzdata\$(ICU4J_DATA_DIRNAME)" 342 343"$(ICUOUT)\icu4j\icutzdata.jar": GODATA generate-data 344 "$(JAR)" cf "$(ICUOUT)\icu4j\icutzdata.jar" -C "$(ICUOUT)\icu4j\tzdata" "$(ICU4J_DATA_DIRNAME)" 345 346# Build icudata.jar: 347# - add the uni-core-data to the ICU package 348# - swap the ICU data 349# - extract all data items 350# - package them into the .jar file 351"$(ICUOUT)\icu4j\icudata.jar": GODATA generate-data 352 "$(JAR)" cf "$(ICUOUT)\icu4j\icudata.jar" -C "$(ICUOUT)\icu4j" "$(ICU4J_DATA_DIRNAME)" 353 354# Build testdata.jar: 355# - swap the test data 356# - extract all data items 357# - package them into the .jar file 358"$(ICUOUT)\icu4j\testdata.jar": GODATA "$(TESTDATAOUT)\testdata.dat" 359 if not exist "$(ICUOUT)\icu4j\com\ibm\icu\dev\data\testdata" mkdir "$(ICUOUT)\icu4j\com\ibm\icu\dev\data\testdata" 360 "$(ICUPBIN)\icupkg" "$(TESTDATAOUT)\testdata.dat" -r test.icu -x * -tb -d "$(ICUOUT)\icu4j\com\ibm\icu\dev\data\testdata" 361 "$(JAR)" cf "$(ICUOUT)\icu4j\testdata.jar" -C "$(ICUOUT)\icu4j" com\ibm\icu\dev\data\testdata 362 363## Compare to: source\data\Makefile.in and source\test\testdata\Makefile.in 364 365DEBUGUTILITIESDATA_DIR=main\tests\core\src\com\ibm\icu\dev\test\util 366DEBUGUTILITIESDATA_SRC=DebugUtilitiesData.java 367 368# Build DebugUtilitiesData.java 369"$(ICUOUT)\icu4j\src\$(DEBUGUTILITIESDATA_DIR)\$(DEBUGUTILITIESDATA_SRC)" : {"$(ICUTOOLS)\gentest\$(CFGTOOLS)"}gentest.exe 370 if not exist "$(ICUOUT)\icu4j\src\$(DEBUGUTILITIESDATA_DIR)" mkdir "$(ICUOUT)\icu4j\src\$(DEBUGUTILITIESDATA_DIR)" 371 "$(ICUTOOLS)\gentest\$(CFGTOOLS)\gentest" -j -d"$(ICUOUT)\icu4j\src\$(DEBUGUTILITIESDATA_DIR)" 372 373ICU4J_DATA="$(ICUOUT)\icu4j\icudata.jar" "$(ICUOUT)\icu4j\testdata.jar" "$(ICUOUT)\icu4j\src\$(DEBUGUTILITIESDATA_DIR)\$(DEBUGUTILITIESDATA_SRC)" 374 375icu4j-data: GODATA $(ICU4J_DATA) $(ICU4J_TZDATA) 376 377!IFDEF ICU4J_ROOT 378 379"$(ICU4J_ROOT)\main\shared\data\icudata.jar": "$(ICUOUT)\icu4j\icudata.jar" 380 if not exist "$(ICU4J_ROOT)\main\shared\data" mkdir "$(ICU4J_ROOT)\main\shared\data" 381 copy "$(ICUOUT)\icu4j\icudata.jar" "$(ICU4J_ROOT)\main\shared\data" 382 383"$(ICU4J_ROOT)\main\shared\data\icutzdata.jar": "$(ICUOUT)\icu4j\icutzdata.jar" 384 if not exist "$(ICU4J_ROOT)\main\shared\data" mkdir "$(ICU4J_ROOT)\main\shared\data" 385 copy "$(ICUOUT)\icu4j\icutzdata.jar" "$(ICU4J_ROOT)\main\shared\data" 386 387"$(ICU4J_ROOT)\main\shared\data\testdata.jar": "$(ICUOUT)\icu4j\testdata.jar" 388 if not exist "$(ICU4J_ROOT)\main\shared\data" mkdir "$(ICU4J_ROOT)\main\shared\data" 389 copy "$(ICUOUT)\icu4j\testdata.jar" "$(ICU4J_ROOT)\main\shared\data" 390 391# "$(DEBUGUTILTIESDATA_OUT)" 392 393"$(ICU4J_ROOT)\$(DEBUGUTILITIESDATA_DIR)\$(DEBUGUTILITIESDATA_SRC)": "$(ICUOUT)\icu4j\src\$(DEBUGUTILITIESDATA_DIR)\$(DEBUGUTILITIESDATA_SRC)" 394 if not exist "$(ICU4J_ROOT)\$(DEBUGUTILITIESDATA_DIR)" mkdir "$(ICU4J_ROOT)\$(DEBUGUTILITIESDATA_DIR)" 395 copy "$(ICUOUT)\icu4j\src\$(DEBUGUTILITIESDATA_DIR)\$(DEBUGUTILITIESDATA_SRC)" "$(ICU4J_ROOT)\$(DEBUGUTILITIESDATA_DIR)\$(DEBUGUTILITIESDATA_SRC)" 396 397ICU4J_DATA_INSTALLED="$(ICU4J_ROOT)\main\shared\data\icudata.jar" "$(ICU4J_ROOT)\main\shared\data\icutzdata.jar" "$(ICU4J_ROOT)\main\shared\data\testdata.jar" "$(ICU4J_ROOT)\$(DEBUGUTILITIESDATA_DIR)\$(DEBUGUTILITIESDATA_SRC)" 398 399icu4j-data-install : GODATA $(ICU4J_DATA) $(ICU4J_TZDATA) $(ICU4J_DATA_INSTALLED) 400 @echo ICU4J data output to "$(ICU4J_ROOT)" 401 402!ELSE 403 404icu4j-data-install : 405 @echo ERROR ICU4J_ROOT not set 406 @exit 1 407 408!ENDIF 409 410 411 412# 413# testdata - nmake will invoke pkgdata, which will create testdata.dat 414# 415"$(TESTDATAOUT)\testdata.dat": "$(TESTDATA)\*" $(TOOLS_TS) 416 @cd "$(TESTDATA)" 417 @echo building testdata... 418 nmake /nologo /f "$(TESTDATA)\testdata.mak" TESTDATA=. ICUTOOLS="$(ICUTOOLS)" ICUPBIN="$(ICUPBIN)" ICUP="$(ICUP)" CFG=$(CFGTOOLS) TESTDATAOUT="$(TESTDATAOUT)" TESTDATABLD="$(TESTDATABLD)" ICUSRCDATA="$(ICUSRCDATA)" DLL_OUTPUT="$(DLL_OUTPUT)" 419 420#invoke pkgdata for ICU common data 421# pkgdata will drop all output files (.dat, .dll, .lib) into the target (ICUBLD_PKG) directory. 422# move the .dll and .lib files to their final destination afterwards. 423# The $(U_ICUDATA_NAME).lib and $(U_ICUDATA_NAME).exp should already be in the right place due to stubdata. 424# 425# 2005-may-05 Removed Unicode properties files (unorm.icu, uprops.icu, ucase.icu, ubidi.icu) 426# from data build. See Jitterbug 4497. (makedata.mak revision 1.117) 427# 428!IFDEF ICUDATA_SOURCE_ARCHIVE 429"$(ICU_LIB_TARGET)" : $(COMMON_ICUDATA_DEPENDENCIES) "$(ICUDATA_SOURCE_ARCHIVE)" 430 @echo Building icu data from $(ICUDATA_SOURCE_ARCHIVE) 431 cd "$(ICUBLD_PKG)" 432 "$(ICUPBIN)\icupkg" -x * --list "$(ICUDATA_SOURCE_ARCHIVE)" > "$(ICUTMP)\icudata.lst" 433 "$(ICUPBIN)\pkgdata" $(COMMON_ICUDATA_ARGUMENTS) "$(ICUTMP)\icudata.lst" 434 copy "$(U_ICUDATA_NAME).dll" "$(DLL_OUTPUT)" 435 -@erase "$(U_ICUDATA_NAME).dll" 436 copy "$(ICUTMP)\$(ICUPKG).dat" "$(ICUOUT)\$(U_ICUDATA_NAME)$(U_ICUDATA_ENDIAN_SUFFIX).dat" 437 -@erase "$(ICUTMP)\$(ICUPKG).dat" 438!ELSE 439"$(ICU_LIB_TARGET)" : $(COMMON_ICUDATA_DEPENDENCIES) $(COREDATA_TS) 440 @echo Building ICU data from scratch 441 cd "$(ICUBLD_PKG)" 442 "$(ICUPBIN)\pkgdata" $(COMMON_ICUDATA_ARGUMENTS) $(ICUTMP)\icudata.lst 443 -@erase "$(ICU_LIB_TARGET)" 444 @if not exist "$(DLL_OUTPUT)" mkdir "$(DLL_OUTPUT)" 445 copy "$(U_ICUDATA_NAME).dll" "$(ICU_LIB_TARGET)" 446 -@erase "$(U_ICUDATA_NAME).dll" 447 copy "$(ICUTMP)\$(ICUPKG).dat" "$(ICUOUT)\$(U_ICUDATA_NAME)$(U_ICUDATA_ENDIAN_SUFFIX).dat" 448 -@erase "$(ICUTMP)\$(ICUPKG).dat" 449!ENDIF 450 451"$(ARM_CROSSBUILD_TS)" : $(COMMON_ICUDATA_DEPENDENCIES) "$(ICU_LIB_TARGET)" 452 @echo Building ICU data for "$(ARM_CROSS_BUILD)" from x64 453 cd "$(ICUBLD_PKG)" 454 "$(ICUPBIN)\pkgdata" $(COMMON_ICUDATA_ARGUMENTS) $(ICUTMP)\icudata.lst 455 -@erase "$(ICU_LIB_TARGET)" 456 @if not exist "$(DLL_OUTPUT)" mkdir "$(DLL_OUTPUT)" 457 copy "$(U_ICUDATA_NAME).dll" "$(ICU_LIB_TARGET)" 458 -@erase "$(U_ICUDATA_NAME).dll" 459 copy "$(ICUTMP)\$(ICUPKG).dat" "$(ICUOUT)\$(U_ICUDATA_NAME)$(U_ICUDATA_ENDIAN_SUFFIX).dat" 460 -@erase "$(ICUTMP)\$(ICUPKG).dat" 461 @echo "timestamp" > $(ARM_CROSSBUILD_TS) 462 463# utility target to create missing directories 464# Most directories are made by Python, but still create ICUTMP 465# so it works in the source archive 466CREATE_DIRS : 467 @if not exist "$(ICUOUT)\$(NULL)" mkdir "$(ICUOUT)" 468 @if not exist "$(ICUTMP)\$(NULL)" mkdir "$(ICUTMP)" 469 @if not exist "$(ICUOUT)\build\$(NULL)" mkdir "$(ICUOUT)\build" 470 @if not exist "$(ICUBLD_PKG)\$(NULL)" mkdir "$(ICUBLD_PKG)" 471 @if not exist "$(TESTDATAOUT)" mkdir "$(TESTDATAOUT)" 472 473# utility target to send us to the right dir 474GODATA : CREATE_DIRS 475 @cd "$(ICUBLD_PKG)" 476 477# This is to remove all the data files 478CLEAN : GODATA 479 @echo Cleaning up the data files. 480 @cd "$(ICUOUT)" 481 -@erase "$(ICUOUT)\*.dat" 482 @rmdir $(ICUBLD) /s /q 483 @rmdir $(ICUTMP) /s /q 484 @rmdir $(TESTDATAOUT) /s /q 485 486# DLL version information 487# If you modify this, modify winmode.c in pkgdata. 488"$(ICUTMP)\icudata.res": "$(ICUSRCDATA)\misc\icudata.rc" 489 @echo Creating data DLL version information from $** 490 @rc.exe /i "..\..\..\..\common" /r /fo $@ $** 491 492# Targets for prebuilt Unicode data 493# Needed for ICU4J! 494"$(ICUBLD_PKG)\pnames.icu": $(ICUSRCDATA_RELATIVE_PATH)\in\pnames.icu 495 "$(ICUPBIN)\icupkg" -tl $? $@ 496 497"$(ICUBLD_PKG)\ubidi.icu": $(ICUSRCDATA_RELATIVE_PATH)\in\ubidi.icu 498 "$(ICUPBIN)\icupkg" -tl $? $@ 499 500"$(ICUBLD_PKG)\ucase.icu": $(ICUSRCDATA_RELATIVE_PATH)\in\ucase.icu 501 "$(ICUPBIN)\icupkg" -tl $? $@ 502 503"$(ICUBLD_PKG)\uprops.icu": $(ICUSRCDATA_RELATIVE_PATH)\in\uprops.icu 504 "$(ICUPBIN)\icupkg" -tl $? $@ 505 506"$(ICUBLD_PKG)\unames.icu": $(ICUSRCDATA_RELATIVE_PATH)\in\unames.icu 507 "$(ICUPBIN)\icupkg" -tl $? $@ 508 509"$(ICUBLD_PKG)\nfc.nrm": $(ICUSRCDATA_RELATIVE_PATH)\in\nfc.nrm 510 "$(ICUPBIN)\icupkg" -tl $? $@ 511 512"$(ICUBLD_PKG)\nfkc.nrm": $(ICUSRCDATA_RELATIVE_PATH)\in\nfkc.nrm 513 "$(ICUPBIN)\icupkg" -tl $? $@ 514 515"$(ICUBLD_PKG)\nfkc_cf.nrm": $(ICUSRCDATA_RELATIVE_PATH)\in\nfkc_cf.nrm 516 "$(ICUPBIN)\icupkg" -tl $? $@ 517 518"$(ICUBLD_PKG)\uts46.nrm": $(ICUSRCDATA_RELATIVE_PATH)\in\uts46.nrm 519 "$(ICUPBIN)\icupkg" -tl $? $@ 520 521"$(ICUBLD_PKG)\coll\ucadata.icu": $(ICUSRCDATA_RELATIVE_PATH)\in\coll\ucadata-unihan.icu 522 "$(ICUPBIN)\icupkg" -tl $? $@ 523 524 525!IFDEF ICUDATA_ARCHIVE 526"$(ICUDATA_SOURCE_ARCHIVE)": CREATE_DIRS $(ICUDATA_ARCHIVE) $(TOOLS_TS) 527 "$(ICUTOOLS)\icupkg\$(CFGTOOLS)\icupkg" -t$(U_ICUDATA_ENDIAN_SUFFIX) "$(ICUDATA_ARCHIVE)" "$(ICUDATA_SOURCE_ARCHIVE)" 528!ENDIF 529