]> git.saurik.com Git - apple/icu.git/blame - icuSources/extra/uconv/makedata.mak
ICU-66108.tar.gz
[apple/icu.git] / icuSources / extra / uconv / makedata.mak
CommitLineData
f3c0d7a5
A
1# Copyright (C) 2016 and later: Unicode, Inc. and others.
2# License & terms of use: http://www.unicode.org/copyright.html
b75a7d8f 3#**********************************************************************
729e4ab9 4#* Copyright (C) 1999-2008, International Business Machines Corporation
b75a7d8f
A
5#* and others. All Rights Reserved.
6#**********************************************************************
7# nmake file for creating data files on win32
8# invoke with
9# nmake /f makedata.mak icup=<path_to_icu_instalation> [Debug|Release]
10#
0f5d89e8 11# 12/10/1999 weiv Created
b75a7d8f
A
12
13#If no config, we default to debug
14!IF "$(CFG)" == ""
15CFG=Debug
16!MESSAGE No configuration specified. Defaulting to common - Win32 Debug.
17!ENDIF
18
19#Here we test if a valid configuration is given
340931cb 20!IF "$(CFG)" != "Release" && "$(CFG)" != "release" && "$(CFG)" != "Debug" && "$(CFG)" != "debug" && "$(CFG)" != "x86\Release" && "$(CFG)" != "x86\Debug" && "$(CFG)" != "x64\Release" && "$(CFG)" != "x64\Debug" && "$(CFG)" != "ARM\Release" && "$(CFG)" != "ARM\Debug" && "$(CFG)" != "ARM64\Release" && "$(CFG)" != "ARM64\Debug"
b75a7d8f
A
21!MESSAGE Invalid configuration "$(CFG)" specified.
22!MESSAGE You can specify a configuration when running NMAKE
23!MESSAGE by defining the macro CFG on the command line. For example:
24!MESSAGE
25!MESSAGE NMAKE /f "makedata.mak" CFG="Debug"
26!MESSAGE
27!MESSAGE Possible choices for configuration are:
28!MESSAGE
29!MESSAGE "Release"
30!MESSAGE "Debug"
31!MESSAGE
32!ERROR An invalid configuration is specified.
33!ENDIF
34
35#Let's see if user has given us a path to ICU
36#This could be found according to the path to makefile, but for now it is this way
37!IF "$(ICUP)"==""
38!ERROR Can't find path!
39!ENDIF
40!MESSAGE ICU path is $(ICUP)
0f5d89e8 41
b75a7d8f 42RESNAME=uconvmsg
374ca955 43RESDIR=resources
b75a7d8f
A
44RESFILES=resfiles.mk
45ICUDATA=$(ICUP)\data
46
47DLL_OUTPUT=.\$(CFG)
48# set the following to 'static' or 'dll' depending
49PKGMODE=static
50
b75a7d8f
A
51ICD=$(ICUDATA)^\
52DATA_PATH=$(ICUP)\data^\
b75a7d8f 53
340931cb
A
54# Use the x64 tools for building ARM and ARM64.
55# Note: This is similar to the TOOLS CFG PATH in source\data\makedata.mak
56!IF "$(CFG)" == "x64\Release" || "$(CFG)" == "x64\Debug" || "$(CFG)" == "ARM\Release" || "$(CFG)" == "ARM\Debug" || "$(CFG)" == "ARM64\Release" || "$(CFG)" == "ARM64\Debug"
729e4ab9
A
57ICUTOOLS=$(ICUP)\bin64
58PATH = $(ICUP)\bin64;$(PATH)
59!ELSE
60ICUTOOLS=$(ICUP)\bin
374ca955 61PATH = $(ICUP)\bin;$(PATH)
729e4ab9 62!ENDIF
b75a7d8f 63
340931cb
A
64# If building ARM/ARM, then we need to pass the arch as an argument.
65EXTRA_PKGDATA_ARGUMENTS=
66!IF "$(CFG)" == "ARM\Release" || "$(CFG)" == "ARM\Debug"
67EXTRA_PKGDATA_ARGUMENTS=-a ARM
68!ENDIF
69!IF "$(CFG)" == "ARM64\Release" || "$(CFG)" == "ARM64\Debug"
70EXTRA_PKGDATA_ARGUMENTS=-a ARM64
71!ENDIF
72
0f5d89e8
A
73# Make sure the necessary tools exist before continuing. (This is to prevent cryptic errors from NMAKE).
74!IF !EXISTS($(ICUTOOLS)\pkgdata.exe)
75!MESSAGE Unable to find "$(ICUTOOLS)\pkgdata.exe"
76!ERROR The tool 'pkgdata.exe' does not exist! (Have you built all of ICU yet?).
340931cb
A
77!IF "$(CFG)" == "ARM\Release" || "$(CFG)" == "ARM\Debug" || "$(CFG)" == "ARM64\Release" || "$(CFG)" == "ARM64\Debug"
78!ERROR Note that the ARM and ARM64 builds require building x64 first.
79!ENDIF
0f5d89e8
A
80!ENDIF
81!IF !EXISTS($(ICUTOOLS)\genrb.exe)
82!MESSAGE Unable to find "$(ICUTOOLS)\genrb.exe"
83!ERROR The tool 'genrb.exe' does not exist! (Have you built all of ICU yet?).
340931cb
A
84!IF "$(CFG)" == "ARM\Release" || "$(CFG)" == "ARM\Debug" || "$(CFG)" == "ARM64\Release" || "$(CFG)" == "ARM64\Debug"
85!ERROR Note that the ARM and ARM64 builds require building x64 first.
86!ENDIF
0f5d89e8
A
87!ENDIF
88
b75a7d8f
A
89# Suffixes for data files
90.SUFFIXES : .ucm .cnv .dll .dat .res .txt .c
91
92# We're including a list of resource files.
374ca955 93FILESEPCHAR=
b75a7d8f
A
94
95!IF EXISTS("$(RESFILES)")
96!INCLUDE "$(RESFILES)"
97!ELSE
98!ERROR ERROR: cannot find "$(RESFILES)"
99!ENDIF
46f4442e
A
100RES_FILES = $(RESSRC:.txt=.res)
101RB_FILES = resources\$(RES_FILES:.res =.res resources\)
374ca955 102RESOURCESDIR=
b75a7d8f
A
103
104# This target should build all the data files
105!IF "$(PKGMODE)" == "dll"
106OUTPUT = "$(DLL_OUTPUT)\$(RESNAME).dll"
107!ELSE
108OUTPUT = "$(DLL_OUTPUT)\$(RESNAME).lib"
109!ENDIF
110
374ca955 111ALL : $(OUTPUT)
0f5d89e8 112 @echo All targets are up to date (mode $(PKGMODE))
b75a7d8f
A
113
114
115# invoke pkgdata - static
374ca955 116"$(DLL_OUTPUT)\$(RESNAME).lib" : $(RB_FILES) $(RESFILES)
0f5d89e8 117 @echo Building $(RESNAME).lib
340931cb 118 @"$(ICUTOOLS)\pkgdata" -f -v -m static -c -p $(RESNAME) -d "$(DLL_OUTPUT)" $(EXTRA_PKGDATA_ARGUMENTS) -s "$(RESDIR)" <<pkgdatain.txt
46f4442e 119$(RES_FILES:.res =.res
b75a7d8f
A
120)
121<<KEEP
122
b75a7d8f
A
123# This is to remove all the data files
124CLEAN :
b75a7d8f 125 -@erase "$(RB_FILES)"
0f5d89e8 126 -@erase "$(CFG)\*uconvmsg*.*"
340931cb 127 -@"$(ICUTOOLS)\pkgdata" -f --clean -v -m static -c -p $(RESNAME) -d "$(DLL_OUTPUT)" $(EXTRA_PKGDATA_ARGUMENTS) -s "$(RESDIR)" pkgdatain.txt
b75a7d8f
A
128
129# Inference rule for creating resource bundles
374ca955 130{$(RESDIR)}.txt{$(RESDIR)}.res:
0f5d89e8
A
131 @echo Making Resource Bundle files
132 "$(ICUTOOLS)\genrb" -s $(@D) -d $(@D) $(?F)
b75a7d8f
A
133
134$(RESSRC) : {"$(ICUTOOLS)"}genrb.exe