#********************************************************************** #* Copyright (C) 1999-2001, International Business Machines Corporation #* and others. All Rights Reserved. #********************************************************************** # nmake file for creating data files on win32 # invoke with # nmake /f makedata.mak [Debug|Release] # # 12/10/1999 weiv Created ############################################################################## # Keep the following in sync with the version - see common/unicode/uversion.h U_ICUDATA_NAME=icudt21 ############################################################################## U_ICUDATA_ENDIAN_SUFFIX=l UNICODE_VERSION=3.1.1 # ICUMAKE # Must be provided by whoever runs this makefile. # Is the directory containing this file (makedata.mak) # Is the directory into which most data is built (prior to packaging) # Is icu\source\data\build # !IF "$(ICUMAKE)"=="" !ERROR Can't find ICUMAKE (ICU Data Make dir, should point to icu\source\data\ )! !ENDIF !MESSAGE ICU data make path is $(ICUMAKE) ICUBLD=$(ICUMAKE)\out\build ICUOUT=$(ICUMAKE)\out # ICUP # The root of the ICU source directory tree # ICUP=$(ICUMAKE)\..\.. ICUP=$(ICUP:\source\data\..\..=) !MESSAGE ICU root path is $(ICUP) # ICUSRCDATA # The data directory in source # ICUSRCDATA=$(ICUP)\source\data ICUSRCDATA_RELATIVE_PATH=..\..\ # ICUUCM # The directory that contains ucmcore.mk files along with *.ucm files # ICUUCM=mappings # ICULOC # The directory that contains resfiles.mk files along with *.txt locale data files # ICULOC=locales # ICUTRANSLIT # The directory that contains trfiles.mk files along with *.txt transliterator files # ICUTRNS=translit # ICUBRK # The directory that contains resfiles.mk files along with *.txt break iterator files # ICUBRK=$(ICUP)\source\data\brkitr # ICUUNIDATA # The directory that contains Unicode data files # ICUUNIDATA=$(ICUP)\source\data\unidata # ICUMISC # The directory that contains files that are miscelleneous data # ICUMISC=$(ICUP)\source\data\misc # # ICUDATA # The source directory. Contains the source files for the common data to be built. # WARNING: NOT THE SAME AS ICU_DATA environment variable. Confusing. ICUDATA=$(ICUP)\source\data # # DLL_OUTPUT # Destination directory for the common data DLL file. # This is the same place that all of the other ICU DLLs go (the code-containing DLLs) # The lib file for the data DLL goes in $(DLL_OUTPUT)/../lib/ # DLL_OUTPUT=$(ICUP)\bin # # TESTDATA # The source directory for data needed for test programs. TESTDATA=$(ICUP)\source\test\testdata # # TESTDATAOUT # The destination directory for the built test data .dat file # When running the tests, ICU_DATA environment variable is set to here # so that test data files can be loaded. (Tests are NOT run from this makefile, # only the data is put in place.) TESTDATAOUT=$(ICUP)\source\test\testdata\out\ # # TESTDATABLD # The build directory for test data intermidiate files # (Tests are NOT run from this makefile, # only the data is put in place.) TESTDATABLD=$(ICUP)\source\test\testdata\out\build # # ICUTOOLS # Directory under which all of the ICU data building tools live. # ICUTOOLS=$(ICUP)\source\tools PATH = $(PATH);$(ICUP)\bin # We have to prepare params for pkgdata - to help it find the tools !IF "$(CFG)" == "Debug" || "$(CFG)" == "debug" !MESSAGE makedata.mak: doing a Debug build. PKGOPT=D:$(ICUP) !ELSE !MESSAGE makedata.mak: doing a Release build. PKGOPT=R:$(ICUP) !ENDIF # Suffixes for data files .SUFFIXES : .ucm .cnv .dll .dat .res .txt .c # We're including a list of .ucm files. # There are several lists, they are all optional. # Always build the mapping files for the EBCDIC fallback codepages # They are necessary on EBCDIC machines, and # the following logic is much easier if UCM_SOURCE is never empty. # (They are small.) UCM_SOURCE=ibm-37.ucm ibm-1047-s390.ucm !IF EXISTS("$(ICUSRCDATA)\$(ICUUCM)\ucmcore.mk") !INCLUDE "$(ICUSRCDATA)\$(ICUUCM)\ucmcore.mk" UCM_SOURCE=$(UCM_SOURCE) $(UCM_SOURCE_CORE) !ELSE !MESSAGE Warning: cannot find "ucmcore.mk". Not building core MIME/Unix/Windows converter files. !ENDIF !IF EXISTS("$(ICUSRCDATA)\$(ICUUCM)\ucmfiles.mk") !INCLUDE "$(ICUSRCDATA)\$(ICUUCM)\ucmfiles.mk" UCM_SOURCE=$(UCM_SOURCE) $(UCM_SOURCE_FILES) !ELSE !MESSAGE Warning: cannot find "ucmfiles.mk". Not building many converter files. !ENDIF !IF EXISTS("$(ICUSRCDATA)\$(ICUUCM)\ucmebcdic.mk") !INCLUDE "$(ICUSRCDATA)\$(ICUUCM)\ucmebcdic.mk" UCM_SOURCE=$(UCM_SOURCE) $(UCM_SOURCE_EBCDIC) !ELSE !MESSAGE Warning: cannot find "ucmebcdic.mk". Not building EBCDIC converter files. !ENDIF !IF EXISTS("$(ICUSRCDATA)\$(ICUUCM)\ucmlocal.mk") !INCLUDE "$(ICUSRCDATA)\$(ICUUCM)\ucmlocal.mk" UCM_SOURCE=$(UCM_SOURCE) $(UCM_SOURCE_LOCAL) !ELSE !MESSAGE Information: cannot find "ucmlocal.mk". Not building user-additional converter files. !ENDIF CNV_FILES=$(UCM_SOURCE:.ucm=.cnv) # Read list of locale resource bundle files !IF EXISTS("$(ICUSRCDATA)\$(ICULOC)\resfiles.mk") !INCLUDE "$(ICUSRCDATA)\$(ICULOC)\resfiles.mk" !IF EXISTS("$(ICUSRCDATA)\$(ICULOC)\reslocal.mk") !INCLUDE "$(ICUSRCDATA)\$(ICULOC)\reslocal.mk" GENRB_SOURCE=$(GENRB_SOURCE) $(GENRB_SOURCE_LOCAL) !ELSE !MESSAGE Information: cannot find "reslocal.mk". Not building user-additional resource bundle files. !ENDIF !ELSE !ERROR ERROR: cannot find "resfiles.mk" !ENDIF RB_FILES = $(GENRB_SOURCE:.txt=.res) # Read list of transliterator resource bundle files !IF EXISTS("$(ICUSRCDATA)\$(ICUTRNS)\trnsfiles.mk") !INCLUDE "$(ICUSRCDATA)\$(ICUTRNS)\trnsfiles.mk" !IF EXISTS("$(ICUSRCDATA)\$(ICUTRNS)\trnslocal.mk") !INCLUDE "$(ICUSRCDATA)\$(ICUTRNS)\trnslocal.mk" TRANLIT_SOURCE=$(TRANSLIT_SOURCE) $(TRANSLIT_SOURCE_LOCAL) !ELSE !MESSAGE Information: cannot find "trnslocal.mk". Not building user-additional transliterator files. !ENDIF !ELSE !ERROR ERROR: cannot find "trnsfiles.mk" !ENDIF TRANSLIT_FILES = $(TRANSLIT_SOURCE:.txt=.res) ALL_RES = $(RB_FILES) $(TRANSLIT_FILES) ############################################################################# # # ALL # This target builds all the data files. The world starts here. # Note: we really want the common data dll to go to $(DLL_OUTPUT), not $(ICUBLD). But specifying # that here seems to cause confusion with the building of the stub library of the same name. # Building the common dll in $(ICUBLD) unconditionally copies it to $(DLL_OUTPUT) too. # ############################################################################# ALL : GODATA "$(DLL_OUTPUT)\$(U_ICUDATA_NAME).dll" "$(TESTDATAOUT)\testdata.dat" "$(TESTDATAOUT)\test1.cnv" "$(TESTDATAOUT)\test3.cnv" "$(TESTDATAOUT)\test4.cnv" @echo All targets are up to date # # testdata - nmake will invoke pkgdata, which will create testdata.dat # "$(TESTDATAOUT)\testdata.dat": ucadata.dat $(TRANSLIT_FILES) $(RB_FILES) {"$(ICUTOOLS)\genrb\$(CFG)"}genrb.exe @cd "$(TESTDATA)" @echo building testdata... nmake /nologo /f "$(TESTDATA)\testdata.mk" TESTDATA=. ICUTOOLS="$(ICUTOOLS)" PKGOPT="$(PKGOPT)" CFG=$(CFG) TESTDATAOUT="$(TESTDATAOUT)" ICUDATA="$(ICUDATA)" TESTDATABLD="$(TESTDATABLD)" BRK_FILES = "$(ICUBLD)\sent.brk" "$(ICUBLD)\char.brk" "$(ICUBLD)\line.brk" "$(ICUBLD)\word.brk" "$(ICUBLD)\title.brk" "$(ICUBLD)\line_th.brk" "$(ICUBLD)\word_th.brk" #invoke pkgdata for ICU common data # pkgdata will drop all output files (.dat, .dll, .lib) into the target (ICUBLD) directory. # move the .dll and .lib files to their final destination afterwards. # The $(U_ICUDATA_NAME).lib and $(U_ICUDATA_NAME).exp should already be in the right place due to stubdata. # "$(DLL_OUTPUT)\$(U_ICUDATA_NAME).dll" : "$(ICUTOOLS)\pkgdata\$(CFG)\pkgdata.exe" $(CNV_FILES) $(BRK_FILES) "$(ICUBLD)\uprops.dat" "$(ICUBLD)\unames.dat" "$(ICUBLD)\unorm.dat" "$(ICUBLD)\cnvalias.dat" "$(ICUBLD)\tz.dat" "$(ICUBLD)\ucadata.dat" "$(ICUBLD)\invuca.dat" $(ALL_RES) "$(ICUBLD)\icudata.res" "$(ICUP)\source\stubdata\stubdatabuilt.txt" @echo Building icu data @cd "$(ICUBLD)" "$(ICUTOOLS)\pkgdata\$(CFG)\pkgdata" -e $(U_ICUDATA_NAME) -v -m dll -c -p $(U_ICUDATA_NAME) -O "$(PKGOPT)" -d "$(ICUBLD)" -s . <