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