2000-01-15 02:00:06 +00:00
#**********************************************************************
#* Copyright (C) 1999-2000, International Business Machines Corporation
#* and others. All Rights Reserved.
#**********************************************************************
1999-12-13 03:43:57 +00:00
# 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 .
2000-01-08 02:05:05 +00:00
! E N D I F
1999-12-13 03:43:57 +00:00
#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
2000-01-08 02:05:05 +00:00
! I F "$(ICUP)" = = ""
1999-12-13 03:43:57 +00:00
! 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
2000-01-21 02:15:42 +00:00
ICU_DATA = $( ICUDATA) \
1999-12-13 03:43:57 +00:00
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
2000-01-08 02:05:05 +00:00
#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 :
2000-01-08 02:05:05 +00:00
! M E S S A G E
1999-12-13 03:43:57 +00:00
! M E S S A G E N M A K E / f "makedata.mak" CFG = "Debug"
2000-01-08 02:05:05 +00:00
! M E S S A G E
1999-12-13 03:43:57 +00:00
!MESSAGE Possible choices for configuration are :
2000-01-08 02:05:05 +00:00
! M E S S A G E
1999-12-13 03:43:57 +00:00
! M E S S A G E "Release"
! M E S S A G E "Debug"
2000-01-08 02:05:05 +00:00
! M E S S A G E
1999-12-13 03:43:57 +00:00
! 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 .
2000-01-08 02:05:05 +00:00
! E N D I F
1999-12-13 03:43:57 +00:00
# This appears in original Microsofts makefiles
! I F "$(OS)" = = "Windows_NT"
NULL =
2000-01-08 02:05:05 +00:00
! E L S E
1999-12-13 03:43:57 +00:00
NULL = nul
2000-01-08 02:05:05 +00:00
! E N D I F
1999-12-13 03:43:57 +00:00
1999-12-15 21:48:10 +00:00
PATH = $( PATH) ; $( ICUP) \i cu\b in\$ ( CFG)
1999-12-13 03:43:57 +00:00
# Suffixes for data files
.SUFFIXES : .ucm .cnv .dll .dat .col .res .txt .c
2000-01-08 02:05:05 +00:00
# We're including a list of ucm files. There are two lists, one is essential 'ucmfiles.mk' and
1999-12-13 03:43:57 +00:00
# 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)
2000-01-08 02:05:05 +00:00
! E L S E
1999-12-13 03:43:57 +00:00
#!MESSAGE Warning: cannot find "ucmlocal.mk"
! E N D I F
2000-01-08 02:05:05 +00:00
! E L S E
1999-12-13 03:43:57 +00:00
!ERROR ERROR : cannot find "ucmfiles .mk "
2000-01-08 02:05:05 +00:00
! E N D I F
1999-12-13 03:43:57 +00:00
# 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)
2000-01-08 02:05:05 +00:00
! E L S E
1999-12-13 03:43:57 +00:00
#!MESSAGE Warning: cannot find "genrblocal.mk"
! E N D I F
2000-01-08 02:05:05 +00:00
! E L S E
1999-12-13 03:43:57 +00:00
!ERROR ERROR : cannot find "genrbfiles .mk "
2000-01-08 02:05:05 +00:00
! E N D I F
1999-12-13 03:43:57 +00:00
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)
2000-01-08 02:05:05 +00:00
! E L S E
1999-12-13 03:43:57 +00:00
#!MESSAGE Warning: cannot find "gencollocal.mk"
! E N D I F
2000-01-08 02:05:05 +00:00
! E L S E
1999-12-13 03:43:57 +00:00
!ERROR ERROR : cannot find "gencolfiles .mk "
2000-01-08 02:05:05 +00:00
! E N D I F
1999-12-13 03:43:57 +00:00
COL_FILES = $( GENCOL_SOURCE:.txt= .col)
2000-01-08 02:05:05 +00:00
1999-12-13 03:43:57 +00:00
# This target should build all the data files
2000-03-04 00:02:50 +00:00
ALL : GODATA $( RB_FILES ) $( CNV_FILES ) $( COL_FILES ) icudata .dll test .dat base_test .dat test_dat .dll base_test_dat .dll base_dat .dll icudata .dat GOBACK
1999-12-13 03:43:57 +00:00
@echo All targets are up to date
2000-01-08 02:05:05 +00:00
2000-01-11 01:29:29 +00:00
BRK_FILES = $( ICUDATA) \s ent.brk $( ICUDATA) \c har.brk $( ICUDATA) \l ine.brk $( ICUDATA) \w ord.brk $( ICUDATA) \l ine_th.brk $( ICUDATA) \w ord_th.brk
2000-01-08 02:05:05 +00:00
BRK_CSOURCES = $( BRK_FILES:.brk= _brk.c)
CPP_SOURCES = $( C_CNV_FILES) unames_dat.c cnvalias_dat.c tz_dat.c $( BRK_CSOURCES)
1999-12-13 03:43:57 +00:00
LINK32_OBJS = $( CPP_SOURCES:.c= .obj)
# target for DLL
icudata.dll : $( LINK 32_OBJS ) $( CNV_FILES )
2000-01-08 02:05:05 +00:00
@echo Creating DLL file
1999-12-13 03:43:57 +00:00
@cd $( ICUDATA)
@$( LINK32) @<<
$( LINK 32_FLAGS ) $( LINK 32_OBJS )
< <
2000-03-03 01:09:33 +00:00
LINK32_TEST_FLAGS = /out:" $( ICUDATA) /test_dat.dll " /DLL /NOENTRY
2000-03-04 00:02:50 +00:00
LINK32_BASE_TEST_FLAGS = /out:" $( ICUDATA) /base_test_dat.dll " /DLL /NOENTRY
LINK32_BASE_FLAGS = /out:" $( ICUDATA) /base_dat.dll " /DLL /NOENTRY
2000-03-03 01:09:33 +00:00
# Targets for test.dat
test.dat :
@echo Creating data file for test
@set ICU_DATA = $( ICUDATA)
@$( ICUTOOLS) \g entest\$ ( CFG) \g entest
test_dat.c : test .dat
@echo Creating C source file for test data
@set ICU_DATA = $( ICUDATA)
@$( ICUTOOLS) \g enccode\$ ( CFG) \g enccode $( ICUDATA) \$ ?
test_dat.obj : test_dat .c
@echo creating the obj file for test data
@cd $( ICUDATA)
@$( CPP) @<<
$( CPP_FLAGS ) $( ICUDATA ) \ $?
< <
2000-03-04 00:02:50 +00:00
#Targets for base_test.dat
base_test.dat :
@echo Creating base data file test
@set ICU_DATA = $( ICUDATA)
@copy $( ICUDATA) \t est.dat $( ICUDATA) \b ase_test.dat
2000-03-03 01:09:33 +00:00
# According to the read files, we will generate C files
2000-03-04 00:02:50 +00:00
# Target for test DLL
2000-03-03 01:09:33 +00:00
test_dat.dll : test_dat .obj test .dat
@echo Creating DLL file
@cd $( ICUDATA)
@$( LINK32) @<<
$( LINK 32_TEST_FLAGS ) t e s t _ d a t . o b j
< <
2000-03-04 00:02:50 +00:00
#Target for base test data DLL
base_test_dat.dll : test_dat .obj test .dat
@echo Creating DLL file
@cd $( ICUDATA)
@$( LINK32) @<<
$( LINK 32_BASE_TEST_FLAGS ) t e s t _ d a t . o b j
< <
#Target for base data DLL
base_dat.dll : test_dat .obj test .dat
@echo Creating DLL file
@cd $( ICUDATA)
@$( LINK32) @<<
$( LINK 32_BASE_FLAGS ) t e s t _ d a t . o b j
< <
2000-03-03 01:09:33 +00:00
2000-01-08 02:05:05 +00:00
$(ICUDATA)\sent.brk : $( ICUDATA ) \sentLE .brk
copy $( ICUDATA) \s entLE.brk $( ICUDATA) \s ent.brk
$(ICUDATA)\char.brk : $( ICUDATA ) \charLE .brk
copy $( ICUDATA) \c harLE.brk $( ICUDATA) \c har.brk
$(ICUDATA)\line.brk : $( ICUDATA ) \lineLE .brk
copy $( ICUDATA) \l ineLE.brk $( ICUDATA) \l ine.brk
$(ICUDATA)\word.brk : $( ICUDATA ) \wordLE .brk
copy $( ICUDATA) \w ordLE.brk $( ICUDATA) \w ord.brk
$(ICUDATA)\line_th.brk : $( ICUDATA ) \line_thLE .brk
copy $( ICUDATA) \l ine_thLE.brk $( ICUDATA) \l ine_th.brk
$(ICUDATA)\word_th.brk : $( ICUDATA ) \word_thLE .brk
copy $( ICUDATA) \w ord_thLE.brk $( ICUDATA) \w ord_th.brk
1999-12-13 03:43:57 +00:00
# target for memory mapped file
2000-01-08 02:05:05 +00:00
icudata.dat : $( CNV_FILES ) unames .dat cnvalias .dat tz .dat
1999-12-13 03:43:57 +00:00
@echo Creating memory-mapped file
@cd $( ICUDATA)
2000-04-19 00:06:20 +00:00
@$( ICUTOOLS) \g encmn\$ ( CFG) \g encmn -c 1000000 <<
1999-12-13 03:43:57 +00:00
$( 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
2000-01-08 02:05:05 +00:00
$( ICUDATA ) \ s e n t . b r k
$( ICUDATA ) \ c h a r . b r k
$( ICUDATA ) \ l i n e . b r k
$( ICUDATA ) \ w o r d . b r k
$( ICUDATA ) \ l i n e _ t h . b r k
$( ICUDATA ) \ w o r d _ t h . b r k
1999-12-13 03:43:57 +00:00
$(CNV_FILES : .cnv =.cnv
)
< <
2000-01-08 02:05:05 +00:00
# nothing works without this target, but we're making
1999-12-13 03:43:57 +00:00
# these files while creating converters
1999-12-15 21:48:10 +00:00
$(C_CNV_FILES) : $( CNV_FILES )
@$( ICUTOOLS) \g enccode\$ ( CFG) \g enccode $( CNV_FILES)
1999-12-13 03:43:57 +00:00
2000-01-08 02:05:05 +00:00
# nothing works without this target, but we're making
# these files while creating converters
$(BRK_CSOURCES) : $( BRK_FILES )
@$( ICUTOOLS) \g enccode\$ ( CFG) \g enccode $( BRK_FILES)
1999-12-13 03:43:57 +00:00
# utility to send us to the right dir
2000-01-08 02:05:05 +00:00
GODATA :
1999-12-13 03:43:57 +00:00
@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"
2000-01-08 02:05:05 +00:00
-@erase "*_brk.c"
1999-12-14 16:30:15 +00:00
-@erase "icudata.*"
-@erase "*.obj"
2000-01-08 02:05:05 +00:00
-@erase "sent.brk"
-@erase "char.brk"
-@erase "line.brk"
-@erase "word.brk"
-@erase "line_th.brk"
-@erase "word_th.brk"
2000-03-03 01:09:33 +00:00
-@erase "test*.*"
2000-03-04 00:02:50 +00:00
-@erase "base*.*"
1999-12-14 16:30:15 +00:00
@cd $( TEST)
-@erase "*.res"
@cd $( ICUTOOLS)
1999-12-13 03:43:57 +00:00
# Inference rule for creating resource bundles
.txt.res ::
1999-12-22 20:24:20 +00:00
@echo Making Resource Bundle files
1999-12-13 03:43:57 +00:00
@cd $( ICUDATA)
1999-12-22 20:24:20 +00:00
@$( ICUTOOLS) \g enrb\$ ( CFG) \g enrb $<
1999-12-13 03:43:57 +00:00
# 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)
2000-01-21 02:15:42 +00:00
@set ICU_DATA = $( ICUDATA)
1999-12-13 03:43:57 +00:00
@$( ICUTOOLS) \m akeconv\$ ( CFG) \m akeconv $<
1999-12-15 21:48:10 +00:00
# @$(ICUTOOLS)\genccode\$(CFG)\genccode $(CNV_FILES)
1999-12-13 03:43:57 +00:00
2000-01-08 02:05:05 +00:00
# Inference rule for creating collation files -
1999-12-13 03:43:57 +00:00
# this should be integrated in genrb
.txt.col ::
1999-12-15 21:48:10 +00:00
@echo Making Collation files
1999-12-13 03:43:57 +00:00
@cd $( ICUDATA)
1999-12-22 20:24:20 +00:00
@$( ICUTOOLS) \g enrb\$ ( CFG) \g enrb $<
1999-12-13 03:43:57 +00:00
# Inference rule for compiling :)
.c.obj ::
@cd $( ICUDATA)
@$( CPP) @<<
$( CPP_FLAGS ) $<
< <
# Targets for unames.dat
unames.dat : UnicodeData -3.0.0.txt
1999-12-22 20:24:20 +00:00
@echo Creating data file for Unicode Names
2000-01-21 02:15:42 +00:00
@set ICU_DATA = $( ICUDATA)
2000-04-19 00:06:20 +00:00
@$( ICUTOOLS) \g ennames\$ ( CFG) \g ennames UnicodeData-3.0.0.txt
1999-12-13 03:43:57 +00:00
2000-01-08 02:05:05 +00:00
unames_dat.c : unames .dat
1999-12-22 20:24:20 +00:00
@echo Creating C source file for Unicode Names
2000-01-21 02:15:42 +00:00
@set ICU_DATA = $( ICUDATA)
1999-12-22 20:24:20 +00:00
@$( ICUTOOLS) \g enccode\$ ( CFG) \g enccode $( ICUDATA) \$ ?
1999-12-13 03:43:57 +00:00
# Targets for converters
cnvalias.dat : convrtrs .txt
1999-12-22 20:24:20 +00:00
@echo Creating data file for Converter Aliases
2000-01-21 02:15:42 +00:00
@set ICU_DATA = $( ICUDATA)
2000-04-19 00:06:20 +00:00
@$( ICUTOOLS) \g encnval\$ ( CFG) \g encnval
2000-01-08 02:05:05 +00:00
cnvalias_dat.c : cnvalias .dat
1999-12-22 20:24:20 +00:00
@echo Creating C source file for Converter Aliases
@$( ICUTOOLS) \g enccode\$ ( CFG) \g enccode $( ICUDATA) \$ ?
1999-12-13 03:43:57 +00:00
# Targets for tz
tz.dat : {$( ICUTOOLS ) \gentz }tz .txt
1999-12-22 20:24:20 +00:00
@echo Creating data file for Timezones
2000-01-21 02:15:42 +00:00
@set ICU_DATA = $( ICUDATA)
2000-04-19 00:06:20 +00:00
@$( ICUTOOLS) \g entz\$ ( CFG) \g entz $( ICUTOOLS) \g entz\t z.txt
1999-12-13 03:43:57 +00:00
tz_dat.c : tz .dat
1999-12-22 20:24:20 +00:00
@echo Creating C source file for Timezones
@$( ICUTOOLS) \g enccode\$ ( CFG) \g enccode $( ICUDATA) \$ ?
1999-12-15 21:48:10 +00:00
# Dependencies on the tools
UnicodeData-3.0.0.txt : {$( ICUTOOLS ) \gennames \$( CFG ) }gennames .exe
convrtrs.txt : {$( ICUTOOLS ) \gencnval \$( CFG ) }gencnval .exe
tz.txt : {$( ICUTOOLS ) \gentz \$( CFG ) }gentz .exe
unames.dat cnvalias.dat tz.dat : {$( ICUTOOLS ) \genccode \$( CFG ) }genccode .exe
$(GENRB_SOURCE) $(GENCOL_SOURCE) : {$( ICUTOOLS ) \genrb \$( CFG ) }genrb .exe
$(UCM_SOURCE) : {$( ICUTOOLS ) \makeconv \$( CFG ) }makeconv .exe {$( ICUTOOLS ) \genccode \$( CFG ) }genccode .exe
2000-03-03 01:09:33 +00:00
test.dat : {$( ICUTOOLS ) \gentest \$( CFG ) }gentest .exe