1ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#**********************************************************************
285bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho#* Copyright (C) 1999-2008, International Business Machines Corporation
3ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#* and others.  All Rights Reserved.
4ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#**********************************************************************
5ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru# nmake file for creating data files on win32
6ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru# invoke with
7ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru# nmake /f makedata.mak icup=<path_to_icu_instalation> [Debug|Release]
8ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#
9ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#	12/10/1999	weiv	Created
10ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
11ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#If no config, we default to debug
12ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru!IF "$(CFG)" == ""
13ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruCFG=Debug
14ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru!MESSAGE No configuration specified. Defaulting to common - Win32 Debug.
15ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru!ENDIF
16ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
17ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#Here we test if a valid configuration is given
1885bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho!IF "$(CFG)" != "Release" && "$(CFG)" != "release" && "$(CFG)" != "Debug" && "$(CFG)" != "debug" && "$(CFG)" != "x86\Release" && "$(CFG)" != "x86\Debug" && "$(CFG)" != "x64\Release" && "$(CFG)" != "x64\Debug"
19ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru!MESSAGE Invalid configuration "$(CFG)" specified.
20ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru!MESSAGE You can specify a configuration when running NMAKE
21ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru!MESSAGE by defining the macro CFG on the command line. For example:
22ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru!MESSAGE
23ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru!MESSAGE NMAKE /f "makedata.mak" CFG="Debug"
24ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru!MESSAGE
25ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru!MESSAGE Possible choices for configuration are:
26ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru!MESSAGE
27ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru!MESSAGE "Release"
28ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru!MESSAGE "Debug"
29ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru!MESSAGE
30ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru!ERROR An invalid configuration is specified.
31ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru!ENDIF
32ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
33ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#Let's see if user has given us a path to ICU
34ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru#This could be found according to the path to makefile, but for now it is this way
35ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru!IF "$(ICUP)"==""
36ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru!ERROR Can't find path!
37ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru!ENDIF
38ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru!MESSAGE ICU path is $(ICUP)
39ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruRESNAME=uconvmsg
40ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruRESDIR=resources
41ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruRESFILES=resfiles.mk
42ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruICUDATA=$(ICUP)\data
43ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
44ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruDLL_OUTPUT=.\$(CFG)
45ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru# set the following to 'static' or 'dll' depending
46ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruPKGMODE=static
47ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
48ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruICD=$(ICUDATA)^\
49ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruDATA_PATH=$(ICUP)\data^\
50ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
5185bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho!IF "$(CFG)" == "x64\Release" || "$(CFG)" == "x64\Debug"
5285bf2e2fbc60a9f938064abc8127d61da7d19882Claire HoICUTOOLS=$(ICUP)\bin64
5385bf2e2fbc60a9f938064abc8127d61da7d19882Claire HoPATH = $(ICUP)\bin64;$(PATH)
5485bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho!ELSE
5585bf2e2fbc60a9f938064abc8127d61da7d19882Claire HoICUTOOLS=$(ICUP)\bin
56ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruPATH = $(ICUP)\bin;$(PATH)
5785bf2e2fbc60a9f938064abc8127d61da7d19882Claire Ho!ENDIF
58ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
59ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru# Suffixes for data files
60ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru.SUFFIXES : .ucm .cnv .dll .dat .res .txt .c
61ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
62ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru# We're including a list of resource files.
63ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruFILESEPCHAR=
64ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
65ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru!IF EXISTS("$(RESFILES)")
66ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru!INCLUDE "$(RESFILES)"
67ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru!ELSE
68ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru!ERROR ERROR: cannot find "$(RESFILES)"
69ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru!ENDIF
70ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruRES_FILES = $(RESSRC:.txt=.res)
71ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruRB_FILES = resources\$(RES_FILES:.res =.res resources\)
72ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruRESOURCESDIR=
73ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
74ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru# This target should build all the data files
75ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru!IF "$(PKGMODE)" == "dll"
76ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruOUTPUT = "$(DLL_OUTPUT)\$(RESNAME).dll"
77ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru!ELSE
78ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruOUTPUT = "$(DLL_OUTPUT)\$(RESNAME).lib"
79ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru!ENDIF
80ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
81ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruALL : $(OUTPUT)
82ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru	@echo All targets are up to date (mode $(PKGMODE))
83ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
84ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
85ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru# invoke pkgdata - static
86ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru"$(DLL_OUTPUT)\$(RESNAME).lib" : $(RB_FILES) $(RESFILES)
87ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru	@echo Building $(RESNAME).lib
88ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru	@"$(ICUTOOLS)\pkgdata" -f -v -m static -c -p $(RESNAME) -d "$(DLL_OUTPUT)" -s "$(RESDIR)" <<pkgdatain.txt
89ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru$(RES_FILES:.res =.res
90ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru)
91ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru<<KEEP
92ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
93ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru# This is to remove all the data files
94ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste QueruCLEAN :
95ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    -@erase "$(RB_FILES)"
96ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru	-@erase "$(CFG)\*uconvmsg*.*"
97ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru    -@"$(ICUTOOLS)\pkgdata" -f --clean -v -m static -c -p $(RESNAME) -d "$(DLL_OUTPUT)" -s "$(RESDIR)" pkgdatain.txt
98ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
99ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru# Inference rule for creating resource bundles
100ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru{$(RESDIR)}.txt{$(RESDIR)}.res:
101ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru	@echo Making Resource Bundle files
102ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru	"$(ICUTOOLS)\genrb" -s $(@D) -d $(@D) $(?F)
103ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
104ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
105ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru$(RESSRC) : {"$(ICUTOOLS)"}genrb.exe
106ac04d0bbe12b3ef54518635711412f178cb4d16Jean-Baptiste Queru
107