2000-12-03 04:09:23 +00:00
#**********************************************************************
2001-03-21 20:31:13 +00:00
#* Copyright (C) 1999-2001, International Business Machines Corporation
2000-12-03 04:09:23 +00:00
#* and others. All Rights Reserved.
#**********************************************************************
# 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
2001-02-19 22:48:09 +00:00
U_ICUDATA_NAME = icudt18l
2000-12-03 04:09:23 +00:00
#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
#Here we test if a valid configuration is given
! I F "$(CFG)" ! = "Release" & & "$(CFG)" ! = "release" & & "$(CFG)" ! = "Debug" & & "$(CFG)" ! = "debug"
! 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
#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 N D I F
! M E S S A G E i c u p a t h i s $( ICUP )
ICUDATA = $( ICUP) \d ata
! I F "$(ICUDBLD)" = = ""
! E R R O R C a n ' t f i n d I C U D B L D ( I C U D a t a B u i l d d i r , s h o u l d p o i n t t o i c u \ s o u r c e \ d a t a \ b u i l d \ ) !
! E N D I F
! M E S S A G E i c u d a t a b u i l d p a t h i s $( ICUDBLD )
#ICUDBLD=$(ICUP)\source\data\build
TESTDATA = $( ICUP) \s ource\t est\t estdata
#If ICU_DATA is not set, we want to output stuff in binary directory
DLL_OUTPUT = $( ICUP) \s ource\d ata
TESTDATAOUT = $( TESTDATA)
#TESTDATAOUT=$(DLL_OUTPUT)
ICD = $( ICUDATA) ^\
DATA_PATH = $( ICUP) \d ata^\
TEST = ..\s ource\t est\t estdata^\
ICUTOOLS = $( ICUP) \s ource\t ools
ICU_DATA = $( ICUDBLD)
! M E S S A G E I n t e r m e d i a t e f i l e s w i l l g o i n $( ICU_DATA )
# We have to prepare params for pkgdata - to help it find the tools
! I F "$(CFG)" = = "Debug" | | "$(CFG)" = = "debug"
PKGOPT = D:$( ICUP)
! E L S E
PKGOPT = R:$( ICUP)
! 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
# Adjust the path to find DLLs. If $(U_ICUDATA_NAME).dll really needs to be in $(ICUP)\bin\$(CFG),
# then add $(ICUP)\bin\$(CFG) to this path, as the other DLLs are in $(ICUP)\bin.
PATH = $( PATH) ; $( ICUP) \b in
# Suffixes for data files
.SUFFIXES : .ucm .cnv .dll .dat .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 ( "$(ICUDATA)\ucmfiles.mk" )
! I N C L U D E "$(ICUDATA)\ucmfiles.mk"
2001-03-12 21:20:42 +00:00
UCM_SOURCE = $( UCM_SOURCE)
2001-03-06 23:27:17 +00:00
! I F E X I S T S ( "$(ICUDATA)\ucmebcdic.mk" )
! I N C L U D E "$(ICUDATA)\ucmebcdic.mk"
2001-03-07 18:34:38 +00:00
UCM_SOURCE = $( UCM_SOURCE) $( UCM_SOURCE_EBCDIC)
2000-12-03 04:09:23 +00:00
! I F E X I S T S ( "$(ICUDATA)\ucmlocal.mk" )
! I N C L U D E "$(ICUDATA)\ucmlocal.mk"
2001-03-06 23:27:17 +00:00
UCM_SOURCE = $( UCM_SOURCE) $( UCM_SOURCE_EBCDIC) $( UCM_SOURCE_LOCAL)
2000-12-03 04:09:23 +00:00
! E L S E
#!MESSAGE Warning: cannot find "ucmlocal.mk"
! E N D I F
! E L S E
2001-03-12 21:20:42 +00:00
!MESSAGE Warning : cannot find "ucmebcdic .mk ".Not building EBCDIC converter files
2000-12-03 04:09:23 +00:00
! E N D I F
2001-03-12 21:20:42 +00:00
! E L S E
!ERROR ERROR : cannot find "ucmfiles .mk "
2001-03-06 23:27:17 +00:00
! E N D I F
2000-12-03 04:09:23 +00:00
CNV_FILES = $( UCM_SOURCE:.ucm= .cnv)
# Read list of resource bundle files
! I F E X I S T S ( "$(ICUDATA)\resfiles.mk" )
! I N C L U D E "$(ICUDATA)\resfiles.mk"
! I F E X I S T S ( "$(ICUDATA)\reslocal.mk" )
! I N C L U D E "$(ICUDATA)\reslocal.mk"
GENRB_SOURCE = $( GENRB_SOURCE) $( GENRB_SOURCE_LOCAL)
! E L S E
#!MESSAGE Warning: cannot find "reslocal.mk"
! E N D I F
! E L S E
!ERROR ERROR : cannot find "resfiles .mk "
! E N D I F
RB_FILES = $( GENRB_SOURCE:.txt= .res)
TRANSLIT_FILES = $( TRANSLIT_SOURCE:.txt= .res)
ALL_RES = $( RB_FILES) $( TRANSLIT_FILES)
RB_SOURCE_DIR = $( GENRB_SOURCE:$= $)
# This target should build all the data files
2001-03-19 22:35:36 +00:00
ALL : GODATA testdata "$( DLL_OUTPUT ) \$( U_ICUDATA_NAME ) .dll " $( DLL_OUTPUT ) \test 1.cnv $( DLL_OUTPUT ) \test 3.cnv $( DLL_OUTPUT ) \test 4.cnv GOBACK #$(U_ICUDATA_NAME).dat
2000-12-03 04:09:23 +00:00
@echo All targets are up to date
2001-03-19 22:35:36 +00:00
testdata : ucadata .dat $( RB_FILES ) {"$( ICUTOOLS ) \genrb \$( CFG ) "}genrb .exe
@cd " $( TESTDATA) "
nmake /f $( TESTDATA) \t estdata.mk TESTDATA = $( TESTDATA) ICUTOOLS = $( ICUTOOLS) PKGOPT = $( PKGOPT) CFG = $( CFG) DLL_OUTPUT = $( DLL_OUTPUT) TESTDATAOUT = $( TESTDATAOUT)
@cd " $( ICUDBLD) "
2001-03-02 21:21:25 +00:00
BRK_FILES = " $( ICUDBLD) \sent.brk " " $( ICUDBLD) \char.brk " " $( ICUDBLD) \line.brk " " $( ICUDBLD) \word.brk " " $( ICUDBLD) \line_th.brk " " $( ICUDBLD) \word_th.brk "
2000-12-03 04:09:23 +00:00
#invoke pkgdata
2001-04-04 02:31:28 +00:00
"$(DLL_OUTPUT)\$(U_ICUDATA_NAME).dll" : $( CNV_FILES ) $( BRK_FILES ) q c h k . d a t f c h k . d a t u p r o p s . d a t u n a m e s . d a t c n v a l i a s . d a t t z . d a t u c a d a t a . d a t i n v u c a . d a t $( ALL_RES )
2000-12-03 04:09:23 +00:00
@echo Building icu data
2000-12-04 21:51:29 +00:00
@cd " $( ICUDBLD) "
2000-12-06 03:02:21 +00:00
" $( ICUTOOLS) \pkgdata\$(CFG)\pkgdata " -e icudata -v -T . -m dll -c -p $( U_ICUDATA_NAME) -O " $( PKGOPT) " -d " $( DLL_OUTPUT) " -s . <<pkgdatain.txt
2001-04-04 02:31:28 +00:00
q c h k . d a t
f c h k . d a t
2000-12-03 04:09:23 +00:00
u p r o p s . d a t
u n a m e s . d a t
c n v a l i a s . d a t
t z . d a t
2001-02-23 04:57:47 +00:00
u c a d a t a . d a t
i n v u c a . d a t
2000-12-03 04:09:23 +00:00
$(CNV_FILES : .cnv =.cnv
)
$(RB_FILES : .res =.res
)
$(TRANSLIT_FILES : .res =.res
)
$(BRK_FILES : .brk " =.brk "
)
< < K E E P
2001-03-02 21:21:25 +00:00
"$(ICUDBLD)\sent.brk" : "$(ICUDATA)\sentLE.brk"
copy " $( ICUDATA) \sentLE.brk " " $( ICUDBLD) \sent.brk "
2000-12-03 04:09:23 +00:00
2001-03-02 21:21:25 +00:00
"$(ICUDBLD)\char.brk" : "$(ICUDATA)\charLE.brk"
copy " $( ICUDATA) \charLE.brk " " $( ICUDBLD) \char.brk "
2000-12-03 04:09:23 +00:00
2001-03-02 21:21:25 +00:00
"$(ICUDBLD)\line.brk" : "$(ICUDATA)\lineLE.brk"
copy " $( ICUDATA) \lineLE.brk " " $( ICUDBLD) \line.brk "
2000-12-03 04:09:23 +00:00
2001-03-02 21:21:25 +00:00
"$(ICUDBLD)\word.brk" : "$(ICUDATA)\wordLE.brk"
copy " $( ICUDATA) \wordLE.brk " " $( ICUDBLD) \word.brk "
2000-12-03 04:09:23 +00:00
2001-03-02 21:21:25 +00:00
"$(ICUDBLD)\line_th.brk" : "$(ICUDATA)\line_thLE.brk"
copy " $( ICUDATA) \line_thLE.brk " " $( ICUDBLD) \line_th.brk "
2000-12-03 04:09:23 +00:00
2001-03-02 21:21:25 +00:00
"$(ICUDBLD)\word_th.brk" : "$(ICUDATA)\word_thLE.brk"
copy " $( ICUDATA) \word_thLE.brk " " $( ICUDBLD) \word_th.brk "
2000-12-03 04:09:23 +00:00
# utility to send us to the right dir
GODATA :
@cd " $( ICUDBLD) "
# utility to get us back to the right dir
GOBACK :
@cd " $( ICUDBLD) "
# This is to remove all the data files
CLEAN :
@cd " $( ICUDBLD) "
-@erase "*.cnv"
-@erase "*.res"
-@erase " $( TRANS) *.res "
2001-04-04 02:31:28 +00:00
-@erase "qchk*.*"
-@erase "fchk*.*"
2000-12-03 04:09:23 +00:00
-@erase "uprops*.*"
-@erase "unames*.*"
-@erase "cnvalias*.*"
-@erase "tz*.*"
-@erase "ibm*_cnv.c"
-@erase "*_brk.c"
-@erase "icudt*.*"
-@erase "*.obj"
-@erase "sent.brk"
-@erase "char.brk"
-@erase "line.brk"
-@erase "word.brk"
-@erase "line_th.brk"
-@erase "word_th.brk"
-@erase "test*.*"
-@erase "base*.*"
2001-03-03 00:08:03 +00:00
@cd " $( DLL_OUTPUT) "
-@erase "*.cnv"
2001-03-02 21:21:25 +00:00
@cd " $( TESTDATA) "
-@erase "*.res"
2000-12-03 04:09:23 +00:00
@cd " $( ICUTOOLS) "
2000-12-04 21:51:29 +00:00
{$(ICUDATA)}.txt.res :
2000-12-03 04:09:23 +00:00
@echo Making Resource Bundle files
@" $( ICUTOOLS) \genrb\$(CFG)\genrb " -s$( ICUDATA) -d$( @D) $( ?F)
# Inference rule for creating converters, with a kludge to create
# c versions of converters at the same time
2000-12-04 21:51:29 +00:00
{$(ICUDATA)}.ucm.cnv ::
2000-12-03 04:09:23 +00:00
@echo Generating converters and c source files
@cd " $( ICUDATA) "
@set ICU_DATA = $( ICUDBLD)
@" $( ICUTOOLS) \makeconv\$(CFG)\makeconv " $<
# Targets for test converter data
2001-03-03 00:08:03 +00:00
$(DLL_OUTPUT)\test1.cnv : "$( TESTDATA ) \test 1.ucm "
2000-12-03 04:09:23 +00:00
@cd " $( ICUDATA) "
2001-03-03 00:08:03 +00:00
@set ICU_DATA = $( DLL_OUTPUT)
2000-12-03 04:09:23 +00:00
@" $( ICUTOOLS) \makeconv\$(CFG)\makeconv " $* *
2001-03-03 00:08:03 +00:00
$(DLL_OUTPUT)\test3.cnv : "$( TESTDATA ) \test 3.ucm "
2000-12-03 04:09:23 +00:00
@cd " $( ICUDATA) "
2001-03-03 00:08:03 +00:00
@set ICU_DATA = $( DLL_OUTPUT)
2000-12-03 04:09:23 +00:00
@" $( ICUTOOLS) \makeconv\$(CFG)\makeconv " $* *
2001-03-03 00:08:03 +00:00
$(DLL_OUTPUT)\test4.cnv : "$( TESTDATA ) \test 4.ucm "
2000-12-03 04:09:23 +00:00
@cd " $( ICUDATA) "
2001-03-03 00:08:03 +00:00
@set ICU_DATA = $( DLL_OUTPUT)
2000-12-03 04:09:23 +00:00
@" $( ICUTOOLS) \makeconv\$(CFG)\makeconv " $* *
2001-04-04 02:31:28 +00:00
# Targets for qchk.dat
qchk.dat : "$( ICUDATA ) \unidata \QuickCheck .txt " "$( ICUTOOLS ) \genqchk \$( CFG ) \genqchk .exe "
@echo Creating data file for Quick Check Properties
@set ICU_DATA = $( ICUDBLD)
@" $( ICUTOOLS) \genqchk\$(CFG)\genqchk " -s " $( ICUDATA) \unidata "
# Targets for fchk.dat
fchk.dat : "$( ICUDATA ) \unidata \FCDCheck .txt " "$( ICUTOOLS ) \genfchk \$( CFG ) \genfchk .exe "
@echo Creating data file for FCD Check Properties
@set ICU_DATA = $( ICUDBLD)
@" $( ICUTOOLS) \genfchk\$(CFG)\genfchk " -s " $( ICUDATA) \unidata "
2000-12-03 04:09:23 +00:00
# Targets for unames.dat
unames.dat : {"$( ICUDATA ) "}\unidata \UnicodeData .txt "$( ICUTOOLS ) \gennames \$( CFG ) \gennames .exe "
@echo Creating data file for Unicode Names
@set ICU_DATA = $( ICUDBLD)
@" $( ICUTOOLS) \gennames\$(CFG)\gennames " $( ICUDATA) \u nidata\U nicodeData.txt
# Targets for uprops.dat
uprops.dat : "$( ICUDATA ) \unidata \UnicodeData .txt " "$( ICUTOOLS ) \genprops \$( CFG ) \genprops .exe "
@echo Creating data file for Unicode Character Properties
@set ICU_DATA = $( ICUDBLD)
@" $( ICUTOOLS) \genprops\$(CFG)\genprops " -s " $( ICUDATA) \unidata "
# Targets for converters
cnvalias.dat : {"$( ICUDATA ) "}\convrtrs .txt "$( ICUTOOLS ) \gencnval \$( CFG ) \gencnval .exe "
@echo Creating data file for Converter Aliases
@set ICU_DATA = $( ICUDBLD)
@" $( ICUTOOLS) \gencnval\$(CFG)\gencnval " $( ICUDATA) \c onvrtrs.txt
# Targets for tz
tz.dat : {"$( ICUDATA ) "}timezone .txt {"$( ICUTOOLS ) \gentz \$( CFG ) "}gentz .exe
@echo Creating data file for Timezones
@set ICU_DATA = $( ICUDBLD)
@" $( ICUTOOLS) \gentz\$(CFG)\gentz " " $( ICUDATA) \timezone.txt "
2001-02-23 04:57:47 +00:00
# Targets for ucadata.dat & invuca.dat
ucadata.dat : "$( ICUDATA ) \unidata \FractionalUCA .txt " "$( ICUTOOLS ) \genuca \$( CFG ) \genuca .exe "
@echo Creating UCA data files
@set ICU_DATA = $( ICUDBLD)
@" $( ICUTOOLS) \genuca\$(CFG)\genuca " -s " $( ICUDATA) \unidata "
invuca.dat : ucadata .dat
2001-03-19 22:35:36 +00:00
{"$(ICUTOOLS)\genrb\$(CFG)"}genrb.exe : ucadata .dat
2001-03-01 00:15:30 +00:00
ucadata.dat : uprops .dat
2000-12-03 04:09:23 +00:00
# Dependencies on the tools
convrtrs.txt : {"$( ICUTOOLS ) \gencnval \$( CFG ) "}gencnval .exe
tz.txt : {"$( ICUTOOLS ) \gentz \$( CFG ) "}gentz .exe
2001-02-23 04:57:47 +00:00
uprops.dat unames.dat cnvalias.dat tz.dat ucadata.dat invuca.dat : {"$( ICUTOOLS ) \genccode \$( CFG ) "}genccode .exe
2000-12-03 04:09:23 +00:00
2001-03-19 22:35:36 +00:00
$(TRANSLIT_SOURCE) $(GENRB_SOURCE) : {"$( ICUTOOLS ) \genrb \$( CFG ) "}genrb .exe ucadata .dat
2000-12-03 04:09:23 +00:00
$(UCM_SOURCE) : {"$( ICUTOOLS ) \makeconv \$( CFG ) "}makeconv .exe {"$( ICUTOOLS ) \genccode \$( CFG ) "}genccode .exe