diff --git a/icu4c/source/tools/makedata.mak b/icu4c/source/tools/makedata.mak new file mode 100644 index 0000000000..80dd2f9868 --- /dev/null +++ b/icu4c/source/tools/makedata.mak @@ -0,0 +1,202 @@ +# Copyright (c) 1999 IBM Corporation and others +# nmake file for creating data files on win32 +# invoke with +# nmake /f makedata.mak icup= [Debug|Release] +# +# 12/10/1999 weiv Created + +!CMDSWITCHES -D + +#If no config, we default to debug +!IF "$(CFG)" == "" +CFG=Debug +!MESSAGE No configuration specified. Defaulting to common - Win32 Debug. +!ENDIF + +#Let's see if user has given us a path to ICU +#This could be found according to the path to makefile, but for now it is this way +!IF "$(ICUP)"=="" +!ERROR Can't find path! +!ELSE +ICUDATA=$(ICUP)\icu\data +DATA_PATH=$(ICUP)\icu\data^\ +TRANS=translit^\ +ICUTOOLS=$(ICUP)\icu\source\tools +!ENDIF + +LINK32 = link.exe +LINK32_FLAGS = /out:"$(ICUDATA)/icudata.dll" /DLL /NOENTRY /base:"0x4ad00000" /comment:" Copyright (C) 1999 International Business Machines Corporation and others. All Rights Reserved. " +CPP_FLAGS = /I$(ICUP)\icu\include /GD /c + +#Here we test if configuration is given +!IF "$(CFG)" != "Release" && "$(CFG)" != "Debug" +!MESSAGE Invalid configuration "$(CFG)" specified. +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "makedata.mak" CFG="Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "Release" +!MESSAGE "Debug" +!MESSAGE +!ERROR An invalid configuration is specified. +!ENDIF + +# This appears in original Microsofts makefiles +!IF "$(OS)" == "Windows_NT" +NULL= +!ELSE +NULL=nul +!ENDIF + +# Suffixes for data files +.SUFFIXES : .ucm .cnv .dll .dat .col .res .txt .c + +# We're including a list of ucm files. There are two lists, one is essential 'ucmfiles.mk' and +# the other is optional 'ucmlocal.mk' +!IF EXISTS("$(ICUTOOLS)\makeconv\ucmfiles.mk") +!INCLUDE "$(ICUTOOLS)\makeconv\ucmfiles.mk" +!IF EXISTS("$(ICUTOOLS)\makeconv\ucmlocal.mk") +!INCLUDE "$(ICUTOOLS)\makeconv\ucmlocal.mk" +$(UCM_SOURCE)=$(UCM_SOURCE) $(UCM_SOURCE_LOCAL) +!ELSE +#!MESSAGE Warning: cannot find "ucmlocal.mk" +!ENDIF +!ELSE +!ERROR ERROR: cannot find "ucmfiles.mk" +!ENDIF + +# According to the read files, we will generate CNV and C files +CNV_FILES=$(UCM_SOURCE:.ucm=.cnv) +C_CNV_FILES = $(UCM_SOURCE:.ucm=_cnv.c) +OBJ_CNV_FILES = $(C_CNV_FILES:.c=.obj) + +# Read list of resource bundle files +!IF EXISTS("$(ICUTOOLS)\genrb\genrbfiles.mk") +!INCLUDE "$(ICUTOOLS)\genrb\genrbfiles.mk" +!IF EXISTS("$(ICUTOOLS)\genrb\genrblocal.mk") +!INCLUDE "$(ICUTOOLS)\genrb\genrblocal.mk" +GENRB_SOURCE=$(GENRB_SOURCE) $(GENRB_SOURCE_LOCAL) +!ELSE +#!MESSAGE Warning: cannot find "genrblocal.mk" +!ENDIF +!ELSE +!ERROR ERROR: cannot find "genrbfiles.mk" +!ENDIF +RB_FILES = $(GENRB_SOURCE:.txt=.res) + +# Read list of resource bundle files for colation +!IF EXISTS("$(ICUTOOLS)\gencol\gencolfiles.mk") +!INCLUDE "$(ICUTOOLS)\gencol\gencolfiles.mk" +!IF EXISTS("$(ICUTOOLS)\gencol\gencollocal.mk") +!INCLUDE "$(ICUTOOLS)\gencol\gencollocal.mk" +GENCOL_SOURCE=$(GENCOL_SOURCE) $(GENCOL_SOURCE_LOCAL) +!ELSE +#!MESSAGE Warning: cannot find "gencollocal.mk" +!ENDIF +!ELSE +!ERROR ERROR: cannot find "gencolfiles.mk" +!ENDIF +COL_FILES = $(GENCOL_SOURCE:.txt=.col) + +# This target should build all the data files +ALL : GODATA $(RB_FILES) $(CNV_FILES) $(COL_FILES) icudata.dll icudata.dat GOBACK + @echo All targets are up to date + +CPP_SOURCES = $(C_CNV_FILES) unames_dat.c cnvalias_dat.c tz_dat.c +LINK32_OBJS = $(CPP_SOURCES:.c=.obj) + +# target for DLL +icudata.dll : $(LINK32_OBJS) $(CNV_FILES) + @echo Creating DLL file + @cd $(ICUDATA) + @$(LINK32) @<< +$(LINK32_FLAGS) $(LINK32_OBJS) +<< + +# target for memory mapped file +icudata.dat : $(CNV_FILES) unames.dat cnvalias.dat tz.dat + @echo Creating memory-mapped file + @cd $(ICUDATA) + @$(ICUTOOLS)\gencmn\$(CFG)\gencmn 1000000 << +$(ICUDATA)\unames.dat +$(ICUDATA)\cnvalias.dat +$(ICUDATA)\tz.dat +$(CNV_FILES:.cnv =.cnv +) +<< + +# nothing works without this target, but we're making +# these files while creating converters +$(C_CNV_FILES) : + +# utility to send us to the right dir +GODATA : + @cd $(ICUDATA) + +# utility to get us back to the right dir +GOBACK : + @cd $(ICUTOOLS) + +# This is to remove all the data files +CLEAN : + -@erase "$(ICUDATA)\*.cnv" + -@erase "$(ICUDATA)\*.res" + -@erase "$(ICUDATA)\$(TRANS)*.res" + -@erase "$(ICUDATA)\*.col" + -@erase "$(ICUDATA)\unames*.*" + -@erase "$(ICUDATA)\cnvalias*.*" + -@erase "$(ICUDATA)\tz*.*" + -@erase "$(ICUDATA)\ibm*_cnv.c" + -@erase "$(ICUDATA)\icudata.*" + -@erase "$(ICUDATA)\*.obj" + +# Inference rule for creating resource bundles +.txt.res:: + @cd $(ICUDATA) + $(ICUTOOLS)\genrb\$(CFG)\genrb $< + +# Inference rule for creating converters, with a kludge to create +# c versions of converters at the same time +.ucm.cnv:: + @echo Generating converters and c source files + @cd $(ICUDATA) + @$(ICUTOOLS)\makeconv\$(CFG)\makeconv $< + @$(ICUTOOLS)\genccode\$(CFG)\genccode $(CNV_FILES) + +# Inference rule for creating collation files - +# this should be integrated in genrb +.txt.col:: + @echo making Collation files + @cd $(ICUDATA) + $(ICUTOOLS)\genrb\$(CFG)\genrb $< + +# Inference rule for compiling :) +.c.obj:: + @cd $(ICUDATA) + @$(CPP) @<< +$(CPP_FLAGS) $< +<< + +# Targets for unames.dat +unames.dat : UnicodeData-3.0.0.txt + $(ICUTOOLS)\gennames\$(CFG)\gennames -v- -c- $? + +unames_dat.c : unames.dat + $(ICUTOOLS)\genccode\$(CFG)\genccode $(ICUDATA)\$? + +# Targets for converters +cnvalias.dat : convrtrs.txt + $(ICUTOOLS)\gencnval\$(CFG)\gencnval -c- + +cnvalias_dat.c : cnvalias.dat + $(ICUTOOLS)\genccode\$(CFG)\genccode $(ICUDATA)\$? + +# Targets for tz +tz.dat : {$(ICUTOOLS)\gentz}tz.txt + $(ICUTOOLS)\gentz\$(CFG)\gentz -c- $(ICUTOOLS)\gentz\tz.txt + +tz_dat.c : tz.dat + $(ICUTOOLS)\genccode\$(CFG)\genccode $(ICUDATA)\$?