1999-12-13 03:43:57 +00:00
# Copyright (c) 1999 IBM Corporation and others
# nmake file for creating data files on win32
# invoke with
# nmake /f makedata.mak icup=<path_to_icu_instalation> [Debug|Release]
#
# 12/10/1999 weiv Created
! C M D S W I T C H E S - D
#If no config, we default to debug
! I F "$(CFG)" = = ""
CFG = Debug
! M E S S A G E N o c o n f i g u r a t i o n s p e c i f i e d . D e f a u l t i n g t o c o m m o n - W i n 3 2 D e b u g .
! E N D I F
#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
! I F "$(ICUP)" = = ""
! E R R O R C a n ' t f i n d p a t h !
! E L S E
ICUDATA = $( ICUP) \i cu\d ata
DATA_PATH = $( ICUP) \i cu\d ata^\
TRANS = translit^\
1999-12-14 16:30:15 +00:00
TEST = ..\s ource\t est\t estdata^\
1999-12-13 03:43:57 +00:00
ICUTOOLS = $( ICUP) \i cu\s ource\t ools
! E N D I F
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) \i cu\i nclude /GD /c
#Here we test if configuration is given
1999-12-14 16:30:15 +00:00
! I F "$(CFG)" ! = "Release" & & "$(CFG)" ! = "release" & & "$(CFG)" ! = "Debug" & & "$(CFG)" ! = "debug"
1999-12-13 03:43:57 +00:00
! M E S S A G E I n v a l i d c o n f i g u r a t i o n "$(CFG)" s p e c i f i e d .
! M E S S A G E Y o u c a n s p e c i f y a c o n f i g u r a t i o n w h e n r u n n i n g N M A K E
!MESSAGE by defining the macro CFG on the command line. For example :
! M E S S A G E
! M E S S A G E N M A K E / f "makedata.mak" CFG = "Debug"
! M E S S A G E
!MESSAGE Possible choices for configuration are :
! M E S S A G E
! M E S S A G E "Release"
! M E S S A G E "Debug"
! M E S S A G E
! E R R O R A n i n v a l i d c o n f i g u r a t i o n i s s p e c i f i e d .
! E N D I F
# This appears in original Microsofts makefiles
! I F "$(OS)" = = "Windows_NT"
NULL =
! E L S E
NULL = nul
! E N D I F
# 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'
! I F E X I S T S ( "$(ICUTOOLS)\makeconv\ucmfiles.mk" )
! I N C L U D E "$(ICUTOOLS)\makeconv\ucmfiles.mk"
! I F E X I S T S ( "$(ICUTOOLS)\makeconv\ucmlocal.mk" )
! I N C L U D E "$(ICUTOOLS)\makeconv\ucmlocal.mk"
$(UCM_SOURCE) = $( UCM_SOURCE) $( UCM_SOURCE_LOCAL)
! E L S E
#!MESSAGE Warning: cannot find "ucmlocal.mk"
! E N D I F
! E L S E
!ERROR ERROR : cannot find "ucmfiles .mk "
! E N D I F
# 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
! I F E X I S T S ( "$(ICUTOOLS)\genrb\genrbfiles.mk" )
! I N C L U D E "$(ICUTOOLS)\genrb\genrbfiles.mk"
! I F E X I S T S ( "$(ICUTOOLS)\genrb\genrblocal.mk" )
! I N C L U D E "$(ICUTOOLS)\genrb\genrblocal.mk"
GENRB_SOURCE = $( GENRB_SOURCE) $( GENRB_SOURCE_LOCAL)
! E L S E
#!MESSAGE Warning: cannot find "genrblocal.mk"
! E N D I F
! E L S E
!ERROR ERROR : cannot find "genrbfiles .mk "
! E N D I F
RB_FILES = $( GENRB_SOURCE:.txt= .res)
# Read list of resource bundle files for colation
! I F E X I S T S ( "$(ICUTOOLS)\gencol\gencolfiles.mk" )
! I N C L U D E "$(ICUTOOLS)\gencol\gencolfiles.mk"
! I F E X I S T S ( "$(ICUTOOLS)\gencol\gencollocal.mk" )
! I N C L U D E "$(ICUTOOLS)\gencol\gencollocal.mk"
GENCOL_SOURCE = $( GENCOL_SOURCE) $( GENCOL_SOURCE_LOCAL)
! E L S E
#!MESSAGE Warning: cannot find "gencollocal.mk"
! E N D I F
! E L S E
!ERROR ERROR : cannot find "gencolfiles .mk "
! E N D I F
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 : $( LINK 32_OBJS ) $( CNV_FILES )
@echo Creating DLL file
@cd $( ICUDATA)
@$( LINK32) @<<
$( LINK 32_FLAGS ) $( LINK 32_OBJS )
< <
# target for memory mapped file
icudata.dat : $( CNV_FILES ) unames .dat cnvalias .dat tz .dat
@echo Creating memory-mapped file
@cd $( ICUDATA)
@$( ICUTOOLS) \g encmn\$ ( CFG) \g encmn 1000000 <<
$( ICUDATA ) \ u n a m e s . d a t
$( ICUDATA ) \ c n v a l i a s . d a t
$( ICUDATA ) \ t z . d a t
$(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 :
1999-12-14 16:30:15 +00:00
@cd $( ICUDATA)
-@erase "*.cnv"
-@erase "*.res"
-@erase " $( TRANS) *.res "
-@erase "*.col"
-@erase "unames*.*"
-@erase "cnvalias*.*"
-@erase "tz*.*"
-@erase "ibm*_cnv.c"
-@erase "icudata.*"
-@erase "*.obj"
@cd $( TEST)
-@erase "*.res"
@cd $( ICUTOOLS)
1999-12-13 03:43:57 +00:00
# Inference rule for creating resource bundles
.txt.res ::
@cd $( ICUDATA)
$( ICUTOOLS) \g enrb\$ ( CFG) \g enrb $<
# 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) \m akeconv\$ ( CFG) \m akeconv $<
@$( ICUTOOLS) \g enccode\$ ( CFG) \g enccode $( CNV_FILES)
# Inference rule for creating collation files -
# this should be integrated in genrb
.txt.col ::
@echo making Collation files
@cd $( ICUDATA)
$( ICUTOOLS) \g enrb\$ ( CFG) \g enrb $<
# Inference rule for compiling :)
.c.obj ::
@cd $( ICUDATA)
@$( CPP) @<<
$( CPP_FLAGS ) $<
< <
# Targets for unames.dat
unames.dat : UnicodeData -3.0.0.txt
$( ICUTOOLS) \g ennames\$ ( CFG) \g ennames -v- -c- $?
unames_dat.c : unames .dat
$( ICUTOOLS) \g enccode\$ ( CFG) \g enccode $( ICUDATA) \$ ?
# Targets for converters
cnvalias.dat : convrtrs .txt
$( ICUTOOLS) \g encnval\$ ( CFG) \g encnval -c-
cnvalias_dat.c : cnvalias .dat
$( ICUTOOLS) \g enccode\$ ( CFG) \g enccode $( ICUDATA) \$ ?
# Targets for tz
tz.dat : {$( ICUTOOLS ) \gentz }tz .txt
$( ICUTOOLS) \g entz\$ ( CFG) \g entz -c- $( ICUTOOLS) \g entz\t z.txt
tz_dat.c : tz .dat
$( ICUTOOLS) \g enccode\$ ( CFG) \g enccode $( ICUDATA) \$ ?