]> git.saurik.com Git - apple/icu.git/blame - makefile
ICU-57166.0.1.tar.gz
[apple/icu.git] / makefile
CommitLineData
b75a7d8f 1##
46f4442e 2# Wrapper makefile for ICU
2ca993e8 3# Copyright (C) 2003-2016 Apple Inc. All rights reserved.
b75a7d8f
A
4#
5# See http://www.gnu.org/manual/make/html_chapter/make_toc.html#SEC_Contents
6# for documentation on makefiles. Most of this was culled from the ncurses makefile.
7#
51004dcb 8#################################
2ca993e8
A
9# Apple ICU repository tag and submission numbers
10#
11# The repository tag number consists of a main version and an optional branch version, as
12# follows:
13# ICU-MMmAA[.B]
14#
15# MM comes from the open-source ICU major version, and can range from 1 to 214 (the max is
16# due to B&I limits on submission versions. As of March 2016 this is 57; it increases
17# by 1 for each ICU major release (usually 2 / year). This corresponds to
18# U_ICU_VERSION_MAJOR_NUM.
19# m is a single digit specifying the open-source ICU minor version. This is 0 before final
20# release (e.g. for pre-release milestones), becomes 1 for release candidate and final
21# release, and may increase to 2 or a little more for occasional dot releases with
22# maintenance fixes. This corresponds to U_ICU_VERSION_MINOR_NUM.
23#
24# Note that the ICU release may also utilize U_ICU_VERSION_PATCHLEVEL_NUM; however
25# that is ignored for the Apple ICU tag and submission numbers, and any related code
26# or data changes will bne distinguished by updating the Apple delta version AA below.
27#
28# AA is a 2-digit value specifying the version of the additional Apple deltas after
29# integrating a major release. This is always 2 digits (zero padded) and ranges from
30# 00 (the first release after integrating a new ICU version) to 99.
31# B is an optional branch version, i.e. a branch from the mainline version specified by
32# the MMmAA part. It can range from 1 to 99 and is NOT zero-padded.
33#
34# For Windows builds, the first 3 values of the 4-part FILEVERSION and PRODUCTVERSION
35# are formed from U_ICU_VERSION_MAJOR_NUM, U_ICU_VERSION_MINOR_NUM, and
36# U_ICU_VERSION_PATCHLEVEL_NUM; the 4th value is ICU_BUILD, formed from AA and B as
37# ICU_BUILD = 100*AA + B.
38#
39# The B&I submission version always has 3 parts separated by '.':
40# MMmAA.(0 | B).T
41#
42# The first part MMmAA is the same as the repository tag number.
43# If the repository tag has no branch version, the second part is 0, otherwise it is
44# the same as the branch version (1..99).
45# The third part is a single digit designating the submission train; since the installsrc
46# target now submits different sources to different trains, we have to distinguish them.
47# The values currently defined for T are
48# 1 OSX trains
49# 2 embedded trains (iOS, tvos, watchos) including simulator versions thereof
50# 8 AAS for Windows
51# 9 linux for Siri servers
52# (additional train numbers for Apple platforms can be assigned from 3 up, additional
53# train numbers for non-Apple platforms can be assigned from 7 down).
54#
55#################################
51004dcb
A
56# Notes on building for AAS using Windows (7) + Visual Studio (2010) + Cygwin:
57#
58# Either this should be run indirectly from the VS command prompt via the
59# BuildICUForAAS script or project, using the instructions there (which build
60# both 32-bit and 64-bit), or it should be run from within Cygwin using the
61# following instructions or equivalent (different steps for 32-bit or 64-bit):
62#
63# 1. From VS command prompt, run vcvarsall.bat to set various environment variables.
64# For a 32-bit build:
65# > "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86
66# For a 64-bit build:
67# > "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" amd64
68#
69# 2. Launch Cygwin, e.g.
70# > C:\cygwin\Cygwin.bat
71#
72# 3. Within cygwin, cd to the top level of the ICU sources directory, e.g.
73# $ cd ICU
74#
75# 4. Adjust the PATH to put the appropriate VC tools directory first:
76# For a 32-bit build:
77# $ export PATH="/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin/":$PATH
78# For a 64-bit build:
79# $ export PATH="/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin/amd64/":$PATH
80#
81# 5. Run the ICU makefile
82# For a 32-bit build:
83# make [install] WINDOWS=YES [ARCH64=NO] [DSTROOT=...]
84# For a 64-bit build:
85# make [install] WINDOWS=YES ARCH64=YES [DSTROOT=...]
86#
87#################################
b75a7d8f
A
88
89#################################
90#################################
91# MAKE VARS
92#################################
93#################################
94
95# ':=' denotes a "simply expanded" variable. It's value is
96# set at the time of definition and it never recursively expands
97# when used. This is in contrast to using '=' which denotes a
98# recursively expanded variable.
99
2ca993e8
A
100# Sane defaults, which are typically overridden on the command line
101#or by the environment
73c04bcf 102WINDOWS=NO
729e4ab9
A
103LINUX=NO
104ARCH64=NO
2ca993e8
A
105RC_ARCHS=
106ifndef RC_ProjectSourceVersion
107ifdef RC_PROJECTSOURCEVERSION
108 RC_ProjectSourceVersion=$(RC_PROJECTSOURCEVERSION)
109endif
110endif
111$(info # RC_ARCHS=$(RC_ARCHS))
112$(info # RC_ProjectName=$(RC_ProjectName))
113$(info # RC_ProjectSourceVersion=$(RC_ProjectSourceVersion))
114
115# Disallow $(WINDOWS) and $(LINUX) both YES
116ifeq "$(WINDOWS)" "YES"
117 ifeq "$(LINUX)" "YES"
118 $(error WINDOWS and LINUX cannot both be YES)
119 endif
120endif
729e4ab9 121
51004dcb
A
122# chicken and egg problem: we can't use cygpath until PATH & SHELL are set,
123# but we have to convert VS100VCTOOLS_PATH in order to set PATH. So instead we
124# convert using subst.
125ifeq "$(WINDOWS)" "YES"
126 ifneq "$(VS100VCTOOLS_PATH)" ""
127 VS100VCTOOLS_CYGPATH:= /cygdrive/$(subst :/,/,$(subst \,/,$(VS100VCTOOLS_PATH)))
128 PATH:=$(VS100VCTOOLS_CYGPATH):/usr/local/bin/:/usr/bin/:$(PATH)
129 endif
130endif
131$(info # PATH=$(PATH))
132
133# For some reason, cygwin bash (at least when run non-login) needs to use
134# bash for pwd, echo etc. (but uname does not work, see below)
135ifeq "$(WINDOWS)" "YES"
136 SHELL := /bin/bash
137else
138 SHELL := /bin/sh
139endif
140
141# if building for windows from batch script, convert Win-style paths
142# for SRCROOT etc. to cygwin-style paths. Don't define them if not
143# already defined.
144ifeq "$(WINDOWS)" "YES"
145 ifneq "$(VS100VCTOOLS_PATH)" ""
146 ifdef SRCROOT
147 SRCROOT:=$(shell /bin/cygpath -ua $(subst \,/,$(SRCROOT)))
148 endif
149 ifdef OBJROOT
150 OBJROOT:=$(shell /bin/cygpath -ua $(subst \,/,$(OBJROOT)))
151 endif
152 ifdef DSTROOT
153 DSTROOT:=$(shell /bin/cygpath -ua $(subst \,/,$(DSTROOT)))
154 endif
155 ifdef SYMROOT
156 SYMROOT:=$(shell /bin/cygpath -ua $(subst \,/,$(SYMROOT)))
157 endif
158 endif
159endif
160
161ifndef SRCROOT
162 SRCROOT:=$(shell pwd)
163endif
164ifndef OBJROOT
165 OBJROOT:=$(SRCROOT)/build
166endif
167ifndef DSTROOT
168 DSTROOT:=$(OBJROOT)
169endif
170ifndef SYMROOT
171 SYMROOT:=$(OBJROOT)
172endif
2ca993e8
A
173$(info # SRCROOT=$(SRCROOT))
174$(info # OBJROOT=$(OBJROOT))
175$(info # DSTROOT=$(DSTROOT))
176
177# Disallow $(SRCROOT) == $(OBJROOT)
178ifeq ($(OBJROOT), $(SRCROOT))
179$(error SRCROOT same as OBJROOT)
180endif
51004dcb
A
181
182ifeq "$(WINDOWS)" "YES"
183 ifeq "$(ARCH64)" "YES"
184 OBJROOT_CURRENT=$(OBJROOT)/obj64
185 SYMROOT_CURRENT=$(SYMROOT)/obj64
186 else
187 OBJROOT_CURRENT=$(OBJROOT)/obj32
188 SYMROOT_CURRENT=$(SYMROOT)/obj32
189 endif
190else ifeq "$(LINUX)" "YES"
191 ifeq "$(ARCH64)" "YES"
192 OBJROOT_CURRENT=$(OBJROOT)/obj64
193 SYMROOT_CURRENT=$(SYMROOT)/obj64
194 else
195 OBJROOT_CURRENT=$(OBJROOT)/obj32
196 SYMROOT_CURRENT=$(SYMROOT)/obj32
197 endif
198else
199 OBJROOT_CURRENT=$(OBJROOT)
200 SYMROOT_CURRENT=$(SYMROOT)
201endif
2ca993e8
A
202
203ifndef SDKROOT
204 SDKPATH:=/
205else ifeq "$(SDKROOT)" ""
206 SDKPATH:=/
207else
208 SDKPATH:=$(shell xcodebuild -version -sdk $(SDKROOT) Path)
209 ifeq "$(SDKPATH)" ""
210 SDKPATH:=/
211 endif
212endif
213$(info # SDKROOT=$(SDKROOT))
214$(info # SDKPATH=$(SDKPATH))
215
216# An Apple submission version (passed in RC_ProjectSourceVersion for official builds) is
217# X[.Y[.Z]]
218# where X is in range 0-214747, Y and Z are in range 0-99 (with no leading zeros).
219# This corresponds to MMmAA.(0 | B).T where
220# MM is U_ICU_VERSION_MAJOR_NUM
221# m is U_ICU_VERSION_MINOR_NUM
222# AA is the Apple delta version
223# B is the Apple branch version (1 or 2 digits)
224# T is the Apple train code for submissions.
225# Note The value for the SourceVersion property in version.plists will be calculated as
226# (X*10000 + Y*100 + Z).
227# We want ICU_BUILD = 100*AA + B.
228#
229ifneq "$(RC_ProjectSourceVersion)" ""
230 ifeq "$(WINDOWS)" "YES"
231 ICU_BUILD_AA := $(shell echo $(RC_ProjectSourceVersion) | sed -r -e 's/([0-9]+)([0-9]{2})(\.([0-9])([0-9])?(\.([0-9]{1,2}))?)?/\2/')
232 ICU_BUILD_B1 := $(shell echo $(RC_ProjectSourceVersion) | sed -r -e 's/([0-9]+)([0-9]{2})(\.([0-9])([0-9])?(\.([0-9]{1,2}))?)?/\4/')
233 ICU_BUILD_B2 := $(shell echo $(RC_ProjectSourceVersion) | sed -r -e 's/([0-9]+)([0-9]{2})(\.([0-9])([0-9])?(\.([0-9]{1,2}))?)?/\5/')
234 ICU_TRAIN_CODE := $(shell echo $(RC_ProjectSourceVersion) | sed -r -e 's/([0-9]+)([0-9]{2})(\.([0-9])([0-9])?(\.([0-9]{1,2}))?)?/\7/')
235 else
236 ICU_BUILD_AA := $(shell echo $(RC_ProjectSourceVersion) | sed -E -e 's/([0-9]+)([0-9]{2})(\.([0-9])([0-9])?(\.([0-9]{1,2}))?)?/\2/')
237 ICU_BUILD_B1 := $(shell echo $(RC_ProjectSourceVersion) | sed -E -e 's/([0-9]+)([0-9]{2})(\.([0-9])([0-9])?(\.([0-9]{1,2}))?)?/\4/')
238 ICU_BUILD_B2 := $(shell echo $(RC_ProjectSourceVersion) | sed -E -e 's/([0-9]+)([0-9]{2})(\.([0-9])([0-9])?(\.([0-9]{1,2}))?)?/\5/')
239 ICU_TRAIN_CODE := $(shell echo $(RC_ProjectSourceVersion) | sed -E -e 's/([0-9]+)([0-9]{2})(\.([0-9])([0-9])?(\.([0-9]{1,2}))?)?/\7/')
240 endif
241 ifeq "$(ICU_BUILD_AA)" ""
242 ICU_BUILD := 0
243 else
244 ICU_BUILD := $(subst a,$(ICU_BUILD_AA),abc)
245 ifeq "$(ICU_BUILD_B1)" ""
246 ICU_BUILD := $(subst b,0,$(ICU_BUILD))
247 ICU_BUILD := $(subst c,0,$(ICU_BUILD))
248 else
249 ifeq "$(ICU_BUILD_B2)" ""
250 ICU_BUILD := $(subst b,0,$(ICU_BUILD))
251 ICU_BUILD := $(subst c,$(ICU_BUILD_B1),$(ICU_BUILD))
252 else
253 ICU_BUILD := $(subst b,$(ICU_BUILD_B1),$(ICU_BUILD))
254 ICU_BUILD := $(subst c,$(ICU_BUILD_B2),$(ICU_BUILD))
255 endif
256 endif
257 endif
258 ifeq "$(ICU_TRAIN_CODE)" ""
259 ICU_TRAIN_CODE := 0
260 endif
261else
262 ICU_BUILD := 0
263 ICU_TRAIN_CODE := 0
264endif
265$(info # ICU_BUILD=$(ICU_BUILD))
266$(info # ICU_TRAIN_CODE=$(ICU_TRAIN_CODE))
267ifeq "$(ICU_BUILD)" "0"
268 DEFINE_BUILD_LEVEL =
269else
270 DEFINE_BUILD_LEVEL =-DU_ICU_VERSION_BUILDLEVEL_NUM=$(ICU_BUILD)
271endif
272
273# Determine build type. In some cases (e.g. running installsrc for submitproject)
274# the only accurate information we may have about build type is from ICU_TRAIN_CODE,
275# so give priority to that if nonzero.
276# The values currently defined for ICU_TRAIN_CODE and corresponding ICU_BUILD_TYPE are
277# 1 OSX trains
278# 2 embedded trains (iOS, tvos, watchos) including simulator versions thereof.
279# may have BUILD_TYPE=DEVICE,SIMULATOR,TOOL
280# 8 AAS for Windows
281# 9 linux for Siri servers
282#
283ifeq "$(WINDOWS)" "YES"
284 ICU_FOR_APPLE_PLATFORMS:=NO
285else ifeq "$(ICU_TRAIN_CODE)" "8"
286 override WINDOWS=YES
287 ICU_FOR_APPLE_PLATFORMS:=NO
288else ifeq "$(LINUX)" "YES"
289 ICU_FOR_APPLE_PLATFORMS:=NO
290else ifeq "$(ICU_TRAIN_CODE)" "9"
291 override LINUX=YES
292 ICU_FOR_APPLE_PLATFORMS:=NO
293else
294 ICU_FOR_APPLE_PLATFORMS:=YES
295endif
296
297# For Apple builds, get more details from the SDK if available
298# In TargetConditionals.h:
299# TARGET_OS_IPHONE -is 1 iff generating code for firmware, devices, or simulator (all embedded trains)
300# in that case:
301# exactly one of the following is 1: TARGET_OS_SIMULATOR, TARGET_OS_EMBEDDED (i.e. device)
302# exactly one of the following is 1: TARGET_OS_IOS, TARGET_OS_TV, TARGET_OS_WATCH
303#
304ifeq "$(ICU_FOR_APPLE_PLATFORMS)" "YES"
305 HOSTCC := $(shell xcrun --sdk macosx --find cc)
306 HOSTCXX := $(shell xcrun --sdk macosx --find c++)
307 HOSTSDKPATH := $(shell xcrun --sdk macosx --show-sdk-path)
308 HOSTISYSROOT = -isysroot $(HOSTSDKPATH)
309 ifeq "$(SDKPATH)" "/"
310 ISYSROOT:= -isysroot $(HOSTSDKPATH)
311 CC := $(HOSTCC)
312 CXX := $(HOSTCXX)
313 NM := $(shell xcrun --sdk macosx --find nm)
314 STRIPCMD := $(shell xcrun --sdk macosx --find strip)
315 ifeq "$(ICU_TRAIN_CODE)" "2"
316 export ICU_FOR_EMBEDDED_TRAINS:=YES
317 else
318 export ICU_FOR_EMBEDDED_TRAINS:=NO
319 endif
320 else
321 ISYSROOT:= -isysroot $(SDKPATH)
322 CC := $(shell xcrun --sdk $(SDKPATH) --find cc)
323 CXX := $(shell xcrun --sdk $(SDKPATH) --find c++)
324 NM := $(shell xcrun --sdk $(SDKPATH) --find nm)
325 STRIPCMD := $(shell xcrun --sdk $(SDKPATH) --find strip)
326 EMBEDDEDTRAIN:=$(shell $(CXX) -E -dM -x c $(ISYSROOT) -include TargetConditionals.h /dev/null | fgrep define' 'TARGET_OS_IPHONE | cut -d' ' -f3)
327 ifeq "$(EMBEDDEDTRAIN)" "1"
328 export ICU_FOR_EMBEDDED_TRAINS:=YES
329 else
330 export ICU_FOR_EMBEDDED_TRAINS:=NO
331 endif
332 endif
333 SIMULATOROS:=$(shell $(CXX) -E -dM -x c $(ISYSROOT) -include TargetConditionals.h /dev/null | fgrep define' 'TARGET_OS_SIMULATOR | cut -d' ' -f3)
334 TVOS:=$(shell $(CXX) -E -dM -x c $(ISYSROOT) -include TargetConditionals.h /dev/null | fgrep define' 'TARGET_OS_TV | cut -d' ' -f3)
335 WATCHOS:=$(shell $(CXX) -E -dM -x c $(ISYSROOT) -include TargetConditionals.h /dev/null | fgrep define' 'TARGET_OS_WATCH | cut -d' ' -f3)
336 ifeq "$(ICU_FOR_EMBEDDED_TRAINS)" "YES"
337 ifeq "$(SIMULATOROS)" "1"
338 BUILD_TYPE=SIMULATOR
339 else
340 BUILD_TYPE=DEVICE
341 endif
342 else ifeq "$(RC_ProjectName)" "tzTools"
343 BUILD_TYPE=TOOL
344 else
345 BUILD_TYPE=
346 endif
347else
348 ifeq "$(LINUX)" "YES"
349 ISYSROOT:=
350 CC := gcc
351 CXX := g++
352 endif
353 export ICU_FOR_EMBEDDED_TRAINS:=NO
354 TVOS:=0
355 WATCHOS:=0
356 BUILD_TYPE=
357endif
358
359CROSS_BUILD:=$(ICU_FOR_EMBEDDED_TRAINS)
729e4ab9 360CROSSHOST_OBJROOT=$(OBJROOT)/crossbuildhost
2ca993e8
A
361
362$(info # ICU_FOR_APPLE_PLATFORMS=$(ICU_FOR_APPLE_PLATFORMS))
363$(info # HOSTCC=$(HOSTCC))
364$(info # HOSTCXX=$(HOSTCXX))
365$(info # HOSTISYSROOT=$(HOSTISYSROOT))
366$(info # CC=$(CC))
367$(info # CXX=$(CXX))
368$(info # ISYSROOT=$(ISYSROOT))
369$(info # ICU_FOR_EMBEDDED_TRAINS=$(ICU_FOR_EMBEDDED_TRAINS))
370$(info # CROSS_BUILD=$(CROSS_BUILD))
371$(info # BUILD_TYPE=$(BUILD_TYPE))
372
373# Disallow cross builds on Windows/Linux for now
374# (since those builds are not out-of-source as required for cross-builds)
375ifeq "$(CROSS_BUILD)" "YES"
376ifeq "$(WINDOWS)" "YES"
377$(error Cross-builds currently not allowed on Windows)
378endif
379ifeq "$(LINUX)" "YES"
380$(error Cross-builds currently not allowed on Linux)
381endif
382endif
383
5ea0322b
A
384MAC_OS_X_VERSION_MIN_REQUIRED=101100
385OSX_HOST_VERSION_MIN_STRING=10.11
2ca993e8 386
b331163b 387ifndef IPHONEOS_DEPLOYMENT_TARGET
2ca993e8 388 IOS_VERSION_TARGET_STRING=10.0
b331163b 389else ifeq "$(IPHONEOS_DEPLOYMENT_TARGET)" ""
2ca993e8 390 IOS_VERSION_TARGET_STRING=10.0
b331163b
A
391else
392 IOS_VERSION_TARGET_STRING=$(IPHONEOS_DEPLOYMENT_TARGET)
393endif
2ca993e8 394
b331163b 395ifndef MACOSX_DEPLOYMENT_TARGET
2ca993e8 396 OSX_VERSION_TARGET_STRING=10.12
b331163b 397else ifeq "$(MACOSX_DEPLOYMENT_TARGET)" ""
2ca993e8 398 OSX_VERSION_TARGET_STRING=10.12
b331163b
A
399else
400 OSX_VERSION_TARGET_STRING=$(MACOSX_DEPLOYMENT_TARGET)
401endif
2ca993e8 402
b331163b 403ifndef WATCHOS_DEPLOYMENT_TARGET
2ca993e8 404 WATCHOS_VERSION_TARGET_STRING=3.0
b331163b 405else ifeq "$(WATCHOS_DEPLOYMENT_TARGET)" ""
2ca993e8 406 WATCHOS_VERSION_TARGET_STRING=3.0
b331163b
A
407else
408 WATCHOS_VERSION_TARGET_STRING=$(WATCHOS_DEPLOYMENT_TARGET)
409endif
2ca993e8 410
b331163b 411ifndef TVOS_DEPLOYMENT_TARGET
2ca993e8 412 TVOS_VERSION_TARGET_STRING=10.0
b331163b 413else ifeq "$(TVOS_DEPLOYMENT_TARGET)" ""
2ca993e8 414 TVOS_VERSION_TARGET_STRING=10.0
b331163b
A
415else
416 TVOS_VERSION_TARGET_STRING=$(TVOS_DEPLOYMENT_TARGET)
417endif
729e4ab9 418
b331163b
A
419$(info # IOS_VERSION_TARGET_STRING=$(IOS_VERSION_TARGET_STRING))
420$(info # OSX_VERSION_TARGET_STRING=$(OSX_VERSION_TARGET_STRING))
421$(info # WATCHOS_VERSION_TARGET_STRING=$(WATCHOS_VERSION_TARGET_STRING))
422$(info # TVOS_VERSION_TARGET_STRING=$(TVOS_VERSION_TARGET_STRING))
51004dcb 423
2ca993e8
A
424ifeq "$(BUILD_TYPE)" "DEVICE"
425 ifeq "$(WATCHOS)" "1"
426 ICU_TARGET_VERSION := -mwatchos-version-min=$(WATCHOS_VERSION_TARGET_STRING)
427 else ifeq "$(TVOS)" "1"
428 ICU_TARGET_VERSION := -mtvos-version-min=$(TVOS_VERSION_TARGET_STRING)
429 else
430 ICU_TARGET_VERSION := -miphoneos-version-min=$(IOS_VERSION_TARGET_STRING)
431 endif
432else ifeq "$(BUILD_TYPE)" "SIMULATOR"
433 ifeq "$(WATCHOS)" "1"
434 ICU_TARGET_VERSION := -mwatchos-simulator-version-min=$(WATCHOS_VERSION_TARGET_STRING)
435 else ifeq "$(TVOS)" "1"
436 ICU_TARGET_VERSION := -mtvos-simulator-version-min=$(TVOS_VERSION_TARGET_STRING)
437 else
438 ICU_TARGET_VERSION := -mios-simulator-version-min=$(IOS_VERSION_TARGET_STRING)
439 endif
440else
441 ICU_TARGET_VERSION :=
442endif
443$(info # ICU_TARGET_VERSION=$(ICU_TARGET_VERSION))
444
445
446DISABLE_DRAFT:=$(ICU_FOR_EMBEDDED_TRAINS)
447ifeq "$(DISABLE_DRAFT)" "YES"
448 DRAFT_FLAG=--disable-draft
449else
450 DRAFT_FLAG=
451endif
452
51004dcb
A
453# For some reason, under cygwin, bash uname is not found, and
454# sh uname does not produce a result with -p or -m. So we just
455# hardcode here.
456ifeq "$(WINDOWS)" "YES"
457 UNAME_PROCESSOR:=i386
458else
459 UNAME_PROCESSOR:=$(shell uname -p)
460endif
57a6839d 461
729e4ab9 462ifneq "$(RC_ARCHS)" ""
729e4ab9 463 INSTALLHDRS_ARCH=-arch $(shell echo $(RC_ARCHS) | cut -d' ' -f1)
73c04bcf 464else
729e4ab9 465 INSTALLHDRS_ARCH=
73c04bcf 466endif
729e4ab9
A
467$(info # INSTALLHDRS_ARCH=$(INSTALLHDRS_ARCH))
468$(info # buildhost=$(UNAME_PROCESSOR))
57a6839d 469
729e4ab9
A
470
471# FORCEENDIAN below is to override silly configure behavior in which if
472# __APPLE_CC__ is defined and archs are in { ppc, ppc64, i386, x86_64 }
473# then it assumes a universal build (ac_cv_c_bigendian=universal) with
474# data file initially built big-endian.
475#
476ifeq "$(CROSS_BUILD)" "YES"
477 RC_ARCHS_FIRST=$(shell echo $(RC_ARCHS) | cut -d' ' -f1)
2ca993e8 478 TARGET_SPEC=$(RC_ARCHS_FIRST)-apple-darwin15.0.0
51004dcb 479 ENV_CONFIGURE_ARCHS=-arch $(RC_ARCHS_FIRST)
729e4ab9
A
480 ICUPKGTOOLIBS="$(CROSSHOST_OBJROOT)/lib:$(CROSSHOST_OBJROOT)/stubdata"
481 ICUPKGTOOL=$(CROSSHOST_OBJROOT)/bin/icupkg
482 ifeq "$(filter-out i386 x86_64,$(RC_ARCHS))" ""
483 FORCEENDIAN= ac_cv_c_bigendian=no
484 else
485 FORCEENDIAN=
486 endif
487else ifeq "$(LINUX)" "YES"
488 TARGET_SPEC=$(UNAME_PROCESSOR)-unknown-linux-gnu
489 ENV_CONFIGURE_ARCHS=
51004dcb
A
490 ICUPKGTOOLIBS="$(OBJROOT_CURRENT)/lib:$(OBJROOT_CURRENT)/stubdata"
491 ICUPKGTOOL=$(OBJROOT_CURRENT)/bin/icupkg
729e4ab9 492 FORCEENDIAN=
46f4442e 493else
2ca993e8 494 TARGET_SPEC=$(UNAME_PROCESSOR)-apple-darwin15.0.0
729e4ab9 495 ENV_CONFIGURE_ARCHS=
51004dcb
A
496 ICUPKGTOOLIBS="$(OBJROOT_CURRENT)/lib:$(OBJROOT_CURRENT)/stubdata"
497 ICUPKGTOOL=$(OBJROOT_CURRENT)/bin/icupkg
729e4ab9 498 FORCEENDIAN=
46f4442e 499endif
729e4ab9
A
500$(info # TARGET_SPEC=$(TARGET_SPEC))
501$(info # ENV_CONFIGURE_ARCHS=$(ENV_CONFIGURE_ARCHS))
46f4442e 502
57a6839d
A
503ICU_TARGET_VERSION_FOR_TZ_EXTRA :=
504ifeq "$(BUILD_TYPE)" "SIMULATOR"
505 ICU_TARGET_VERSION_FOR_TZ_EXTRA := -mmacosx-version-min=$(OSX_HOST_VERSION_MIN_STRING)
46f4442e
A
506endif
507
57a6839d 508ifeq "$(BUILD_TYPE)" "DEVICE"
729e4ab9 509 THUMB_FLAG = -mthumb
57a6839d
A
510else
511 THUMB_FLAG =
729e4ab9
A
512endif
513
5ea0322b
A
514# even for a crossbuild host build, we want to use the target's latest tzdata as pointed to by latest_tzdata.tar.gz;
515# first try RC_EMBEDDEDPROJECT_DIR (<rdar://problem/28141177>), else SDKPATH.
516ifdef RC_EMBEDDEDPROJECT_DIR
517 ifeq "$(shell test -L $(RC_EMBEDDEDPROJECT_DIR)/TimeZoneData/usr/local/share/tz/latest_tzdata.tar.gz && echo YES )" "YES"
518 export TZDATA:=$(RC_EMBEDDEDPROJECT_DIR)/TimeZoneData/usr/local/share/tz/$(shell readlink $(RC_EMBEDDEDPROJECT_DIR)/TimeZoneData/usr/local/share/tz/latest_tzdata.tar.gz)
519 endif
520endif
521ifndef TZDATA
522 ifeq "$(shell test -L $(SDKPATH)/usr/local/share/tz/latest_tzdata.tar.gz && echo YES )" "YES"
523 export TZDATA:=$(SDKPATH)/usr/local/share/tz/$(shell readlink $(SDKPATH)/usr/local/share/tz/latest_tzdata.tar.gz)
524 endif
08b89b0a 525endif
5ea0322b 526$(info # RC_EMBEDDEDPROJECT_DIR=$(RC_EMBEDDEDPROJECT_DIR))
729e4ab9
A
527$(info # TZDATA=$(TZDATA))
528
2ca993e8 529APPLE_INTERNAL_DIR=/AppleInternal
51004dcb
A
530DSYMTOOL := /usr/bin/dsymutil
531DSYMSUFFIX := .dSYM
532
b75a7d8f
A
533#################################
534# Headers
535#################################
536
537# For installhdrs. Not every compiled module has an associated header. Normally,
2ca993e8 538# ICU installs headers as a sub-target of the install target. But since we only want
b75a7d8f
A
539# certain libraries to install (and since we link all of our own .o modules), we need
540# invoke the headers targets ourselves. This may be problematic because there isn't a
541# good way to dist-clean afterwards...we need to do explicit dist-cleans, especially if
542# install the extra libraries.
543
544EXTRA_HDRS =
2ca993e8
A
545# EXTRA_HDRS = ./extra/ustdio/ ./layout/
546ifeq "$(ICU_FOR_EMBEDDED_TRAINS)" "YES"
73c04bcf
A
547 HDR_MAKE_SUBDIR = ./common/ ./i18n/ $(EXTRA_HDRS)
548else ifeq "$(WINDOWS)" "YES"
549 HDR_MAKE_SUBDIR = ./common/ ./i18n/ $(EXTRA_HDRS)
550else
551 HDR_MAKE_SUBDIR = ./common/ ./i18n/ ./io/ $(EXTRA_HDRS)
552endif
553ifeq "$(WINDOWS)" "YES"
73c04bcf 554 PRIVATE_HDR_PREFIX=$(APPLE_INTERNAL_DIR)
2ca993e8 555else ifeq "$(ICU_FOR_EMBEDDED_TRAINS)" "YES"
73c04bcf
A
556 HDR_PREFIX=/usr
557 PRIVATE_HDR_PREFIX=/usr/local
729e4ab9
A
558else
559 PRIVATE_HDR_PREFIX=/usr/local
73c04bcf 560endif
b75a7d8f
A
561
562#################################
563# Install
564#################################
565
2ca993e8
A
566# For install. We currently don't install EXTRA_LIBS. We also don't install the data
567# directly into the ICU library. It is now installed at /usr/share/icu/*.dat. Thus we
b75a7d8f
A
568# don't use DATA_OBJ anymore. This could change if we decide to move the data back into
569# the icucore monolithic library.
570
571INSTALL = /usr/bin/install
572COMMON_OBJ = ./common/*.o
573I18N_OBJ = ./i18n/*.o
73c04bcf 574IO_OBJ = ./io/*.o
b75a7d8f
A
575STUB_DATA_OBJ = ./stubdata/*.o
576EXTRA_LIBS =
577#EXTRA_LIBS =./extra/ ./layout/ ./tools/ctestfw/ ./tools/toolutil/
578#DATA_OBJ = ./data/out/build/*.o
2ca993e8 579ifeq "$(ICU_FOR_EMBEDDED_TRAINS)" "YES"
73c04bcf
A
580 DYLIB_OBJS=$(COMMON_OBJ) $(I18N_OBJ) $(STUB_DATA_OBJ)
581else ifeq "$(WINDOWS)" "YES"
582 DYLIB_OBJS=$(COMMON_OBJ) ./common/common.res $(I18N_OBJ) $(STUB_DATA_OBJ)
583else
584 DYLIB_OBJS=$(COMMON_OBJ) $(I18N_OBJ) $(IO_OBJ) $(STUB_DATA_OBJ)
585endif
b75a7d8f 586
46f4442e
A
587#################################
588# Sources
589#################################
590
591# For installsrc (B&I)
592# Note that installsrc is run on the system from which ICU is submitted, which
593# may be a different environment than the one for a which a build is targeted.
594
b331163b
A
595INSTALLSRC_VARFILES=./ICU_embedded.order \
596 ./minimalapis.txt ./minimalapisTest.c ./minimalpatchconfig.txt ./windowspatchconfig.txt ./patchconfig.txt ./crosshostpatchconfig.txt \
597 BuildICUForAAS_script.bat EXPORT.APPLE
46f4442e 598
b75a7d8f
A
599#################################
600# Cleaning
601#################################
602
603#We need to clean after installing.
604
2ca993e8 605EXTRA_CLEAN =
b75a7d8f
A
606
607# Some directories aren't cleaned recursively. Clean them manually...
608MANUAL_CLEAN_TOOLS = ./tools/dumpce
609MANUAL_CLEAN_EXTRA = ./extra/scrptrun ./samples/layout ./extra/ustdio ./extra
2ca993e8 610MANUAL_CLEAN_TEST = ./test/collperf ./test/iotest ./test/letest ./test/thaitest ./test/threadtest ./test/testmap ./test
b75a7d8f
A
611MANUAL_CLEAN_SAMPLE = ./samples/layout ./samples
612
2ca993e8 613CLEAN_SUBDIR = ./stubdata ./common ./i18n ./io ./layout ./layoutex ./data ./tools ./$(MANUAL_CLEAN_TOOLS) $(MANUAL_CLEAN_EXTRA) $(MANUAL_CLEAN_TEST) $(MANUAL_CLEAN_SAMPLE)
b75a7d8f
A
614
615#################################
616# Config flags
617#################################
618
729e4ab9 619ifeq "$(WINDOWS)" "YES"
51004dcb
A
620 ifeq "$(ARCH64)" "YES"
621 CONFIG_FLAGS = --disable-renaming --disable-extras --disable-layout --disable-samples --disable-icuio \
622 --with-data-packaging=library --prefix=$(PRIVATE_HDR_PREFIX) --with-library-bits=64 \
623 $(DRAFT_FLAG)
624 else
625 CONFIG_FLAGS = --disable-renaming --disable-extras --disable-layout --disable-samples --disable-icuio \
626 --with-data-packaging=library --prefix=$(PRIVATE_HDR_PREFIX) --with-library-bits=32 \
627 $(DRAFT_FLAG)
628 endif
729e4ab9
A
629else ifeq "$(LINUX)" "YES"
630 ifeq "$(ARCH64)" "YES"
631 CONFIG_FLAGS = --disable-renaming --disable-extras --disable-layout --disable-samples \
632 --with-data-packaging=archive --prefix=$(PRIVATE_HDR_PREFIX) --with-library-bits=64 \
633 $(DRAFT_FLAG)
634 else
635 CONFIG_FLAGS = --disable-renaming --disable-extras --disable-layout --disable-samples \
636 --with-data-packaging=archive --prefix=$(PRIVATE_HDR_PREFIX) --with-library-bits=32 \
637 $(DRAFT_FLAG)
638 endif
2ca993e8
A
639else ifeq "$(ICU_FOR_EMBEDDED_TRAINS)" "YES"
640 CONFIG_FLAGS = --disable-renaming --disable-extras --disable-layout --disable-samples \
729e4ab9 641 --with-data-packaging=archive --prefix=$(PRIVATE_HDR_PREFIX) \
4388f060 642 $(DRAFT_FLAG)
73c04bcf 643else
729e4ab9
A
644 CONFIG_FLAGS = --disable-renaming --disable-extras --disable-layout --disable-samples \
645 --with-data-packaging=archive --prefix=$(PRIVATE_HDR_PREFIX) \
4388f060 646 $(DRAFT_FLAG)
73c04bcf 647endif
b75a7d8f
A
648
649#################################
650# Install paths
651#################################
652
2ca993e8
A
653# This may or may not be an appropriate name for the icu dylib. This naming scheme is
654# an attempt to follow the icu convention in naming the dylib and then having symbolic
655# links of easier to remember library names point it it. *UPDATE* the version and
b75a7d8f
A
656# sub-version variables as needed. The Core version should be 'A' until the core
657# version changes it's API...that is a new version isn't backwards compatible.
658# The ICU version/subversion should reflect the actual ICU version.
659
374ca955 660LIB_NAME = icucore
2ca993e8 661ICU_VERS = 57
729e4ab9 662ICU_SUBVERS = 1
b75a7d8f 663CORE_VERS = A
b75a7d8f 664
73c04bcf
A
665ifeq "$(WINDOWS)" "YES"
666 DYLIB_SUFF = dll
51004dcb
A
667 ifeq "$(ARCH64)" "YES"
668 winprogdir = /Program\ Files/Common\ Files/Apple/Apple\ Application\ Support/
669 winintlibdir = /AppleInternal/lib64/
670 else
671 winprogdir = /Program\ Files\ \(x86\)/Common\ Files/Apple/Apple\ Application\ Support/
672 winintlibdir = /AppleInternal/lib32/
673 endif
674 libdir =
729e4ab9
A
675else ifeq "$(LINUX)" "YES"
676 DYLIB_SUFF = so
677 ifeq "$(ARCH64)" "YES"
678 libdir = /usr/lib64/
679 else
680 libdir = /usr/lib/
681 endif
51004dcb
A
682 winprogdir =
683 winintlibdir =
73c04bcf
A
684else
685 DYLIB_SUFF = dylib
686 libdir = /usr/lib/
51004dcb
A
687 winprogdir =
688 winintlibdir =
73c04bcf
A
689endif
690
374ca955 691DYLIB = lib$(LIB_NAME).$(DYLIB_SUFF)
73c04bcf
A
692DYLIB_DEBUG = lib$(LIB_NAME)_debug.$(DYLIB_SUFF)
693DYLIB_PROFILE = lib$(LIB_NAME)_profile.$(DYLIB_SUFF)
694ifeq "$(WINDOWS)" "YES"
695 INSTALLED_DYLIB = $(LIB_NAME).$(DYLIB_SUFF)
696 INSTALLED_DYLIB_DEBUG = $(LIB_NAME)_debug.$(DYLIB_SUFF)
697 INSTALLED_DYLIB_PROFILE = $(LIB_NAME)_profile.$(DYLIB_SUFF)
729e4ab9
A
698else ifeq "$(LINUX)" "YES"
699 INSTALLED_DYLIB = lib$(LIB_NAME).$(DYLIB_SUFF)
700 INSTALLED_DYLIB_DEBUG = lib$(LIB_NAME)_debug.$(DYLIB_SUFF)
701 INSTALLED_DYLIB_PROFILE = lib$(LIB_NAME)_profile.$(DYLIB_SUFF)
73c04bcf
A
702else
703 INSTALLED_DYLIB = lib$(LIB_NAME).$(CORE_VERS).$(DYLIB_SUFF)
704 INSTALLED_DYLIB_DEBUG = lib$(LIB_NAME).$(CORE_VERS)_debug.$(DYLIB_SUFF)
705 INSTALLED_DYLIB_PROFILE = lib$(LIB_NAME).$(CORE_VERS)_profile.$(DYLIB_SUFF)
706endif
707
708INSTALLED_DYLIB_icu = INSTALLED_DYLIB
709INSTALLED_DYLIB_debug = INSTALLED_DYLIB_DEBUG
710INSTALLED_DYLIB_profile = INSTALLED_DYLIB_PROFILE
711DYLIB_icu = DYLIB
712DYLIB_debug = DYLIB_DEBUG
713DYLIB_profile = DYLIB_PROFILE
b75a7d8f
A
714
715#################################
716# Data files
717#################################
718
374ca955
A
719OPEN_SOURCE_VERSIONS_DIR=/usr/local/OpenSourceVersions/
720OPEN_SOURCE_LICENSES_DIR=/usr/local/OpenSourceLicenses/
51004dcb 721
b75a7d8f
A
722B_DATA_FILE=icudt$(ICU_VERS)b.dat
723L_DATA_FILE=icudt$(ICU_VERS)l.dat
51004dcb
A
724DATA_BUILD_SUBDIR= data/out
725DATA_INSTALL_DIR=/usr/share/icu/
2ca993e8 726
51004dcb
A
727# DATA_LOOKUP_DIR is what the target ICU_DATA_DIR gets set to in CFLAGS, CXXFLAGS;
728# DATA_LOOKUP_DIR_BUILDHOST is what any crossbuild host ICU_DATA_DIR gets set to.
2ca993e8
A
729# Formerly we had DATA_LOOKUP_DIR=/var/db/icu/ for embedded non-simulator builds
730# and DATA_LOOKUP_DIR=/usr/share/icu/ for everything else. Now all systems look
731# in the same place for the main data file:
732DATA_LOOKUP_DIR=/usr/share/icu/
51004dcb
A
733DATA_LOOKUP_DIR_BUILDHOST=/usr/share/icu/
734
2ca993e8 735# Timezone data file(s)
277af708 736# ICU will look for /var/db/icutz/icutz44l.dat
2ca993e8
A
737# If directory or file is not present, the timesone data in
738# current data file e.g. /usr/share/icu/icudt56l.dat will be used.
739# Currently we are not conditionalizing the definition of
740# TZDATA_LOOKUP_DIR as in
741# ifeq "$(BUILD_TYPE)" "DEVICE"
277af708 742# TZDATA_LOOKUP_DIR = /var/db/icutz
2ca993e8
A
743# else
744# ...
745# since the code stats the path for TZDATA_LOOKUP_DIR and does
746# not try to use it if it does not exist. We could define it
747# as TZDATA_LOOKUP_DIR = /usr/share/icutz when not needed...
748# TZDATA_LOOKUP_DIR is passed to compiler as U_TIMEZONE_FILES_DIR
749# TZDATA_PACKAGE is passed to compiler as U_TIMEZONE_PACKAGE
277af708 750TZDATA_LOOKUP_DIR = /var/db/icutz
2ca993e8
A
751TZDATA_PACKAGE = icutz44l
752TZDATA_FORMAT_STRING = "44l"
753TZDATA_FORMAT_FILE = icutzformat.txt
754
755
51004dcb
A
756# Name of runtime environment variable to get the prefix path for DATA_LOOKUP_DIR
757# Currently we are only using this for LINUX, should also use for iOS simulator
758ifeq "$(LINUX)" "YES"
759 DATA_DIR_PREFIX_ENV_VAR=APPLE_FRAMEWORKS_ROOT
760else
761 DATA_DIR_PREFIX_ENV_VAR=
762endif
b75a7d8f 763
729e4ab9 764#################################
2ca993e8 765# Tools
729e4ab9
A
766#################################
767
768localtooldir=/usr/local/bin/
2ca993e8 769locallibdir=/usr/local/lib/
729e4ab9
A
770
771INFOTOOL = icuinfo
729e4ab9
A
772INFOTOOL_OBJS = ./tools/icuinfo/icuinfo.o ./tools/toolutil/udbgutil.o ./tools/toolutil/uoptions.o
773
a62d09fc
A
774ICUZDUMPTOOL = icuzdump
775ifeq "$(ICU_FOR_EMBEDDED_TRAINS)" "YES"
776 ICUZDUMPTOOL_OBJS = ./tools/tzcode/icuzdump.o $(IO_OBJ)
777else
778 ICUZDUMPTOOL_OBJS = ./tools/tzcode/icuzdump.o
779endif
780
2ca993e8
A
781TOOLSLIB_NAME = icutu
782TOOLS_DYLIB = libicutu.$(DYLIB_SUFF)
783TOOLS_DYLIB_OBJS = ./tools/toolutil/*.o
a62d09fc
A
784
785# The following modified version enables the tz toools to be used on systems with ICU 55 or later.
786# It is used with the toolchain tools below.
787TOOLSLIB_NAME_FORTOOLS = icutux
788TOOLS_DYLIB_FORTOOLS = libicutux.$(DYLIB_SUFF)
789TOOLS_DYLIB_OBJS_FORTOOLS = ./tools/toolutil/collationinfo.o ./tools/toolutil/filestrm.o \
2ca993e8
A
790./tools/toolutil/package.o ./tools/toolutil/pkg_icu.o ./tools/toolutil/pkgitems.o \
791./tools/toolutil/swapimpl.o ./tools/toolutil/toolutil.o ./tools/toolutil/ucbuf.o \
792./tools/toolutil/unewdata.o ./tools/toolutil/uoptions.o ./tools/toolutil/uparse.o \
793$(COMMON_OBJ) $(STUB_DATA_OBJ)
794
795ZICTOOL = icuzic
796ZICTOOL_OBJS = ./tools/tzcode/zic.o ./tools/tzcode/localtime.o ./tools/tzcode/asctime.o ./tools/tzcode/scheck.o ./tools/tzcode/ialloc.o
797
798RESTOOL = icugenrb
799RESTOOL_OBJS = ./tools/genrb/errmsg.o ./tools/genrb/genrb.o ./tools/genrb/parse.o ./tools/genrb/read.o ./tools/genrb/reslist.o ./tools/genrb/ustr.o \
800 ./tools/genrb/rbutil.o ./tools/genrb/wrtjava.o ./tools/genrb/rle.o ./tools/genrb/wrtxml.o ./tools/genrb/prscmnts.o
801
802# note there is also a symbol ICUPKGTOOL which refers to the one used
803# internally which is linked against the separate uc and i18n libs.
804PKGTOOL = icupkg
805PKGTOOL_OBJS = ./tools/icupkg/icupkg.o
806
807TZ2ICUTOOL = tz2icu
808TZ2ICUTOOL_OBJS = ./tools/tzcode/tz2icu.o
809
a62d09fc
A
810GENBRKTOOL = icugenbrk
811GENBRKTOOL_OBJS = ./tools/genbrk/genbrk.o
2ca993e8 812
57a6839d
A
813#################################
814# CLDR file(s)
815# e.g. supplementalData.xml, per <rdar://problem/13426014>
816# These are like internal headers in that they are only installed for
817# (other) projects to build against, not needed at runtime.
818# Therefore install during installhdrs.
819#################################
820
821CLDRFILESDIR=/usr/local/share/cldr
822
374ca955
A
823#################################
824# Environment variables
825#################################
826
827# $(RC_ARCHS:%=-arch %) is a substitution reference. It denotes, in this case,
828# for every value <val> in RC_ARCHS, replace it with "-arch <val>". Substitution
829# references have the form $(var:a=b). We can insert the strip and prebinding commands
830# into CFLAGS (and CXXFLAGS). This controls a lot of the external variables so we don't
831# need to directly modify the ICU files (like for CFLAGS, etc).
832
51004dcb
A
833LIBOVERRIDES=LIBICUDT="-L$(OBJROOT_CURRENT) -l$(LIB_NAME)" \
834 LIBICUUC="-L$(OBJROOT_CURRENT) -l$(LIB_NAME)" \
835 LIBICUI18N="-L$(OBJROOT_CURRENT) -l$(LIB_NAME)"
374ca955 836
46f4442e
A
837# For normal Windows builds set the ENV= options here; for debug Windows builds set the ENV_DEBUG=
838# options here and also the update the LINK.EXE lines in the TARGETS section below.
73c04bcf 839ifeq "$(WINDOWS)" "YES"
51004dcb
A
840 ifeq "$(ARCH64)" "YES"
841 ENV= CFLAGS="/O2 /Ob2 /MD /GF /GS /Zi /nologo /D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES" \
842 CXXFLAGS="/O2 /Ob2 /MD /GF /GS /Zi /nologo /D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES /EHsc /Zc:wchar_t" \
843 LDFLAGS="/NXCOMPAT /DYNAMICBASE /DEBUG /OPT:REF"
73c04bcf 844 else
51004dcb
A
845 ENV= CFLAGS="/O2 /Ob2 /MD /GF /GS /Zi /nologo /D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES" \
846 CXXFLAGS="/O2 /Ob2 /MD /GF /GS /Zi /nologo /D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES /EHsc /Zc:wchar_t" \
847 LDFLAGS="/NXCOMPAT /SAFESEH /DYNAMICBASE /DEBUG /OPT:REF"
73c04bcf 848 endif
51004dcb
A
849 ENV_CONFIGURE= CPPFLAGS="-DU_DISABLE_RENAMING=1 $(DEFINE_BUILD_LEVEL)" \
850 CFLAGS="/O2 /Ob2 /MD /GF /GS /nologo /D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES" \
851 CXXFLAGS="/O2 /Ob2 /MD /GF /GS /nologo /D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES /EHsc /Zc:wchar_t"
852 ENV_DEBUG= CFLAGS="/O2 /Ob2 /MDd /GF /GS /Zi /D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES" \
853 CXXFLAGS="/O2 /Ob2 /MDd /GF /GS /Zi /D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES /EHsc" \
854 LDFLAGS="/DEBUG /DYNAMICBASE"
73c04bcf 855 ENV_PROFILE=
729e4ab9 856else ifeq "$(LINUX)" "YES"
729e4ab9 857 ifeq "$(ARCH64)" "YES"
51004dcb
A
858 ENV_CONFIGURE= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
859 CPPFLAGS="-DU_DISABLE_RENAMING=1 $(DEFINE_BUILD_LEVEL)" \
729e4ab9
A
860 CC="$(CC)" \
861 CXX="$(CXX)" \
51004dcb
A
862 CFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m64 -g -Os -fno-exceptions -fvisibility=hidden" \
863 CXXFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m64 -g -Os -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden" \
729e4ab9 864 TZDATA="$(TZDATA)" \
2ca993e8 865 DYLD_LIBRARY_PATH="$(DSTROOT)/usr/local/lib64"
51004dcb
A
866
867 ENV= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
729e4ab9
A
868 CC="$(CC)" \
869 CXX="$(CXX)" \
51004dcb
A
870 CFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m64 -g -Os -fno-exceptions -fvisibility=hidden" \
871 CXXFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m64 -g -Os -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden" \
729e4ab9 872 TZDATA="$(TZDATA)" \
2ca993e8 873 DYLD_LIBRARY_PATH="$(DSTROOT)/usr/local/lib64"
51004dcb
A
874
875 ENV_DEBUG= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
729e4ab9
A
876 CC="$(CC)" \
877 CXX="$(CXX)" \
51004dcb
A
878 CFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m64 -O0 -gfull -fno-exceptions -fvisibility=hidden" \
879 CXXFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m64 -O0 -gfull -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden" \
729e4ab9 880 TZDATA="$(TZDATA)" \
2ca993e8
A
881 DYLD_LIBRARY_PATH="$(DSTROOT)/usr/local/lib64"
882
51004dcb 883 ENV_PROFILE= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
729e4ab9
A
884 CC="$(CC)" \
885 CXX="$(CXX)" \
51004dcb
A
886 CFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m64 -g -Os -pg -fno-exceptions -fvisibility=hidden" \
887 CXXFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m64 -g -Os -pg -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden" \
729e4ab9 888 TZDATA="$(TZDATA)" \
2ca993e8 889 DYLD_LIBRARY_PATH="$(DSTROOT)/usr/local/lib64"
729e4ab9 890 else
51004dcb
A
891 ENV_CONFIGURE= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
892 CPPFLAGS="-DU_DISABLE_RENAMING=1 $(DEFINE_BUILD_LEVEL)" \
729e4ab9
A
893 CC="$(CC)" \
894 CXX="$(CXX)" \
51004dcb
A
895 CFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m32 -g -Os -fno-exceptions -fvisibility=hidden" \
896 CXXFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m32 -g -Os -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden" \
729e4ab9 897 TZDATA="$(TZDATA)" \
2ca993e8
A
898 DYLD_LIBRARY_PATH="$(DSTROOT)/usr/local/lib"
899
51004dcb 900 ENV= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
729e4ab9
A
901 CC="$(CC)" \
902 CXX="$(CXX)" \
51004dcb
A
903 CFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m32 -g -Os -fno-exceptions -fvisibility=hidden" \
904 CXXFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m32 -g -Os -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden" \
729e4ab9 905 TZDATA="$(TZDATA)" \
2ca993e8
A
906 DYLD_LIBRARY_PATH="$(DSTROOT)/usr/local/lib"
907
51004dcb 908 ENV_DEBUG= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
729e4ab9
A
909 CC="$(CC)" \
910 CXX="$(CXX)" \
51004dcb
A
911 CFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m32 -O0 -gfull -fno-exceptions -fvisibility=hidden" \
912 CXXFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m32 -O0 -gfull -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden" \
729e4ab9 913 TZDATA="$(TZDATA)" \
2ca993e8
A
914 DYLD_LIBRARY_PATH="$(DSTROOT)/usr/local/lib"
915
51004dcb 916 ENV_PROFILE= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
729e4ab9
A
917 CC="$(CC)" \
918 CXX="$(CXX)" \
51004dcb
A
919 CFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m32 -g -Os -pg -fno-exceptions -fvisibility=hidden" \
920 CXXFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DICU_DATA_DIR_PREFIX_ENV_VAR=\"\\\"$(DATA_DIR_PREFIX_ENV_VAR)\\\"\" -m32 -g -Os -pg -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden" \
729e4ab9 921 TZDATA="$(TZDATA)" \
2ca993e8 922 DYLD_LIBRARY_PATH="$(DSTROOT)/usr/local/lib"
729e4ab9 923 endif
73c04bcf 924else
2ca993e8 925 CPPOPTIONS =
51004dcb
A
926 ENV_CONFIGURE= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
927 CPPFLAGS="$(DEFINE_BUILD_LEVEL) -DSTD_INSPIRED -DMAC_OS_X_VERSION_MIN_REQUIRED=$(MAC_OS_X_VERSION_MIN_REQUIRED) $(ISYSROOT) $(ENV_CONFIGURE_ARCHS)" \
729e4ab9
A
928 CC="$(CC)" \
929 CXX="$(CXX)" \
2ca993e8
A
930 CFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DU_TIMEZONE=timezone -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DU_TIMEZONE_FILES_DIR=\"\\\"$(TZDATA_LOOKUP_DIR)\\\"\" -DU_TIMEZONE_PACKAGE=\"\\\"$(TZDATA_PACKAGE)\\\"\" $(ENV_CONFIGURE_ARCHS) $(ICU_TARGET_VERSION) -g -Os -Wglobal-constructors -fno-exceptions -fvisibility=hidden $(ISYSROOT) $(THUMB_FLAG)" \
931 CXXFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DU_TIMEZONE=timezone -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DU_TIMEZONE_FILES_DIR=\"\\\"$(TZDATA_LOOKUP_DIR)\\\"\" -DU_TIMEZONE_PACKAGE=\"\\\"$(TZDATA_PACKAGE)\\\"\" $(ENV_CONFIGURE_ARCHS) $(ICU_TARGET_VERSION) -g -Os -Wglobal-constructors -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden $(ISYSROOT) $(THUMB_FLAG)" \
729e4ab9
A
932 RC_ARCHS="$(RC_ARCHS)" $(FORCEENDIAN)\
933 TZDATA="$(TZDATA)" \
2ca993e8
A
934 DYLD_LIBRARY_PATH="$(DSTROOT)/usr/local/lib"
935
51004dcb 936 ENV= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
729e4ab9
A
937 CC="$(CC)" \
938 CXX="$(CXX)" \
2ca993e8
A
939 CFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DU_TIMEZONE=timezone -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DU_TIMEZONE_FILES_DIR=\"\\\"$(TZDATA_LOOKUP_DIR)\\\"\" -DU_TIMEZONE_PACKAGE=\"\\\"$(TZDATA_PACKAGE)\\\"\" $(RC_ARCHS:%=-arch %) $(ICU_TARGET_VERSION) -g -Os -Wglobal-constructors -fno-exceptions -fvisibility=hidden $(ISYSROOT) $(THUMB_FLAG)" \
940 CXXFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DU_TIMEZONE=timezone -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DU_TIMEZONE_FILES_DIR=\"\\\"$(TZDATA_LOOKUP_DIR)\\\"\" -DU_TIMEZONE_PACKAGE=\"\\\"$(TZDATA_PACKAGE)\\\"\" $(RC_ARCHS:%=-arch %) $(ICU_TARGET_VERSION) -g -Os -Wglobal-constructors -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden $(ISYSROOT) $(THUMB_FLAG)" \
73c04bcf
A
941 RC_ARCHS="$(RC_ARCHS)" \
942 TZDATA="$(TZDATA)" \
2ca993e8
A
943 DYLD_LIBRARY_PATH="$(DSTROOT)/usr/local/lib"
944
51004dcb 945 ENV_DEBUG= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
729e4ab9
A
946 CC="$(CC)" \
947 CXX="$(CXX)" \
2ca993e8
A
948 CFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DU_TIMEZONE=timezone -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DU_TIMEZONE_FILES_DIR=\"\\\"$(TZDATA_LOOKUP_DIR)\\\"\" -DU_TIMEZONE_PACKAGE=\"\\\"$(TZDATA_PACKAGE)\\\"\" $(RC_ARCHS:%=-arch %) $(ICU_TARGET_VERSION) -O0 -gfull -Wglobal-constructors -fno-exceptions -fvisibility=hidden $(ISYSROOT) $(THUMB_FLAG)" \
949 CXXFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DU_TIMEZONE=timezone -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DU_TIMEZONE_FILES_DIR=\"\\\"$(TZDATA_LOOKUP_DIR)\\\"\" -DU_TIMEZONE_PACKAGE=\"\\\"$(TZDATA_PACKAGE)\\\"\" $(RC_ARCHS:%=-arch %) $(ICU_TARGET_VERSION) -O0 -gfull -Wglobal-constructors -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden $(ISYSROOT) $(THUMB_FLAG)" \
73c04bcf
A
950 RC_ARCHS="$(RC_ARCHS)" \
951 TZDATA="$(TZDATA)" \
2ca993e8
A
952 DYLD_LIBRARY_PATH="$(DSTROOT)/usr/local/lib"
953
51004dcb 954 ENV_PROFILE= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
729e4ab9
A
955 CC="$(CC)" \
956 CXX="$(CXX)" \
2ca993e8
A
957 CFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DU_TIMEZONE=timezone -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DU_TIMEZONE_FILES_DIR=\"\\\"$(TZDATA_LOOKUP_DIR)\\\"\" -DU_TIMEZONE_PACKAGE=\"\\\"$(TZDATA_PACKAGE)\\\"\" $(RC_ARCHS:%=-arch %) $(ICU_TARGET_VERSION) -g -Os -pg -Wglobal-constructors -fno-exceptions -fvisibility=hidden $(ISYSROOT) $(THUMB_FLAG)" \
958 CXXFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DU_TIMEZONE=timezone -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" -DU_TIMEZONE_FILES_DIR=\"\\\"$(TZDATA_LOOKUP_DIR)\\\"\" -DU_TIMEZONE_PACKAGE=\"\\\"$(TZDATA_PACKAGE)\\\"\" $(RC_ARCHS:%=-arch %) $(ICU_TARGET_VERSION) -g -Os -pg -Wglobal-constructors -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden $(ISYSROOT) $(THUMB_FLAG)" \
73c04bcf
A
959 RC_ARCHS="$(RC_ARCHS)" \
960 TZDATA="$(TZDATA)" \
2ca993e8 961 DYLD_LIBRARY_PATH="$(DSTROOT)/usr/local/lib"
51004dcb
A
962
963 ENV_CONFIGURE_BUILDHOST= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
964 CPPFLAGS="$(DEFINE_BUILD_LEVEL) -DSTD_INSPIRED -DMAC_OS_X_VERSION_MIN_REQUIRED=$(MAC_OS_X_VERSION_MIN_REQUIRED) $(HOSTISYSROOT)" \
965 CC="$(HOSTCC)" \
966 CXX="$(HOSTCXX)" \
57a6839d
A
967 CFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DU_TIMEZONE=timezone -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR_BUILDHOST)\\\"\" -DMAC_OS_X_VERSION_MIN_REQUIRED=$(MAC_OS_X_VERSION_MIN_REQUIRED) -mmacosx-version-min=$(OSX_HOST_VERSION_MIN_STRING) $(HOSTISYSROOT) -g -Os -Wglobal-constructors -fno-exceptions -fvisibility=hidden" \
968 CXXFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DU_TIMEZONE=timezone -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR_BUILDHOST)\\\"\" -DMAC_OS_X_VERSION_MIN_REQUIRED=$(MAC_OS_X_VERSION_MIN_REQUIRED) -mmacosx-version-min=$(OSX_HOST_VERSION_MIN_STRING) $(HOSTISYSROOT) -g -Os -Wglobal-constructors -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden" \
729e4ab9 969 TZDATA="$(TZDATA)" \
2ca993e8
A
970 DYLD_LIBRARY_PATH="$(DSTROOT)/usr/local/lib"
971
51004dcb
A
972 ENV_BUILDHOST= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
973 CC="$(HOSTCC)" \
974 CXX="$(HOSTCXX)" \
57a6839d
A
975 CFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DU_TIMEZONE=timezone -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR_BUILDHOST)\\\"\" -DMAC_OS_X_VERSION_MIN_REQUIRED=$(MAC_OS_X_VERSION_MIN_REQUIRED) -mmacosx-version-min=$(OSX_HOST_VERSION_MIN_STRING) $(HOSTISYSROOT) -g -Os -Wglobal-constructors -fno-exceptions -fvisibility=hidden" \
976 CXXFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DU_TIMEZONE=timezone -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR_BUILDHOST)\\\"\" -DMAC_OS_X_VERSION_MIN_REQUIRED=$(MAC_OS_X_VERSION_MIN_REQUIRED) -mmacosx-version-min=$(OSX_HOST_VERSION_MIN_STRING) $(HOSTISYSROOT) -g -Os -Wglobal-constructors -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden" \
73c04bcf 977 TZDATA="$(TZDATA)" \
2ca993e8 978 DYLD_LIBRARY_PATH="$(DSTROOT)/usr/local/lib"
729e4ab9 979
73c04bcf 980endif
2ca993e8 981
374ca955
A
982ENV_icu = ENV
983ENV_debug = ENV_DEBUG
73c04bcf 984ENV_profile = ENV_PROFILE
374ca955 985
57a6839d
A
986ifeq "$(BUILD_TYPE)" "DEVICE"
987 ORDERFILE=$(SDKPATH)/AppleInternal/OrderFiles/libicucore.order
2ca993e8 988else ifeq "$(BUILD_TYPE)" "SIMULATOR"
46f4442e
A
989 ORDERFILE=$(SRCROOT)/ICU_embedded.order
990else
991 ORDERFILE=/usr/local/lib/OrderFiles/libicucore.order
992endif
374ca955
A
993ifeq "$(shell test -f $(ORDERFILE) && echo YES )" "YES"
994 SECTORDER_FLAGS=-sectorder __TEXT __text $(ORDERFILE)
995else
996 SECTORDER_FLAGS=
997endif
998
999
b75a7d8f
A
1000#################################
1001#################################
1002# TARGETS
1003#################################
1004#################################
374ca955 1005
2ca993e8
A
1006.PHONY : icu check installsrc installhdrs installhdrsint clean install debug debug-install \
1007crossbuildhost icutztoolsforsdk
374ca955
A
1008.DELETE_ON_ERROR :
1009
2ca993e8
A
1010# Rule for adjusting sources for different train types.
1011# Assumes current directory is icuSources to be patched.
1012# This may be:
1013# $(SRCROOT)/icuSources for installsrc, or
1014# $(OBJROOT_CURRENT) if sources are copied for e.g. a local make.
1015#
1016# The various patchconfig files should assume the current directory is icuSources.
1017#
1018# Note that if sources have been installed by installsrc (only run as part of buildit
1019# or B&I builds), then
1020# $(SRCROOT)/.git is not present, and
1021# ADJUST_SOURCES has already have been run.
1022# Otherwise, if we are doing a local build (e.g. make check, make install), then
1023# $(SRCROOT)/.git is present, and
1024# ADJUST_SOURCES has not been run (run it after copying sources to OBJROOT_CURRENT)
1025#
1026
1027ADJUST_SOURCES = \
1028 if test "$(ICU_FOR_EMBEDDED_TRAINS)" = "YES"; then \
1029 patch -p1 <$(SRCROOT)/minimalpatchconfig.txt; \
1030 elif test "$(WINDOWS)" = "YES"; then \
1031 patch -p1 <$(SRCROOT)/windowspatchconfig.txt; \
1032 else \
1033 patch -p1 <$(SRCROOT)/patchconfig.txt; \
1034 fi; \
1035 if test "$(WINDOWS)" = "YES"; then \
1036 mv data/unidata/base_unidata/*.txt data/unidata/; \
1037 mv data/unidata/norm2/base_norm2/*.txt data/unidata/norm2/; \
1038 mv data/in/base_in/*.nrm data/in/; \
1039 mv data/in/base_in/*.icu data/in/; \
1040 elif test "$(LINUX)" = "YES"; then \
1041 mv data/unidata/base_unidata/*.txt data/unidata/; \
1042 mv data/unidata/norm2/base_norm2/*.txt data/unidata/norm2/; \
1043 mv data/in/base_in/*.nrm data/in/; \
1044 mv data/in/base_in/*.icu data/in/; \
1045 fi
1046
1047
51004dcb
A
1048icu debug profile : $(OBJROOT_CURRENT)/Makefile
1049 echo "# make for target";
1050 (cd $(OBJROOT_CURRENT); \
374ca955 1051 $(MAKE) $($(ENV_$@)); \
73c04bcf 1052 if test "$(WINDOWS)" = "YES"; then \
729e4ab9
A
1053 (cd common; \
1054 rc.exe /folibicuuc.res $(CPPFLAGS) -DU_RELEASE=1 -D_CRT_SECURE_NO_DEPRECATE -I. -I../i18n \
1055 "-DDEFAULT_ICU_PLUGINS=\"/AppleInternal/lib/icu\" " -DU_LOCAL_SERVICE_HOOK=1 libicuuc.rc; \
1056 ); \
1057 (cd i18n; \
1058 rc.exe /folibicuin.res $(CPPFLAGS) -DU_RELEASE=1 -D_CRT_SECURE_NO_DEPRECATE -I. -I../common libicuin.rc; \
1059 ); \
73c04bcf
A
1060 if test "$@" = "debug"; then \
1061 (cd common; \
729e4ab9
A
1062 LINK.EXE /subsystem:console /DLL /nologo /base:"0x4a800000" /DYNAMICBASE /DEBUG \
1063 /IMPLIB:../lib/libicuuc_$@.lib /out:../lib/libicuuc_$@.dll \
1064 *.o libicuuc.res ../stubdata/icudt.lib advapi32.lib; \
1065 ); \
73c04bcf 1066 (cd i18n; \
729e4ab9
A
1067 LINK.EXE /subsystem:console /DLL /nologo /base:"0x4a900000" /DYNAMICBASE /DEBUG \
1068 /IMPLIB:../lib/libicuin_$@.lib /out:../lib/libicuin_$@.dll \
1069 *.o libicuin.res ../lib/libicuuc_$@.lib ../stubdata/icudt.lib advapi32.lib; \
1070 ); \
1071 else \
729e4ab9 1072 (cd common; \
729e4ab9 1073 rm -f ../lib/libicuuc.dll.manifest; \
51004dcb
A
1074 if test "$(ARCH64)" = "YES"; then \
1075 LINK.EXE /DLL /NXCOMPAT /DYNAMICBASE /DEBUG /OPT:REF /MANIFEST \
1076 /IMPLIB:../lib/libicuuc.lib /out:../lib/libicuuc.dll \
1077 *.o libicuuc.res ../stubdata/icudt.lib advapi32.lib; \
1078 else \
1079 LINK.EXE /DLL /NXCOMPAT /SAFESEH /DYNAMICBASE /DEBUG /OPT:REF /MANIFEST \
1080 /IMPLIB:../lib/libicuuc.lib /out:../lib/libicuuc.dll \
1081 *.o libicuuc.res ../stubdata/icudt.lib advapi32.lib; \
1082 fi; \
729e4ab9 1083 mt.exe -nologo -manifest ../lib/libicuuc.dll.manifest -outputresource:"../lib/libicuuc.dll;2"; \
729e4ab9
A
1084 ); \
1085 (cd i18n; \
729e4ab9 1086 rm -f ../lib/libicuin.dll.manifest; \
51004dcb
A
1087 if test "$(ARCH64)" = "YES"; then \
1088 LINK.EXE /DLL /NXCOMPAT /DYNAMICBASE /DEBUG /OPT:REF /MANIFEST \
1089 /IMPLIB:../lib/libicuin.lib /out:../lib/libicuin.dll \
1090 *.o libicuin.res ../lib/libicuuc.lib ../stubdata/icudt.lib advapi32.lib; \
1091 else \
1092 LINK.EXE /DLL /NXCOMPAT /SAFESEH /DYNAMICBASE /DEBUG /OPT:REF /MANIFEST \
1093 /IMPLIB:../lib/libicuin.lib /out:../lib/libicuin.dll \
1094 *.o libicuin.res ../lib/libicuuc.lib ../stubdata/icudt.lib advapi32.lib; \
1095 fi; \
729e4ab9 1096 mt.exe -nologo -manifest ../lib/libicuin.dll.manifest -outputresource:"../lib/libicuin.dll;2"; \
729e4ab9 1097 ); \
51004dcb
A
1098 if test "$(ARCH64)" != "YES"; then \
1099 mkdir -p lib/shim; \
1100 (cd common; \
1101 rm -f icuuc40shim.o; \
1102 rm -f ../lib/icuuc40.dll.manifest; \
1103 cl -DU_DISABLE_RENAMING=1 -DU_ICU_VERSION_BUILDLEVEL_NUM=$(ICU_BUILD) \
1104 -DU_RELEASE=1 -D_CRT_SECURE_NO_DEPRECATE -I. -I../i18n \
1105 -DU_LOCAL_SERVICE_HOOK=1 -DWIN32 -DU_COMMON_IMPLEMENTATION \
1106 /O2 /Ob2 /MD /GF /GS /Zi /nologo /D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES /EHsc /Zc:wchar_t \
1107 /c /Foicuuc40shim.o icuuc40shim.cpp; \
1108 rc.exe /foicuuc40shim.res $(CPPFLAGS) -DU_RELEASE=1 -D_CRT_SECURE_NO_DEPRECATE -I. -I../i18n \
1109 "-DDEFAULT_ICU_PLUGINS=\"/AppleInternal/lib/icu\" " -DU_LOCAL_SERVICE_HOOK=1 icuuc40shim.rc; \
1110 LINK.EXE /DLL /NXCOMPAT /SAFESEH /DYNAMICBASE /DEBUG /OPT:REF /MANIFEST \
1111 /IMPLIB:../lib/shim/icuuc.lib /out:../lib/icuuc40.dll \
1112 icuuc40shim.o icuuc40shim.res ../lib/libicuuc.lib ../stubdata/icudt.lib advapi32.lib; \
1113 mt.exe -nologo -manifest ../lib/icuuc40.dll.manifest -outputresource:"../lib/icuuc40.dll;2"; \
1114 ); \
1115 (cd i18n; \
1116 rm -f icuin40shim.o; \
1117 rm -f ../lib/icuin40.dll.manifest; \
1118 cl -DU_DISABLE_RENAMING=1 -DU_ICU_VERSION_BUILDLEVEL_NUM=$(ICU_BUILD) \
1119 -DU_RELEASE=1 -D_CRT_SECURE_NO_DEPRECATE -I. -I../common \
1120 -DU_LOCAL_SERVICE_HOOK=1 -DWIN32 -DU_I18N_IMPLEMENTATION \
1121 /O2 /Ob2 /MD /GF /GS /Zi /nologo /D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES /EHsc /Zc:wchar_t \
1122 /c /Foicuin40shim.o icuin40shim.cpp; \
1123 rc.exe /foicuin40shim.res $(CPPFLAGS) -DU_RELEASE=1 -D_CRT_SECURE_NO_DEPRECATE -I. -I../common \
1124 "-DDEFAULT_ICU_PLUGINS=\"/AppleInternal/lib/icu\" " -DU_LOCAL_SERVICE_HOOK=1 icuin40shim.rc; \
1125 LINK.EXE /DLL /NXCOMPAT /SAFESEH /DYNAMICBASE /DEBUG /OPT:REF /MANIFEST \
1126 /IMPLIB:../lib/shim/icuin.lib /out:../lib/icuin40.dll \
1127 icuin40shim.o icuin40shim.res ../lib/libicuin.lib ../stubdata/icudt.lib advapi32.lib; \
1128 mt.exe -nologo -manifest ../lib/icuin40.dll.manifest -outputresource:"../lib/icuin40.dll;2"; \
1129 ); \
1130 fi; \
73c04bcf 1131 fi; \
374ca955 1132 else \
729e4ab9
A
1133 if test "$(LINUX)" = "YES"; then \
1134 if test "$(ARCH64)" = "YES"; then \
1135 $($(ENV_$@)) $(CXX) \
1136 -m64 -g -Os -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden \
1137 $(CXXFLAGS) $(LDFLAGS) -shared -Wl,-Bsymbolic -Wl,-soname,$($(INSTALLED_DYLIB_$@)) -Wl,-L/usr/lib64/ -ldl \
1138 -o ./$($(INSTALLED_DYLIB_$@)) $(DYLIB_OBJS); \
1139 else \
1140 $($(ENV_$@)) $(CXX) \
1141 -m32 -g -Os -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden \
1142 $(CXXFLAGS) $(LDFLAGS) -shared -Wl,-Bsymbolic -Wl,-soname,$($(INSTALLED_DYLIB_$@)) -ldl \
1143 -o ./$($(INSTALLED_DYLIB_$@)) $(DYLIB_OBJS); \
1144 fi; \
1145 else \
1146 tmpfile=`mktemp -t weakexternal.XXXXXX` || exit 1; \
4388f060 1147 $(NM) -m $(RC_ARCHS:%=-arch %) $(DYLIB_OBJS) | fgrep "weak external" | fgrep -v "undefined" | sed -e 's/.*weak external[^_]*//' | sort | uniq | cat >$$tmpfile; \
729e4ab9 1148 $($(ENV_$@)) $(CXX) -current_version $(ICU_VERS).$(ICU_SUBVERS) -compatibility_version 1 -dynamiclib -dynamic \
4388f060 1149 $(RC_ARCHS:%=-arch %) $(ICU_TARGET_VERSION) -g -Os -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden $(ISYSROOT) $(THUMB_FLAG) \
729e4ab9
A
1150 $(CXXFLAGS) $(LDFLAGS) -single_module $(SECTORDER_FLAGS) -unexported_symbols_list $$tmpfile -dead_strip \
1151 -install_name $(libdir)$($(INSTALLED_DYLIB_$@)) -o ./$($(INSTALLED_DYLIB_$@)) $(DYLIB_OBJS); \
1152 if test "$@" = "icu"; then \
1153 ln -fs $(INSTALLED_DYLIB) $(DYLIB); \
2ca993e8 1154 echo '# build' $(INFOTOOL) 'linked against' $(LIB_NAME) ; \
729e4ab9 1155 $($(ENV_$@)) $(CXX) $(RC_ARCHS:%=-arch %) -g -Os -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden $(ISYSROOT) $(THUMB_FLAG) \
57a6839d 1156 $(LDFLAGS) -dead_strip -o ./$(INFOTOOL) $(INFOTOOL_OBJS) -L./ -l$(LIB_NAME) ; \
2ca993e8
A
1157 echo '# build' $(TOOLS_DYLIB) 'linked against' $(LIB_NAME) ; \
1158 $($(ENV_$@)) $(CXX) -current_version $(ICU_VERS).$(ICU_SUBVERS) -compatibility_version 1 -dynamiclib -dynamic \
1159 $(RC_ARCHS:%=-arch %) $(ICU_TARGET_VERSION) -g -Os -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden $(ISYSROOT) $(THUMB_FLAG) \
1160 $(CXXFLAGS) $(LDFLAGS) -single_module \
1161 -install_name $(locallibdir)$(TOOLS_DYLIB) -o ./$(TOOLS_DYLIB) $(TOOLS_DYLIB_OBJS) -L./ -l$(LIB_NAME) ; \
1162 echo '# build' $(ICUZDUMPTOOL) 'linked against' $(TOOLSLIB_NAME) $(LIB_NAME) ; \
1163 $($(ENV_$@)) $(LINK.cc) $(RC_ARCHS:%=-arch %) -g -Os $(ISYSROOT) $(THUMB_FLAG) --std=c++0x \
1164 -dead_strip -o ./$(ICUZDUMPTOOL) $(ICUZDUMPTOOL_OBJS) -L./ -l$(TOOLSLIB_NAME) -l$(LIB_NAME); \
729e4ab9
A
1165 fi; \
1166 fi; \
51004dcb
A
1167 if test -f ./$(DATA_BUILD_SUBDIR)/$(B_DATA_FILE); then \
1168 ln -fs ./$(DATA_BUILD_SUBDIR)/$(B_DATA_FILE); \
73c04bcf 1169 fi; \
51004dcb
A
1170 if test -f ./$(DATA_BUILD_SUBDIR)/$(L_DATA_FILE); then \
1171 ln -fs ./$(DATA_BUILD_SUBDIR)/$(L_DATA_FILE); \
73c04bcf 1172 else \
729e4ab9 1173 DYLD_LIBRARY_PATH=$(ICUPKGTOOLIBS) \
51004dcb 1174 $(ICUPKGTOOL) -tl ./$(DATA_BUILD_SUBDIR)/$(B_DATA_FILE) $(L_DATA_FILE); \
73c04bcf 1175 fi; \
2ca993e8 1176 printf $(TZDATA_FORMAT_STRING) > $(TZDATA_FORMAT_FILE); \
374ca955
A
1177 fi; \
1178 );
1179
729e4ab9 1180crossbuildhost : $(CROSSHOST_OBJROOT)/Makefile
51004dcb 1181 echo "# make for crossbuild host";
729e4ab9
A
1182 (cd $(CROSSHOST_OBJROOT); \
1183 $(MAKE) $($(ENV_BUILDHOST)); \
1184 );
1185
2ca993e8 1186# For the install-icutztoolsforsdk target, SDKROOT will always be an OSX SDK root.
a62d09fc 1187# If the sources were installed using the minimalpatchconfig.txt patch, then
2ca993e8 1188# we need to patch using crosshostpatchconfig.txt as for $(CROSSHOST_OBJROOT)/Makefile
a62d09fc 1189# (otherwise we ignore the patch in crosshostpatchconfig.txt, using -N)
2ca993e8
A
1190icutztoolsforsdk : $(OBJROOT_CURRENT)/Makefile
1191 echo "# make icutztoolsforsdk";
1192 (cd $(OBJROOT_CURRENT); \
a62d09fc 1193 if test ! -d $(SRCROOT)/.git ; then patch -N -p1 <$(SRCROOT)/crosshostpatchconfig.txt; fi; \
2ca993e8 1194 $(MAKE) $($(ENV)); \
a62d09fc 1195 echo '# build' $(TOOLS_DYLIB_FORTOOLS) 'linked against' $(LIB_NAME) ; \
2ca993e8
A
1196 $($(ENV)) $(CXX) -current_version $(ICU_VERS).$(ICU_SUBVERS) -compatibility_version 1 -dynamiclib -dynamic \
1197 -g -Os -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden $(ISYSROOT) \
1198 $(CXXFLAGS) $(LDFLAGS) -single_module \
a62d09fc
A
1199 -install_name $(locallibdir)$(TOOLS_DYLIB_FORTOOLS) -o ./$(TOOLS_DYLIB_FORTOOLS) $(TOOLS_DYLIB_OBJS_FORTOOLS) -L./ -l$(LIB_NAME) ; \
1200 echo '# build' $(ZICTOOL) 'linked against' $(TOOLSLIB_NAME_FORTOOLS) ; \
2ca993e8 1201 $($(ENV_BUILDHOST)) $(CXX) -g -Os -isysroot $(HOSTSDKPATH) \
a62d09fc
A
1202 $(LDFLAGS) -dead_strip -o ./$(ZICTOOL) $(ZICTOOL_OBJS) -L./ -l$(TOOLSLIB_NAME_FORTOOLS) ; \
1203 echo '# build' $(RESTOOL) 'linked against' $(TOOLSLIB_NAME_FORTOOLS) $(LIB_NAME) ; \
2ca993e8 1204 $($(ENV_BUILDHOST)) $(CXX) -g -Os -isysroot $(HOSTSDKPATH) \
a62d09fc
A
1205 $(LDFLAGS) -dead_strip -o ./$(RESTOOL) $(RESTOOL_OBJS) -L./ -l$(TOOLSLIB_NAME_FORTOOLS) -l$(LIB_NAME) ; \
1206 echo '# build' $(PKGTOOL) 'linked against' $(TOOLSLIB_NAME_FORTOOLS) ; \
2ca993e8 1207 $($(ENV_BUILDHOST)) $(CXX) -g -Os -isysroot $(HOSTSDKPATH) \
a62d09fc
A
1208 $(LDFLAGS) -dead_strip -o ./$(PKGTOOL) $(PKGTOOL_OBJS) -L./ -l$(TOOLSLIB_NAME_FORTOOLS) ; \
1209 echo '# build' $(TZ2ICUTOOL) 'linked against' $(TOOLSLIB_NAME_FORTOOLS) ; \
2ca993e8 1210 $($(ENV_BUILDHOST)) $(CXX) -g -Os -isysroot $(HOSTSDKPATH) \
a62d09fc
A
1211 $(LDFLAGS) -dead_strip -o ./$(TZ2ICUTOOL) $(TZ2ICUTOOL_OBJS) -L./ -l$(TOOLSLIB_NAME_FORTOOLS) ; \
1212 echo '# build' $(GENBRKTOOL) 'linked against' $(TOOLSLIB_NAME_FORTOOLS) ; \
1213 $($(ENV_BUILDHOST)) $(CXX) -g -Os -isysroot $(HOSTSDKPATH) \
1214 $(LDFLAGS) -dead_strip -o ./$(GENBRKTOOL) $(GENBRKTOOL_OBJS) -L./ -l$(TOOLSLIB_NAME_FORTOOLS) ; \
2ca993e8
A
1215 );
1216
374ca955 1217check : icu
729e4ab9 1218ifneq "$(CROSS_BUILD)" "YES"
51004dcb
A
1219 (cd $(OBJROOT_CURRENT); \
1220 ICU_DATA=$(OBJROOT_CURRENT) $(MAKE) $(ENV) check; \
73c04bcf 1221 );
729e4ab9
A
1222else
1223 $(warning check not supported for cross-build)
1224endif
73c04bcf
A
1225
1226check-debug: debug
729e4ab9 1227ifneq "$(CROSS_BUILD)" "YES"
51004dcb
A
1228 (cd $(OBJROOT_CURRENT); \
1229 ICU_DATA=$(OBJROOT_CURRENT) $(MAKE) $(ENV_DEBUG) check; \
374ca955 1230 );
729e4ab9
A
1231else
1232 $(warning check not supported for cross-build)
1233endif
374ca955
A
1234
1235samples: icu
51004dcb 1236 (cd $(OBJROOT_CURRENT)/samples; \
374ca955
A
1237 $(MAKE) $(ENV_DEBUG) $(LIBOVERRIDES); \
1238 );
1239
1240extra: icu
51004dcb 1241 (cd $(OBJROOT_CURRENT)/extra; \
374ca955
A
1242 $(MAKE) $(ENV_DEBUG) $(LIBOVERRIDES); \
1243 );
1244
729e4ab9 1245ifneq "$(CROSS_BUILD)" "YES"
2ca993e8 1246$(OBJROOT_CURRENT)/Makefile :
729e4ab9 1247else
51004dcb 1248$(OBJROOT_CURRENT)/Makefile : crossbuildhost
729e4ab9 1249endif
51004dcb
A
1250 if test ! -d $(OBJROOT_CURRENT); then \
1251 mkdir -p $(OBJROOT_CURRENT); \
374ca955 1252 fi;
51004dcb 1253 cp -Rpf $(SRCROOT)/icuSources/* $(OBJROOT_CURRENT)/;
2ca993e8
A
1254 (cd $(OBJROOT_CURRENT); \
1255 if test -d $(SRCROOT)/.git ; then $(ADJUST_SOURCES); fi; \
1256 if test "$(WINDOWS)" = "YES"; then \
1257 echo "# configure for target"; \
1258 $(ENV_CONFIGURE) ./runConfigureICU Cygwin/MSVC $(CONFIG_FLAGS); \
1259 elif test "$(LINUX)" = "YES"; then \
1260 echo "# configure for target"; \
1261 $(ENV_CONFIGURE) ./runConfigureICU Linux $(CONFIG_FLAGS); \
1262 elif test "$(CROSS_BUILD)" = "YES"; then \
1263 echo "# configure for crossbuild target"; \
1264 $(ENV_CONFIGURE) ./configure --host=$(TARGET_SPEC) --with-cross-build=$(CROSSHOST_OBJROOT) $(CONFIG_FLAGS); \
1265 else \
1266 echo "# configure for non-crossbuild target"; \
1267 $(ENV_CONFIGURE) ./runConfigureICU MacOSX $(CONFIG_FLAGS); \
1268 fi; \
1269 );
729e4ab9
A
1270
1271# for the tools that build the data file, cannot set UDATA_DEFAULT_ACCESS = UDATA_ONLY_PACKAGES
2ca993e8
A
1272# as minimalpatchconfig.txt does; need different patches for the host build. Thus
1273# we have to use crosshostpatchconfig.txt to undo the udata.h changes that would have
1274# been made for ICU_FOR_EMBEDDED_TRAINS builds.
1275$(CROSSHOST_OBJROOT)/Makefile :
729e4ab9
A
1276 if test ! -d $(CROSSHOST_OBJROOT); then \
1277 mkdir -p $(CROSSHOST_OBJROOT); \
1278 fi;
4388f060 1279 cp -Rpf $(SRCROOT)/icuSources/* $(CROSSHOST_OBJROOT);
2ca993e8
A
1280 (cd $(CROSSHOST_OBJROOT); \
1281 if test -d $(SRCROOT)/.git; then $(ADJUST_SOURCES); fi; \
1282 if test "$(ICU_FOR_EMBEDDED_TRAINS)" = "YES"; then \
1283 patch -p1 <$(SRCROOT)/crosshostpatchconfig.txt; \
1284 fi; \
1285 echo "# configure for crossbuild host"; \
1286 $(ENV_CONFIGURE_BUILDHOST) ./runConfigureICU MacOSX $(CONFIG_FLAGS); \
1287 );
374ca955
A
1288
1289#################################
1290# B&I TARGETS
1291#################################
1292
2ca993e8 1293# Since our sources are in icuSources (ignore the ICU subdirectory for now), we wish to
b75a7d8f 1294# copy them to somewhere else. We tar it to stdout, cd to the appropriate directory, and
2ca993e8 1295# untar from stdin. We then look for all the CVS directories and remove them. We may have
b75a7d8f
A
1296# to remove the .cvsignore files also.
1297
1298installsrc :
1299 if test ! -d $(SRCROOT); then mkdir $(SRCROOT); fi;
1300 if test -d $(SRCROOT)/icuSources ; then rm -rf $(SRCROOT)/icuSources; fi;
2ca993e8
A
1301 tar cf - ./makefile ./ICU.plist ./LICENSE ./icuSources ./cldrFiles $(INSTALLSRC_VARFILES) | (cd $(SRCROOT) ; tar xfp -); \
1302 (cd $(SRCROOT)/icuSources; $(ADJUST_SOURCES) );
b75a7d8f 1303
2ca993e8
A
1304# This works. Just not for ~ in the DSTROOT. We run configure first (in case it hasn't
1305# been already). Then we make the install-headers target on specific makefiles (since
b75a7d8f
A
1306# not every subdirectory/sub-component has a install-headers target).
1307
2ca993e8
A
1308# installhdrs should be no-op for BUILD_TYPE=TOOL
1309ifeq "$(BUILD_TYPE)" "TOOL"
46f4442e
A
1310installhdrs :
1311else
1312installhdrs : installhdrsint
1313endif
2ca993e8
A
1314
1315MKINSTALLDIRS=$(SHELL) $(SRCROOT)/icuSources/mkinstalldirs
1316INSTALL_DATA=${INSTALL} -m 644
1317
1318ifeq "$(RC_XBS)" "YES"
1319installhdrsint :
1320else
51004dcb 1321installhdrsint : $(OBJROOT_CURRENT)/Makefile
2ca993e8
A
1322endif
1323 (if test -d $(SRCROOT)/.git; then cd $(OBJROOT_CURRENT); else cd $(SRCROOT)/icuSources/; fi; \
1324 $(MKINSTALLDIRS) $(DSTROOT)/$(PRIVATE_HDR_PREFIX)/include/unicode/; \
73c04bcf 1325 for subdir in $(HDR_MAKE_SUBDIR); do \
2ca993e8
A
1326 echo "# Subdir $$subdir"; \
1327 (cd $$subdir/unicode; \
1328 for i in *.h; do \
1329 echo "$(INSTALL_DATA) $$i $(DSTROOT)/$(PRIVATE_HDR_PREFIX)/include/unicode/"; \
1330 $(INSTALL_DATA) $$i $(DSTROOT)/$(PRIVATE_HDR_PREFIX)/include/unicode/ || exit; \
1331 done; \
1332 ); \
73c04bcf 1333 done; \
2ca993e8
A
1334 if test "$(ICU_FOR_EMBEDDED_TRAINS)" = "YES"; then \
1335 if test ! -d $(DSTROOT)/$(HDR_PREFIX)/include/unicode/; then \
1336 $(INSTALL) -d -m 0755 $(DSTROOT)/$(HDR_PREFIX)/include/unicode/; \
729e4ab9 1337 fi; \
2ca993e8
A
1338 if test -d $(DSTROOT)/$(PRIVATE_HDR_PREFIX)/include/unicode/; then \
1339 (cd $(DSTROOT)/$(PRIVATE_HDR_PREFIX)/include/unicode; \
729e4ab9
A
1340 for i in *.h; do \
1341 if fgrep -q -x $$i $(SRCROOT)/minimalapis.txt ; then \
2ca993e8 1342 mv $$i $(DSTROOT)/$(HDR_PREFIX)/include/unicode ; \
729e4ab9
A
1343 fi ; \
1344 done ); \
2ca993e8
A
1345 if test ! "$(RC_XBS)" = "YES"; then \
1346 echo "# Not building for XBS, so running minimal test"; \
1347 $(CC) $(SRCROOT)/minimalapisTest.c $(INSTALLHDRS_ARCH) $(ISYSROOT) -nostdinc \
1348 -I $(DSTROOT)/$(HDR_PREFIX)/include/ -I $(SDKPATH)/usr/include/ -E > /dev/null ; \
1349 fi; \
57a6839d 1350 fi; \
2ca993e8
A
1351 if test ! -d $(DSTROOT)/$(CLDRFILESDIR)/; then \
1352 $(INSTALL) -d -m 0755 $(DSTROOT)/$(CLDRFILESDIR)/; \
729e4ab9 1353 fi; \
2ca993e8 1354 $(INSTALL) -b -m 0644 $(SRCROOT)/cldrFiles/supplementalData.xml $(DSTROOT)/$(CLDRFILESDIR)/supplementalData.xml; \
729e4ab9 1355 fi; \
73c04bcf 1356 );
374ca955 1357
2ca993e8
A
1358# We run configure and run make first. This generates the .o files. We then link them
1359# all up together into libicucore. Then we put it into its install location, create
1360# symbolic links, and then strip the main dylib. Then install the remaining libraries.
b75a7d8f 1361# We cleanup the sources folder.
73c04bcf 1362
46f4442e 1363install : installhdrsint icu
73c04bcf 1364 if test "$(WINDOWS)" = "YES"; then \
2ca993e8
A
1365 if test ! -d $(DSTROOT)/$(winprogdir)/; then \
1366 $(INSTALL) -d -m 0755 $(DSTROOT)/$(winprogdir)/; \
51004dcb 1367 fi; \
2ca993e8
A
1368 if test ! -d $(DSTROOT)/$(winintlibdir)/; then \
1369 $(INSTALL) -d -m 0755 $(DSTROOT)/$(winintlibdir)/; \
51004dcb 1370 fi; \
2ca993e8
A
1371 $(INSTALL) -b -m 0644 $(OBJROOT_CURRENT)/lib/libicuuc.lib $(DSTROOT)/$(winintlibdir)libicuuc.lib; \
1372 $(INSTALL) -b -m 0644 $(OBJROOT_CURRENT)/lib/libicuuc.pdb $(DSTROOT)/$(winprogdir)libicuuc.pdb; \
1373 $(INSTALL) -b -m 0755 $(OBJROOT_CURRENT)/lib/libicuuc.dll $(DSTROOT)/$(winprogdir)libicuuc.dll; \
1374 $(INSTALL) -b -m 0644 $(OBJROOT_CURRENT)/lib/libicuin.lib $(DSTROOT)/$(winintlibdir)libicuin.lib; \
1375 $(INSTALL) -b -m 0644 $(OBJROOT_CURRENT)/lib/libicuin.pdb $(DSTROOT)/$(winprogdir)libicuin.pdb; \
1376 $(INSTALL) -b -m 0755 $(OBJROOT_CURRENT)/lib/libicuin.dll $(DSTROOT)/$(winprogdir)libicuin.dll; \
1377 $(INSTALL) -b -m 0755 $(OBJROOT_CURRENT)/lib/icudt$(ICU_VERS).dll $(DSTROOT)/$(winprogdir)icudt$(ICU_VERS).dll; \
51004dcb 1378 if test "$(ARCH64)" != "YES"; then \
2ca993e8
A
1379 $(INSTALL) -b -m 0644 $(OBJROOT_CURRENT)/lib/shim/icuuc.lib $(DSTROOT)/$(winintlibdir)icuuc.lib; \
1380 $(INSTALL) -b -m 0644 $(OBJROOT_CURRENT)/lib/icuuc40.pdb $(DSTROOT)/$(winprogdir)icuuc40.pdb; \
1381 $(INSTALL) -b -m 0755 $(OBJROOT_CURRENT)/lib/icuuc40.dll $(DSTROOT)/$(winprogdir)icuuc40.dll; \
1382 $(INSTALL) -b -m 0644 $(OBJROOT_CURRENT)/lib/shim/icuin.lib $(DSTROOT)/$(winintlibdir)icuin.lib; \
1383 $(INSTALL) -b -m 0644 $(OBJROOT_CURRENT)/lib/icuin40.pdb $(DSTROOT)/$(winprogdir)icuin40.pdb; \
1384 $(INSTALL) -b -m 0755 $(OBJROOT_CURRENT)/lib/icuin40.dll $(DSTROOT)/$(winprogdir)icuin40.dll; \
73c04bcf 1385 fi; \
73c04bcf 1386 else \
2ca993e8
A
1387 if test ! -d $(DSTROOT)/$(libdir)/; then \
1388 $(INSTALL) -d -m 0755 $(DSTROOT)/$(libdir)/; \
51004dcb 1389 fi; \
2ca993e8 1390 $(INSTALL) -b -m 0755 $(OBJROOT_CURRENT)/$(INSTALLED_DYLIB) $(DSTROOT)/$(libdir)$(INSTALLED_DYLIB); \
729e4ab9 1391 if test "$(LINUX)" = "YES"; then \
51004dcb 1392 cp $(OBJROOT_CURRENT)/$(INSTALLED_DYLIB) $(SYMROOT_CURRENT)/$(INSTALLED_DYLIB); \
2ca993e8 1393 strip -x -S $(DSTROOT)/$(libdir)$(INSTALLED_DYLIB); \
729e4ab9 1394 else \
2ca993e8 1395 (cd $(DSTROOT)/$(libdir); \
729e4ab9 1396 ln -fs $(INSTALLED_DYLIB) $(DYLIB)); \
51004dcb 1397 cp $(OBJROOT_CURRENT)/$(INSTALLED_DYLIB) $(SYMROOT_CURRENT)/$(INSTALLED_DYLIB); \
2ca993e8
A
1398 $(DSYMTOOL) -o $(SYMROOT_CURRENT)/$(INSTALLED_DYLIB)$(DSYMSUFFIX) $(SYMROOT_CURRENT)/$(INSTALLED_DYLIB); \
1399 $(STRIPCMD) -x -u -r -S $(DSTROOT)/$(libdir)$(INSTALLED_DYLIB); \
51004dcb 1400 fi; \
73c04bcf 1401 for subdir in $(EXTRA_LIBS); do \
2ca993e8 1402 (cd $(OBJROOT_CURRENT)/$$subdir; $(MAKE) -e DESTDIR=$(DSTROOT)/ $(ENV) install-library;) \
73c04bcf 1403 done; \
2ca993e8
A
1404 if test ! -d $(DSTROOT)/$(DATA_INSTALL_DIR)/; then \
1405 $(INSTALL) -d -m 0755 $(DSTROOT)/$(DATA_INSTALL_DIR)/; \
51004dcb
A
1406 fi; \
1407 if test -f $(OBJROOT_CURRENT)/$(L_DATA_FILE); then \
2ca993e8
A
1408 $(INSTALL) -b -m 0644 $(OBJROOT_CURRENT)/$(L_DATA_FILE) $(DSTROOT)/$(DATA_INSTALL_DIR)$(L_DATA_FILE); \
1409 fi; \
1410 if test -f $(OBJROOT_CURRENT)/$(TZDATA_FORMAT_FILE); then \
1411 $(INSTALL) -b -m 0644 $(OBJROOT_CURRENT)/$(TZDATA_FORMAT_FILE) $(DSTROOT)/$(DATA_INSTALL_DIR)$(TZDATA_FORMAT_FILE); \
73c04bcf 1412 fi; \
2ca993e8
A
1413 if test ! -d $(DSTROOT)/$(OPEN_SOURCE_VERSIONS_DIR)/; then \
1414 $(INSTALL) -d -m 0755 $(DSTROOT)/$(OPEN_SOURCE_VERSIONS_DIR)/; \
73c04bcf 1415 fi; \
2ca993e8
A
1416 $(INSTALL) -b -m 0644 $(SRCROOT)/ICU.plist $(DSTROOT)/$(OPEN_SOURCE_VERSIONS_DIR)ICU.plist; \
1417 if test ! -d $(DSTROOT)/$(OPEN_SOURCE_LICENSES_DIR)/; then \
1418 $(INSTALL) -d -m 0755 $(DSTROOT)/$(OPEN_SOURCE_LICENSES_DIR)/; \
73c04bcf 1419 fi; \
2ca993e8
A
1420 $(INSTALL) -b -m 0644 $(SRCROOT)/LICENSE $(DSTROOT)/$(OPEN_SOURCE_LICENSES_DIR)ICU.txt; \
1421 if test "$(LINUX)" != "YES"; then \
1422 if test ! -d $(DSTROOT)/$(localtooldir)/; then \
1423 $(INSTALL) -d -m 0755 $(DSTROOT)/$(localtooldir)/; \
51004dcb 1424 fi; \
2ca993e8
A
1425 if test -f $(OBJROOT_CURRENT)/$(INFOTOOL); then \
1426 echo '# install' $(INFOTOOL) 'to' $(DSTROOT)/$(localtooldir)$(INFOTOOL) ; \
1427 $(INSTALL) -b -m 0755 $(OBJROOT_CURRENT)/$(INFOTOOL) $(DSTROOT)/$(localtooldir)$(INFOTOOL); \
57a6839d 1428 cp $(OBJROOT_CURRENT)/$(INFOTOOL) $(SYMROOT_CURRENT)/$(INFOTOOL); \
2ca993e8
A
1429 $(DSYMTOOL) -o $(SYMROOT_CURRENT)/$(INFOTOOL)$(DSYMSUFFIX) $(SYMROOT_CURRENT)/$(INFOTOOL); \
1430 fi; \
1431 if test ! -d $(DSTROOT)/$(locallibdir)/; then \
1432 $(INSTALL) -d -m 0755 $(DSTROOT)/$(locallibdir)/; \
1433 fi; \
1434 if test -f $(OBJROOT_CURRENT)/$(TOOLS_DYLIB); then \
1435 echo '# install' $(TOOLS_DYLIB) 'to' $(DSTROOT)/$(locallibdir)$(TOOLS_DYLIB) ; \
1436 $(INSTALL) -b -m 0755 $(OBJROOT_CURRENT)/$(TOOLS_DYLIB) $(DSTROOT)/$(locallibdir)$(TOOLS_DYLIB); \
1437 cp $(OBJROOT_CURRENT)/$(TOOLS_DYLIB) $(SYMROOT_CURRENT)/$(TOOLS_DYLIB); \
1438 $(DSYMTOOL) -o $(SYMROOT_CURRENT)/$(TOOLS_DYLIB)$(DSYMSUFFIX) $(SYMROOT_CURRENT)/$(TOOLS_DYLIB); \
1439 fi; \
1440 if test -f $(OBJROOT_CURRENT)/$(ICUZDUMPTOOL); then \
1441 echo '# install' $(ICUZDUMPTOOL) 'to' $(DSTROOT)/$(localtooldir)$(ICUZDUMPTOOL) ; \
1442 $(INSTALL) -b -m 0755 $(OBJROOT_CURRENT)/$(ICUZDUMPTOOL) $(DSTROOT)/$(localtooldir)$(ICUZDUMPTOOL); \
1443 cp $(OBJROOT_CURRENT)/$(ICUZDUMPTOOL) $(SYMROOT_CURRENT)/$(ICUZDUMPTOOL); \
1444 $(DSYMTOOL) -o $(SYMROOT_CURRENT)/$(ICUZDUMPTOOL)$(DSYMSUFFIX) $(SYMROOT_CURRENT)/$(ICUZDUMPTOOL); \
57a6839d 1445 fi; \
729e4ab9 1446 fi; \
b75a7d8f 1447 fi;
73c04bcf
A
1448
1449DEPEND_install_debug = debug
1450DEPEND_install_profile = profile
2ca993e8 1451
73c04bcf
A
1452.SECONDEXPANSION:
1453install_debug install_profile : $$(DEPEND_$$@)
73c04bcf 1454 if test "$(WINDOWS)" = "YES"; then \
2ca993e8
A
1455 if test ! -d $(DSTROOT)/$(winprogdir)/; then \
1456 $(INSTALL) -d -m 0755 $(DSTROOT)/$(winprogdir)/; \
73c04bcf 1457 fi; \
2ca993e8
A
1458 if test ! -d $(DSTROOT)/$(winintlibdir)/; then \
1459 $(INSTALL) -d -m 0755 $(DSTROOT)/$(winintlibdir)/; \
51004dcb 1460 fi; \
2ca993e8
A
1461 $(INSTALL) -b -m 0644 $(OBJROOT_CURRENT)/lib/libicuuc_$(DEPEND_$@).lib $(DSTROOT)/$(winintlibdir)libicuuc_$(DEPEND_$@).lib; \
1462 $(INSTALL) -b -m 0644 $(OBJROOT_CURRENT)/lib/libicuuc_$(DEPEND_$@).pdb $(DSTROOT)/$(winprogdir)libicuuc_$(DEPEND_$@).pdb; \
1463 $(INSTALL) -b -m 0755 $(OBJROOT_CURRENT)/lib/libicuuc_$(DEPEND_$@).dll $(DSTROOT)/$(winprogdir)libicuuc_$(DEPEND_$@).dll; \
1464 $(INSTALL) -b -m 0644 $(OBJROOT_CURRENT)/lib/libicuin_$(DEPEND_$@).lib $(DSTROOT)/$(winintlibdir)libicuin_$(DEPEND_$@).lib; \
1465 $(INSTALL) -b -m 0644 $(OBJROOT_CURRENT)/lib/libicuin_$(DEPEND_$@).pdb $(DSTROOT)/$(winprogdir)libicuin_$(DEPEND_$@).pdb; \
1466 $(INSTALL) -b -m 0755 $(OBJROOT_CURRENT)/lib/libicuin_$(DEPEND_$@).dll $(DSTROOT)/$(winprogdir)libicuin_$(DEPEND_$@).dll; \
73c04bcf 1467 else \
2ca993e8
A
1468 if test ! -d $(DSTROOT)/$(libdir)/; then \
1469 $(INSTALL) -d -m 0755 $(DSTROOT)/$(libdir)/; \
51004dcb 1470 fi; \
2ca993e8 1471 $(INSTALL) -b -m 0664 $(OBJROOT_CURRENT)/$($(INSTALLED_DYLIB_$(DEPEND_$@))) $(DSTROOT)/$(libdir)$($(INSTALLED_DYLIB_$(DEPEND_$@))); \
729e4ab9 1472 if test "$(LINUX)" = "YES"; then \
51004dcb 1473 cp $(OBJROOT_CURRENT)/$($(INSTALLED_DYLIB_$(DEPEND_$@))) $(SYMROOT_CURRENT)/$($(INSTALLED_DYLIB_$(DEPEND_$@))); \
2ca993e8 1474 strip -x -S $(DSTROOT)/$(libdir)$($(INSTALLED_DYLIB_$(DEPEND_$@))); \
729e4ab9 1475 else \
2ca993e8 1476 (cd $(DSTROOT)/$(libdir); \
729e4ab9 1477 ln -fs $($(INSTALLED_DYLIB_$(DEPEND_$@))) $($(DYLIB_$(DEPEND_$@)))); \
51004dcb 1478 cp $(OBJROOT_CURRENT)/$($(INSTALLED_DYLIB_$(DEPEND_$@))) $(SYMROOT_CURRENT)/$($(INSTALLED_DYLIB_$(DEPEND_$@))); \
2ca993e8 1479 $(STRIPCMD) -x -u -r -S $(DSTROOT)/$(libdir)$($(INSTALLED_DYLIB_$(DEPEND_$@))); \
51004dcb 1480 fi; \
73c04bcf 1481 for subdir in $(EXTRA_LIBS); do \
2ca993e8 1482 (cd $(OBJROOT_CURRENT)/$$subdir; $(MAKE) -e DESTDIR=$(DSTROOT)/ $(ENV) install-library;) \
73c04bcf 1483 done; \
b75a7d8f 1484 fi;
b75a7d8f 1485
374ca955
A
1486clean :
1487 -rm -rf $(OBJROOT)
73c04bcf 1488
2ca993e8
A
1489# For the install-icutztoolsforsdk target, SDKROOT will always be an OSX SDK root
1490install-icutztoolsforsdk : icutztoolsforsdk
1491 if test ! -d $(DSTROOT)$(localtooldir)/; then \
1492 $(INSTALL) -d -m 0755 $(DSTROOT)$(localtooldir)/; \
1493 fi;
1494 if test ! -d $(DSTROOT)$(locallibdir)/; then \
1495 $(INSTALL) -d -m 0755 $(DSTROOT)$(locallibdir)/; \
1496 fi;
a62d09fc
A
1497 if test -f $(OBJROOT_CURRENT)/$(TOOLS_DYLIB_FORTOOLS); then \
1498 echo '# install' $(TOOLS_DYLIB_FORTOOLS) 'to' $(DSTROOT)$(locallibdir)$(TOOLS_DYLIB_FORTOOLS) ; \
1499 $(INSTALL) -b -m 0755 $(OBJROOT_CURRENT)/$(TOOLS_DYLIB_FORTOOLS) $(DSTROOT)$(locallibdir)$(TOOLS_DYLIB_FORTOOLS); \
2ca993e8
A
1500 fi;
1501 if test -f $(OBJROOT_CURRENT)/$(ZICTOOL); then \
1502 echo '# install' $(ZICTOOL) 'to' $(DSTROOT)$(localtooldir)$(ZICTOOL) ; \
1503 $(INSTALL) -b -m 0755 $(OBJROOT_CURRENT)/$(ZICTOOL) $(DSTROOT)$(localtooldir)$(ZICTOOL); \
1504 fi;
1505 if test -f $(OBJROOT_CURRENT)/$(RESTOOL); then \
1506 echo '# install' $(RESTOOL) 'to' $(DSTROOT)$(localtooldir)$(RESTOOL) ; \
1507 $(INSTALL) -b -m 0755 $(OBJROOT_CURRENT)/$(RESTOOL) $(DSTROOT)$(localtooldir)$(RESTOOL); \
1508 fi;
1509 if test -f $(OBJROOT_CURRENT)/$(PKGTOOL); then \
1510 echo '# install' $(PKGTOOL) 'to' $(DSTROOT)$(localtooldir)$(PKGTOOL) ; \
1511 $(INSTALL) -b -m 0755 $(OBJROOT_CURRENT)/$(PKGTOOL) $(DSTROOT)$(localtooldir)$(PKGTOOL); \
1512 fi;
1513 if test -f $(OBJROOT_CURRENT)/$(TZ2ICUTOOL); then \
1514 echo '# install' $(TZ2ICUTOOL) 'to' $(DSTROOT)$(localtooldir)$(TZ2ICUTOOL) ; \
1515 $(INSTALL) -b -m 0755 $(OBJROOT_CURRENT)/$(TZ2ICUTOOL) $(DSTROOT)$(localtooldir)$(TZ2ICUTOOL); \
1516 fi;
a62d09fc
A
1517 if test -f $(OBJROOT_CURRENT)/$(GENBRKTOOL); then \
1518 echo '# install' $(GENBRKTOOL) 'to' $(DSTROOT)$(localtooldir)$(GENBRKTOOL) ; \
1519 $(INSTALL) -b -m 0755 $(OBJROOT_CURRENT)/$(GENBRKTOOL) $(DSTROOT)$(localtooldir)$(GENBRKTOOL); \
1520 fi;