]> git.saurik.com Git - apple/icu.git/blame - makefile
ICU-511.25.tar.gz
[apple/icu.git] / makefile
CommitLineData
b75a7d8f 1##
46f4442e 2# Wrapper makefile for ICU
51004dcb 3# Copyright (C) 2003-2013 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
A
8#################################
9# Notes on building for AAS using Windows (7) + Visual Studio (2010) + Cygwin:
10#
11# Either this should be run indirectly from the VS command prompt via the
12# BuildICUForAAS script or project, using the instructions there (which build
13# both 32-bit and 64-bit), or it should be run from within Cygwin using the
14# following instructions or equivalent (different steps for 32-bit or 64-bit):
15#
16# 1. From VS command prompt, run vcvarsall.bat to set various environment variables.
17# For a 32-bit build:
18# > "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86
19# For a 64-bit build:
20# > "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" amd64
21#
22# 2. Launch Cygwin, e.g.
23# > C:\cygwin\Cygwin.bat
24#
25# 3. Within cygwin, cd to the top level of the ICU sources directory, e.g.
26# $ cd ICU
27#
28# 4. Adjust the PATH to put the appropriate VC tools directory first:
29# For a 32-bit build:
30# $ export PATH="/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin/":$PATH
31# For a 64-bit build:
32# $ export PATH="/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin/amd64/":$PATH
33#
34# 5. Run the ICU makefile
35# For a 32-bit build:
36# make [install] WINDOWS=YES [ARCH64=NO] [DSTROOT=...]
37# For a 64-bit build:
38# make [install] WINDOWS=YES ARCH64=YES [DSTROOT=...]
39#
40#################################
b75a7d8f
A
41
42#################################
43#################################
44# MAKE VARS
45#################################
46#################################
47
48# ':=' denotes a "simply expanded" variable. It's value is
49# set at the time of definition and it never recursively expands
50# when used. This is in contrast to using '=' which denotes a
51# recursively expanded variable.
52
b75a7d8f 53# Sane defaults, which are typically overridden on the command line.
73c04bcf 54WINDOWS=NO
729e4ab9
A
55LINUX=NO
56ARCH64=NO
57
51004dcb
A
58# chicken and egg problem: we can't use cygpath until PATH & SHELL are set,
59# but we have to convert VS100VCTOOLS_PATH in order to set PATH. So instead we
60# convert using subst.
61ifeq "$(WINDOWS)" "YES"
62 ifneq "$(VS100VCTOOLS_PATH)" ""
63 VS100VCTOOLS_CYGPATH:= /cygdrive/$(subst :/,/,$(subst \,/,$(VS100VCTOOLS_PATH)))
64 PATH:=$(VS100VCTOOLS_CYGPATH):/usr/local/bin/:/usr/bin/:$(PATH)
65 endif
66endif
67$(info # PATH=$(PATH))
68
69# For some reason, cygwin bash (at least when run non-login) needs to use
70# bash for pwd, echo etc. (but uname does not work, see below)
71ifeq "$(WINDOWS)" "YES"
72 SHELL := /bin/bash
73else
74 SHELL := /bin/sh
75endif
76
77# if building for windows from batch script, convert Win-style paths
78# for SRCROOT etc. to cygwin-style paths. Don't define them if not
79# already defined.
80ifeq "$(WINDOWS)" "YES"
81 ifneq "$(VS100VCTOOLS_PATH)" ""
82 ifdef SRCROOT
83 SRCROOT:=$(shell /bin/cygpath -ua $(subst \,/,$(SRCROOT)))
84 endif
85 ifdef OBJROOT
86 OBJROOT:=$(shell /bin/cygpath -ua $(subst \,/,$(OBJROOT)))
87 endif
88 ifdef DSTROOT
89 DSTROOT:=$(shell /bin/cygpath -ua $(subst \,/,$(DSTROOT)))
90 endif
91 ifdef SYMROOT
92 SYMROOT:=$(shell /bin/cygpath -ua $(subst \,/,$(SYMROOT)))
93 endif
94 endif
95endif
96
97ifndef SRCROOT
98 SRCROOT:=$(shell pwd)
99endif
100ifndef OBJROOT
101 OBJROOT:=$(SRCROOT)/build
102endif
103ifndef DSTROOT
104 DSTROOT:=$(OBJROOT)
105endif
106ifndef SYMROOT
107 SYMROOT:=$(OBJROOT)
108endif
109
110ifeq "$(WINDOWS)" "YES"
111 ifeq "$(ARCH64)" "YES"
112 OBJROOT_CURRENT=$(OBJROOT)/obj64
113 SYMROOT_CURRENT=$(SYMROOT)/obj64
114 else
115 OBJROOT_CURRENT=$(OBJROOT)/obj32
116 SYMROOT_CURRENT=$(SYMROOT)/obj32
117 endif
118else ifeq "$(LINUX)" "YES"
119 ifeq "$(ARCH64)" "YES"
120 OBJROOT_CURRENT=$(OBJROOT)/obj64
121 SYMROOT_CURRENT=$(SYMROOT)/obj64
122 else
123 OBJROOT_CURRENT=$(OBJROOT)/obj32
124 SYMROOT_CURRENT=$(SYMROOT)/obj32
125 endif
126else
127 OBJROOT_CURRENT=$(OBJROOT)
128 SYMROOT_CURRENT=$(SYMROOT)
129endif
729e4ab9 130CROSSHOST_OBJROOT=$(OBJROOT)/crossbuildhost
b75a7d8f
A
131APPLE_INTERNAL_DIR=/AppleInternal
132RC_ARCHS=
51004dcb 133MAC_OS_X_VERSION_MIN_REQUIRED=1070
4388f060 134OSX_HOST_VERSION_MIN_STRING=10.7
51004dcb
A
135IOS_VERSION_TARGET_STRING=7.0
136OSX_VERSION_TARGET_STRING=10.9
729e4ab9 137
51004dcb
A
138$(info # SRCROOT=$(SRCROOT))
139$(info # DSTROOT=$(DSTROOT))
140$(info # OBJROOT=$(OBJROOT))
141
142# For some reason, under cygwin, bash uname is not found, and
143# sh uname does not produce a result with -p or -m. So we just
144# hardcode here.
145ifeq "$(WINDOWS)" "YES"
146 UNAME_PROCESSOR:=i386
147else
148 UNAME_PROCESSOR:=$(shell uname -p)
149endif
150ifeq "$(SDKROOT)" "/"
151 SDKROOTMOD=
152else
153 SDKROOTMOD=$(SDKROOT)
154endif
729e4ab9 155ifneq "$(RC_ARCHS)" ""
51004dcb 156 ifneq "$(SDKROOTMOD)" ""
729e4ab9
A
157 CROSS_BUILD=YES
158 else ifeq "$(RC_INDIGO)" "YES"
159 CROSS_BUILD=YES
160 else
161 CROSS_BUILD=NO
162 endif
163 INSTALLHDRS_ARCH=-arch $(shell echo $(RC_ARCHS) | cut -d' ' -f1)
73c04bcf 164else
729e4ab9
A
165 CROSS_BUILD=NO
166 INSTALLHDRS_ARCH=
73c04bcf 167endif
729e4ab9
A
168$(info # RC_ARCHS=$(RC_ARCHS))
169$(info # INSTALLHDRS_ARCH=$(INSTALLHDRS_ARCH))
170$(info # buildhost=$(UNAME_PROCESSOR))
171
172# FORCEENDIAN below is to override silly configure behavior in which if
173# __APPLE_CC__ is defined and archs are in { ppc, ppc64, i386, x86_64 }
174# then it assumes a universal build (ac_cv_c_bigendian=universal) with
175# data file initially built big-endian.
176#
177ifeq "$(CROSS_BUILD)" "YES"
178 RC_ARCHS_FIRST=$(shell echo $(RC_ARCHS) | cut -d' ' -f1)
179 TARGET_SPEC=$(RC_ARCHS_FIRST)-apple-darwin10.0.0
51004dcb 180 ENV_CONFIGURE_ARCHS=-arch $(RC_ARCHS_FIRST)
729e4ab9
A
181 ICUPKGTOOLIBS="$(CROSSHOST_OBJROOT)/lib:$(CROSSHOST_OBJROOT)/stubdata"
182 ICUPKGTOOL=$(CROSSHOST_OBJROOT)/bin/icupkg
183 ifeq "$(filter-out i386 x86_64,$(RC_ARCHS))" ""
184 FORCEENDIAN= ac_cv_c_bigendian=no
185 else
186 FORCEENDIAN=
187 endif
188else ifeq "$(LINUX)" "YES"
189 TARGET_SPEC=$(UNAME_PROCESSOR)-unknown-linux-gnu
190 ENV_CONFIGURE_ARCHS=
51004dcb
A
191 ICUPKGTOOLIBS="$(OBJROOT_CURRENT)/lib:$(OBJROOT_CURRENT)/stubdata"
192 ICUPKGTOOL=$(OBJROOT_CURRENT)/bin/icupkg
729e4ab9 193 FORCEENDIAN=
46f4442e 194else
729e4ab9
A
195 TARGET_SPEC=$(UNAME_PROCESSOR)-apple-darwin10.0.0
196 ENV_CONFIGURE_ARCHS=
51004dcb
A
197 ICUPKGTOOLIBS="$(OBJROOT_CURRENT)/lib:$(OBJROOT_CURRENT)/stubdata"
198 ICUPKGTOOL=$(OBJROOT_CURRENT)/bin/icupkg
729e4ab9 199 FORCEENDIAN=
46f4442e 200endif
729e4ab9
A
201$(info # TARGET_SPEC=$(TARGET_SPEC))
202$(info # ENV_CONFIGURE_ARCHS=$(ENV_CONFIGURE_ARCHS))
46f4442e
A
203
204ifeq "$(RC_INDIGO)" "YES"
4388f060 205 -include $(DEVELOPER_DIR)/AppleInternal/Makefiles/Makefile.indigo
46f4442e 206 ifndef SDKROOT
51004dcb 207 SDKROOTMOD=$(INDIGO_PREFIX)
46f4442e
A
208 endif
209 DEST_ROOT=$(DSTROOT)/$(INDIGO_PREFIX)/
73c04bcf 210else
51004dcb 211 DEST_ROOT=$(DSTROOT)/
46f4442e 212endif
51004dcb 213$(info # SDKROOTMOD=$(SDKROOTMOD))
729e4ab9
A
214$(info # RC_INDIGO=$(RC_INDIGO))
215$(info # CROSS_BUILD=$(CROSS_BUILD))
4388f060 216$(info # DEST_ROOT=$(DEST_ROOT))
46f4442e 217
4388f060 218ICU_TARGET_VERSION_FOR_TZ_EXTRA :=
51004dcb 219ifeq "$(filter arm armv6 armv7 armv7s arm64,$(RC_ARCHS))" ""
729e4ab9 220 THUMB_FLAG =
51004dcb 221 ifneq "$(SDKROOTMOD)" ""
4388f060 222 ICU_TARGET_VERSION_FOR_TZ_EXTRA := -mmacosx-version-min=$(OSX_HOST_VERSION_MIN_STRING)
46f4442e
A
223 endif
224else
729e4ab9
A
225 THUMB_FLAG = -mthumb
226endif
227
51004dcb
A
228# even for a crossbuild host build, we want to use the target's latest tzdata as pointed to by latest_tzdata.tar.gz
229export TZDATA:=$(SDKROOTMOD)/usr/local/share/tz/$(shell readlink $(SDKROOTMOD)/usr/local/share/tz/latest_tzdata.tar.gz)
729e4ab9
A
230$(info # TZDATA=$(TZDATA))
231
232ifeq "$(WINDOWS)" "YES"
233 EMBEDDED:=0
234else ifeq "$(LINUX)" "YES"
235 CC := gcc
236 CXX := g++
46f4442e 237 EMBEDDED:=0
729e4ab9 238 ISYSROOT =
729e4ab9 239else
51004dcb
A
240 ifeq "$(SDKROOTMOD)" ""
241 HOSTCC := $(shell xcrun -find cc)
242 HOSTCXX := $(shell xcrun -find c++)
243 ifneq (,$(findstring XcodeDefault,$(HOSTCC)))
244 HOSTSDK := $(shell xcodebuild -version -sdk macosx Path)
245 else
246 HOSTSDK := $(shell xcodebuild -version -sdk macosx.internal Path)
247 endif
248 ISYSROOT:= -isysroot $(HOSTSDK)
249 CC := $(HOSTCC)
250 CXX := $(HOSTCXX)
251 NM := $(shell xcrun -find nm)
252 STRIPCMD := $(shell xcrun -find strip)
253 else
254 HOSTCC := $(shell xcrun -sdk macosx -find cc)
255 HOSTCXX := $(shell xcrun -sdk macosx -find c++)
256 HOSTSDK := $(shell xcodebuild -version -sdk macosx Path)
257 ISYSROOT:= -isysroot $(SDKROOTMOD)
258 CC := $(shell xcrun -sdk $(SDKROOTMOD) -find cc)
259 CXX := $(shell xcrun -sdk $(SDKROOTMOD) -find c++)
260 NM := $(shell xcrun -sdk $(SDKROOTMOD) -find nm)
261 STRIPCMD := $(shell xcrun -sdk $(SDKROOTMOD) -find strip)
262 endif
263 HOSTISYSROOT = -isysroot $(HOSTSDK)
264 EMBEDDED:=$(shell $(CXX) -E -dM -x c $(ISYSROOT) -include TargetConditionals.h /dev/null | fgrep TARGET_OS_EMBEDDED | cut -d' ' -f3)
46f4442e 265endif
51004dcb
A
266DSYMTOOL := /usr/bin/dsymutil
267DSYMSUFFIX := .dSYM
268
269$(info # HOSTCC=$(HOSTCC))
270$(info # HOSTCXX=$(HOSTCXX))
271$(info # HOSTISYSROOT=$(HOSTISYSROOT))
4388f060
A
272$(info # CC=$(CC))
273$(info # CXX=$(CXX))
51004dcb 274$(info # ISYSROOT=$(ISYSROOT))
46f4442e
A
275
276ifeq "$(EMBEDDED)" "1"
277 export APPLE_EMBEDDED=YES
729e4ab9 278 DISABLE_DRAFT=YES
46f4442e
A
279else ifeq "$(RC_INDIGO)" "YES"
280 export APPLE_EMBEDDED=YES
729e4ab9 281 DISABLE_DRAFT=YES
46f4442e
A
282else
283 export APPLE_EMBEDDED=NO
729e4ab9
A
284 DISABLE_DRAFT=NO
285endif
286
4388f060
A
287ifeq "$(APPLE_EMBEDDED)" "YES"
288 ICU_TARGET_VERSION := -miphoneos-version-min=$(IOS_VERSION_TARGET_STRING)
289else
290 ICU_TARGET_VERSION :=
291endif
292$(info # ICU_TARGET_VERSION=$(ICU_TARGET_VERSION))
293
729e4ab9
A
294ifeq "$(DISABLE_DRAFT)" "YES"
295 DRAFT_FLAG=--disable-draft
296else
297 DRAFT_FLAG=
73c04bcf
A
298endif
299
300ifndef RC_ProjectSourceVersion
301ifdef RC_PROJECTSOURCEVERSION
302 RC_ProjectSourceVersion=$(RC_PROJECTSOURCEVERSION)
303endif
304endif
305
729e4ab9
A
306# An Apple submission version (passed in RC_ProjectSourceVersion for official builds) is
307# X[.Y[.Z]]
308# where X is in range 0-214747, Y and Z are in range 0-99 (with no leading zeros).
309# The value for the SourceVersion property in version.plists will be calculated as
310# (X*10000 + Y*100 + Z). So we want U_ICU_VERSION_BUILDLEVEL_NUM to be Y*100 + Z
73c04bcf
A
311ifneq "$(RC_ProjectSourceVersion)" ""
312 ifeq "$(WINDOWS)" "YES"
729e4ab9
A
313 ICU_BUILD_Y := $(shell echo $(RC_ProjectSourceVersion) | sed -r -e 's/([0-9]+)(\.([0-9]{1,2})(\.([0-9])([0-9])?)?)?/\3/')
314 ICU_BUILD_Z1 := $(shell echo $(RC_ProjectSourceVersion) | sed -r -e 's/([0-9]+)(\.([0-9]{1,2})(\.([0-9])([0-9])?)?)?/\5/')
315 ICU_BUILD_Z2 := $(shell echo $(RC_ProjectSourceVersion) | sed -r -e 's/([0-9]+)(\.([0-9]{1,2})(\.([0-9])([0-9])?)?)?/\6/')
73c04bcf 316 else
729e4ab9
A
317 ICU_BUILD_Y := $(shell echo $(RC_ProjectSourceVersion) | sed -E -e 's/([0-9]+)(\.([0-9]{1,2})(\.([0-9])([0-9])?)?)?/\3/')
318 ICU_BUILD_Z1 := $(shell echo $(RC_ProjectSourceVersion) | sed -E -e 's/([0-9]+)(\.([0-9]{1,2})(\.([0-9])([0-9])?)?)?/\5/')
319 ICU_BUILD_Z2 := $(shell echo $(RC_ProjectSourceVersion) | sed -E -e 's/([0-9]+)(\.([0-9]{1,2})(\.([0-9])([0-9])?)?)?/\6/')
320 endif
321 ifeq "$(ICU_BUILD_Y)" ""
322 ICU_BUILD := 0
323 else
324 ICU_BUILD := $(subst a,$(ICU_BUILD_Y),abc)
325 ifeq "$(ICU_BUILD_Z1)" ""
326 ICU_BUILD := $(subst b,0,$(ICU_BUILD))
327 ICU_BUILD := $(subst c,0,$(ICU_BUILD))
328 else
329 ifeq "$(ICU_BUILD_Z2)" ""
330 ICU_BUILD := $(subst b,0,$(ICU_BUILD))
331 ICU_BUILD := $(subst c,$(ICU_BUILD_Z1),$(ICU_BUILD))
332 else
333 ICU_BUILD := $(subst b,$(ICU_BUILD_Z1),$(ICU_BUILD))
334 ICU_BUILD := $(subst c,$(ICU_BUILD_Z2),$(ICU_BUILD))
335 endif
336 endif
73c04bcf
A
337 endif
338else
339 ICU_BUILD := 0
340endif
729e4ab9 341$(info # ICU_BUILD=$(ICU_BUILD))
51004dcb
A
342ifeq "$(ICU_BUILD)" "0"
343 DEFINE_BUILD_LEVEL =
344else
345 DEFINE_BUILD_LEVEL =-DU_ICU_VERSION_BUILDLEVEL_NUM=$(ICU_BUILD)
346endif
b75a7d8f 347
374ca955
A
348# Disallow $(SRCROOT) == $(OBJROOT)
349ifeq ($(OBJROOT), $(SRCROOT))
350$(error SRCROOT same as OBJROOT)
351endif
b75a7d8f 352
729e4ab9
A
353# Disallow cross builds on Windows/Linux for now
354# (since those builds are not out-of-source as required for cross-builds)
355ifeq "$(CROSS_BUILD)" "YES"
356ifeq "$(WINDOWS)" "YES"
357$(error Cross-builds currently not allowed on Windows)
358endif
359ifeq "$(LINUX)" "YES"
360$(error Cross-builds currently not allowed on Linux)
361endif
362endif
363
b75a7d8f
A
364#################################
365# Headers
366#################################
367
368# For installhdrs. Not every compiled module has an associated header. Normally,
369# ICU installs headers as a sub-targe of the install target. But since we only want
370# certain libraries to install (and since we link all of our own .o modules), we need
371# invoke the headers targets ourselves. This may be problematic because there isn't a
372# good way to dist-clean afterwards...we need to do explicit dist-cleans, especially if
373# install the extra libraries.
374
375EXTRA_HDRS =
376# EXTRA_HDRS = ./extra/ustdio/ ./layout/
46f4442e 377ifeq "$(APPLE_EMBEDDED)" "YES"
73c04bcf
A
378 HDR_MAKE_SUBDIR = ./common/ ./i18n/ $(EXTRA_HDRS)
379else ifeq "$(WINDOWS)" "YES"
380 HDR_MAKE_SUBDIR = ./common/ ./i18n/ $(EXTRA_HDRS)
381else
382 HDR_MAKE_SUBDIR = ./common/ ./i18n/ ./io/ $(EXTRA_HDRS)
383endif
384ifeq "$(WINDOWS)" "YES"
73c04bcf 385 PRIVATE_HDR_PREFIX=$(APPLE_INTERNAL_DIR)
729e4ab9 386else ifeq "$(APPLE_EMBEDDED)" "YES"
73c04bcf
A
387 HDR_PREFIX=/usr
388 PRIVATE_HDR_PREFIX=/usr/local
729e4ab9
A
389else
390 PRIVATE_HDR_PREFIX=/usr/local
73c04bcf 391endif
b75a7d8f
A
392
393#################################
394# Install
395#################################
396
397# For install. We currently don't install EXTRA_LIBS. We also don't install the data
398# directly into the ICU library. It is now installed at /usr/share/icu/*.dat. Thus we
399# don't use DATA_OBJ anymore. This could change if we decide to move the data back into
400# the icucore monolithic library.
401
402INSTALL = /usr/bin/install
403COMMON_OBJ = ./common/*.o
404I18N_OBJ = ./i18n/*.o
73c04bcf 405IO_OBJ = ./io/*.o
b75a7d8f
A
406STUB_DATA_OBJ = ./stubdata/*.o
407EXTRA_LIBS =
408#EXTRA_LIBS =./extra/ ./layout/ ./tools/ctestfw/ ./tools/toolutil/
409#DATA_OBJ = ./data/out/build/*.o
46f4442e 410ifeq "$(APPLE_EMBEDDED)" "YES"
73c04bcf
A
411 DYLIB_OBJS=$(COMMON_OBJ) $(I18N_OBJ) $(STUB_DATA_OBJ)
412else ifeq "$(WINDOWS)" "YES"
413 DYLIB_OBJS=$(COMMON_OBJ) ./common/common.res $(I18N_OBJ) $(STUB_DATA_OBJ)
414else
415 DYLIB_OBJS=$(COMMON_OBJ) $(I18N_OBJ) $(IO_OBJ) $(STUB_DATA_OBJ)
416endif
b75a7d8f 417
46f4442e
A
418#################################
419# Sources
420#################################
421
422# For installsrc (B&I)
423# Note that installsrc is run on the system from which ICU is submitted, which
424# may be a different environment than the one for a which a build is targeted.
425
729e4ab9 426INSTALLSRC_VARFILES=./ICU_embedded.order ./minimalapis.txt ./minimalapisTest.c ./minimalpatchconfig.txt ./windowspatchconfig.txt ./patchconfig.txt ./crosshostpatchconfig.txt
46f4442e 427
b75a7d8f
A
428#################################
429# Cleaning
430#################################
431
432#We need to clean after installing.
433
434EXTRA_CLEAN =
435
436# Some directories aren't cleaned recursively. Clean them manually...
437MANUAL_CLEAN_TOOLS = ./tools/dumpce
438MANUAL_CLEAN_EXTRA = ./extra/scrptrun ./samples/layout ./extra/ustdio ./extra
439MANUAL_CLEAN_TEST = ./test/collperf ./test/iotest ./test/letest ./test/thaitest ./test/threadtest ./test/testmap ./test
440MANUAL_CLEAN_SAMPLE = ./samples/layout ./samples
441
73c04bcf 442CLEAN_SUBDIR = ./stubdata ./common ./i18n ./io ./layout ./layoutex ./data ./tools ./$(MANUAL_CLEAN_TOOLS) $(MANUAL_CLEAN_EXTRA) $(MANUAL_CLEAN_TEST) $(MANUAL_CLEAN_SAMPLE)
b75a7d8f
A
443
444#################################
445# Config flags
446#################################
447
729e4ab9 448ifeq "$(WINDOWS)" "YES"
51004dcb
A
449 ifeq "$(ARCH64)" "YES"
450 CONFIG_FLAGS = --disable-renaming --disable-extras --disable-layout --disable-samples --disable-icuio \
451 --with-data-packaging=library --prefix=$(PRIVATE_HDR_PREFIX) --with-library-bits=64 \
452 $(DRAFT_FLAG)
453 else
454 CONFIG_FLAGS = --disable-renaming --disable-extras --disable-layout --disable-samples --disable-icuio \
455 --with-data-packaging=library --prefix=$(PRIVATE_HDR_PREFIX) --with-library-bits=32 \
456 $(DRAFT_FLAG)
457 endif
729e4ab9
A
458else ifeq "$(LINUX)" "YES"
459 ifeq "$(ARCH64)" "YES"
460 CONFIG_FLAGS = --disable-renaming --disable-extras --disable-layout --disable-samples \
461 --with-data-packaging=archive --prefix=$(PRIVATE_HDR_PREFIX) --with-library-bits=64 \
462 $(DRAFT_FLAG)
463 else
464 CONFIG_FLAGS = --disable-renaming --disable-extras --disable-layout --disable-samples \
465 --with-data-packaging=archive --prefix=$(PRIVATE_HDR_PREFIX) --with-library-bits=32 \
466 $(DRAFT_FLAG)
467 endif
468else ifeq "$(APPLE_EMBEDDED)" "YES"
469 CONFIG_FLAGS = --disable-renaming --disable-extras --disable-layout --disable-samples --disable-icuio \
470 --with-data-packaging=archive --prefix=$(PRIVATE_HDR_PREFIX) \
4388f060 471 $(DRAFT_FLAG)
73c04bcf 472else
729e4ab9
A
473 CONFIG_FLAGS = --disable-renaming --disable-extras --disable-layout --disable-samples \
474 --with-data-packaging=archive --prefix=$(PRIVATE_HDR_PREFIX) \
4388f060 475 $(DRAFT_FLAG)
73c04bcf 476endif
b75a7d8f
A
477
478#################################
479# Install paths
480#################################
481
482# This may or may not be an appropriate name for the icu dylib. This naming scheme is
483# an attempt to follow the icu convention in naming the dylib and then having symbolic
484# links of easier to remember library names point it it. *UPDATE* the version and
485# sub-version variables as needed. The Core version should be 'A' until the core
486# version changes it's API...that is a new version isn't backwards compatible.
487# The ICU version/subversion should reflect the actual ICU version.
488
374ca955 489LIB_NAME = icucore
51004dcb 490ICU_VERS = 51
729e4ab9 491ICU_SUBVERS = 1
b75a7d8f 492CORE_VERS = A
b75a7d8f 493
73c04bcf
A
494ifeq "$(WINDOWS)" "YES"
495 DYLIB_SUFF = dll
51004dcb
A
496 ifeq "$(ARCH64)" "YES"
497 winprogdir = /Program\ Files/Common\ Files/Apple/Apple\ Application\ Support/
498 winintlibdir = /AppleInternal/lib64/
499 else
500 winprogdir = /Program\ Files\ \(x86\)/Common\ Files/Apple/Apple\ Application\ Support/
501 winintlibdir = /AppleInternal/lib32/
502 endif
503 libdir =
729e4ab9
A
504else ifeq "$(LINUX)" "YES"
505 DYLIB_SUFF = so
506 ifeq "$(ARCH64)" "YES"
507 libdir = /usr/lib64/
508 else
509 libdir = /usr/lib/
510 endif
51004dcb
A
511 winprogdir =
512 winintlibdir =
73c04bcf
A
513else
514 DYLIB_SUFF = dylib
515 libdir = /usr/lib/
51004dcb
A
516 winprogdir =
517 winintlibdir =
73c04bcf
A
518endif
519
374ca955 520DYLIB = lib$(LIB_NAME).$(DYLIB_SUFF)
73c04bcf
A
521DYLIB_DEBUG = lib$(LIB_NAME)_debug.$(DYLIB_SUFF)
522DYLIB_PROFILE = lib$(LIB_NAME)_profile.$(DYLIB_SUFF)
523ifeq "$(WINDOWS)" "YES"
524 INSTALLED_DYLIB = $(LIB_NAME).$(DYLIB_SUFF)
525 INSTALLED_DYLIB_DEBUG = $(LIB_NAME)_debug.$(DYLIB_SUFF)
526 INSTALLED_DYLIB_PROFILE = $(LIB_NAME)_profile.$(DYLIB_SUFF)
729e4ab9
A
527else ifeq "$(LINUX)" "YES"
528 INSTALLED_DYLIB = lib$(LIB_NAME).$(DYLIB_SUFF)
529 INSTALLED_DYLIB_DEBUG = lib$(LIB_NAME)_debug.$(DYLIB_SUFF)
530 INSTALLED_DYLIB_PROFILE = lib$(LIB_NAME)_profile.$(DYLIB_SUFF)
73c04bcf
A
531else
532 INSTALLED_DYLIB = lib$(LIB_NAME).$(CORE_VERS).$(DYLIB_SUFF)
533 INSTALLED_DYLIB_DEBUG = lib$(LIB_NAME).$(CORE_VERS)_debug.$(DYLIB_SUFF)
534 INSTALLED_DYLIB_PROFILE = lib$(LIB_NAME).$(CORE_VERS)_profile.$(DYLIB_SUFF)
535endif
536
537INSTALLED_DYLIB_icu = INSTALLED_DYLIB
538INSTALLED_DYLIB_debug = INSTALLED_DYLIB_DEBUG
539INSTALLED_DYLIB_profile = INSTALLED_DYLIB_PROFILE
540DYLIB_icu = DYLIB
541DYLIB_debug = DYLIB_DEBUG
542DYLIB_profile = DYLIB_PROFILE
b75a7d8f
A
543
544#################################
545# Data files
546#################################
547
374ca955
A
548OPEN_SOURCE_VERSIONS_DIR=/usr/local/OpenSourceVersions/
549OPEN_SOURCE_LICENSES_DIR=/usr/local/OpenSourceLicenses/
51004dcb 550
b75a7d8f
A
551B_DATA_FILE=icudt$(ICU_VERS)b.dat
552L_DATA_FILE=icudt$(ICU_VERS)l.dat
51004dcb
A
553DATA_BUILD_SUBDIR= data/out
554DATA_INSTALL_DIR=/usr/share/icu/
555# DATA_LOOKUP_DIR is what the target ICU_DATA_DIR gets set to in CFLAGS, CXXFLAGS;
556# DATA_LOOKUP_DIR_BUILDHOST is what any crossbuild host ICU_DATA_DIR gets set to.
557ifneq "$(APPLE_EMBEDDED)" "YES"
558 DATA_LOOKUP_DIR=/usr/share/icu/
559else
560 ifeq "$(RC_INDIGO)" "YES"
561 DATA_LOOKUP_DIR=/usr/share/icu/
562 else
563 DATA_LOOKUP_DIR=/var/db/icu/
564 endif
565endif
566DATA_LOOKUP_DIR_BUILDHOST=/usr/share/icu/
567
568# Name of runtime environment variable to get the prefix path for DATA_LOOKUP_DIR
569# Currently we are only using this for LINUX, should also use for iOS simulator
570ifeq "$(LINUX)" "YES"
571 DATA_DIR_PREFIX_ENV_VAR=APPLE_FRAMEWORKS_ROOT
572else
573 DATA_DIR_PREFIX_ENV_VAR=
574endif
b75a7d8f 575
729e4ab9
A
576#################################
577# Info tool
578#################################
579
580localtooldir=/usr/local/bin/
581
582INFOTOOL = icuinfo
583
584INFOTOOL_OBJS = ./tools/icuinfo/icuinfo.o ./tools/toolutil/udbgutil.o ./tools/toolutil/uoptions.o
585
374ca955
A
586#################################
587# Environment variables
588#################################
589
590# $(RC_ARCHS:%=-arch %) is a substitution reference. It denotes, in this case,
591# for every value <val> in RC_ARCHS, replace it with "-arch <val>". Substitution
592# references have the form $(var:a=b). We can insert the strip and prebinding commands
593# into CFLAGS (and CXXFLAGS). This controls a lot of the external variables so we don't
594# need to directly modify the ICU files (like for CFLAGS, etc).
595
51004dcb
A
596LIBOVERRIDES=LIBICUDT="-L$(OBJROOT_CURRENT) -l$(LIB_NAME)" \
597 LIBICUUC="-L$(OBJROOT_CURRENT) -l$(LIB_NAME)" \
598 LIBICUI18N="-L$(OBJROOT_CURRENT) -l$(LIB_NAME)"
374ca955 599
46f4442e
A
600# For normal Windows builds set the ENV= options here; for debug Windows builds set the ENV_DEBUG=
601# options here and also the update the LINK.EXE lines in the TARGETS section below.
73c04bcf 602ifeq "$(WINDOWS)" "YES"
51004dcb
A
603 ifeq "$(ARCH64)" "YES"
604 ENV= CFLAGS="/O2 /Ob2 /MD /GF /GS /Zi /nologo /D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES" \
605 CXXFLAGS="/O2 /Ob2 /MD /GF /GS /Zi /nologo /D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES /EHsc /Zc:wchar_t" \
606 LDFLAGS="/NXCOMPAT /DYNAMICBASE /DEBUG /OPT:REF"
73c04bcf 607 else
51004dcb
A
608 ENV= CFLAGS="/O2 /Ob2 /MD /GF /GS /Zi /nologo /D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES" \
609 CXXFLAGS="/O2 /Ob2 /MD /GF /GS /Zi /nologo /D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES /EHsc /Zc:wchar_t" \
610 LDFLAGS="/NXCOMPAT /SAFESEH /DYNAMICBASE /DEBUG /OPT:REF"
73c04bcf 611 endif
51004dcb
A
612 ENV_CONFIGURE= CPPFLAGS="-DU_DISABLE_RENAMING=1 $(DEFINE_BUILD_LEVEL)" \
613 CFLAGS="/O2 /Ob2 /MD /GF /GS /nologo /D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES" \
614 CXXFLAGS="/O2 /Ob2 /MD /GF /GS /nologo /D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES /EHsc /Zc:wchar_t"
615 ENV_DEBUG= CFLAGS="/O2 /Ob2 /MDd /GF /GS /Zi /D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES" \
616 CXXFLAGS="/O2 /Ob2 /MDd /GF /GS /Zi /D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES /EHsc" \
617 LDFLAGS="/DEBUG /DYNAMICBASE"
73c04bcf 618 ENV_PROFILE=
729e4ab9 619else ifeq "$(LINUX)" "YES"
729e4ab9 620 ifeq "$(ARCH64)" "YES"
51004dcb
A
621 ENV_CONFIGURE= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
622 CPPFLAGS="-DU_DISABLE_RENAMING=1 $(DEFINE_BUILD_LEVEL)" \
729e4ab9
A
623 CC="$(CC)" \
624 CXX="$(CXX)" \
51004dcb
A
625 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" \
626 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 627 TZDATA="$(TZDATA)" \
51004dcb
A
628 DYLD_LIBRARY_PATH="$(DEST_ROOT)usr/local/lib64"
629
630 ENV= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
729e4ab9
A
631 CC="$(CC)" \
632 CXX="$(CXX)" \
51004dcb
A
633 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" \
634 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 635 TZDATA="$(TZDATA)" \
51004dcb
A
636 DYLD_LIBRARY_PATH="$(DEST_ROOT)usr/local/lib64"
637
638 ENV_DEBUG= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
729e4ab9
A
639 CC="$(CC)" \
640 CXX="$(CXX)" \
51004dcb
A
641 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" \
642 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 643 TZDATA="$(TZDATA)" \
51004dcb 644 DYLD_LIBRARY_PATH="$(DEST_ROOT)usr/local/lib64"
729e4ab9 645
51004dcb 646 ENV_PROFILE= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
729e4ab9
A
647 CC="$(CC)" \
648 CXX="$(CXX)" \
51004dcb
A
649 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" \
650 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 651 TZDATA="$(TZDATA)" \
51004dcb 652 DYLD_LIBRARY_PATH="$(DEST_ROOT)usr/local/lib64"
729e4ab9 653 else
51004dcb
A
654 ENV_CONFIGURE= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
655 CPPFLAGS="-DU_DISABLE_RENAMING=1 $(DEFINE_BUILD_LEVEL)" \
729e4ab9
A
656 CC="$(CC)" \
657 CXX="$(CXX)" \
51004dcb
A
658 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" \
659 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 660 TZDATA="$(TZDATA)" \
51004dcb 661 DYLD_LIBRARY_PATH="$(DEST_ROOT)usr/local/lib"
729e4ab9 662
51004dcb 663 ENV= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
729e4ab9
A
664 CC="$(CC)" \
665 CXX="$(CXX)" \
51004dcb
A
666 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" \
667 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 668 TZDATA="$(TZDATA)" \
51004dcb 669 DYLD_LIBRARY_PATH="$(DEST_ROOT)usr/local/lib"
729e4ab9 670
51004dcb 671 ENV_DEBUG= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
729e4ab9
A
672 CC="$(CC)" \
673 CXX="$(CXX)" \
51004dcb
A
674 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" \
675 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 676 TZDATA="$(TZDATA)" \
51004dcb 677 DYLD_LIBRARY_PATH="$(DEST_ROOT)usr/local/lib"
729e4ab9 678
51004dcb 679 ENV_PROFILE= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
729e4ab9
A
680 CC="$(CC)" \
681 CXX="$(CXX)" \
51004dcb
A
682 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" \
683 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 684 TZDATA="$(TZDATA)" \
51004dcb 685 DYLD_LIBRARY_PATH="$(DEST_ROOT)usr/local/lib"
729e4ab9 686 endif
73c04bcf 687else
51004dcb
A
688 CPPOPTIONS =
689 ENV_CONFIGURE= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
690 CPPFLAGS="$(DEFINE_BUILD_LEVEL) -DSTD_INSPIRED -DMAC_OS_X_VERSION_MIN_REQUIRED=$(MAC_OS_X_VERSION_MIN_REQUIRED) $(ISYSROOT) $(ENV_CONFIGURE_ARCHS)" \
729e4ab9
A
691 CC="$(CC)" \
692 CXX="$(CXX)" \
51004dcb
A
693 CFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" $(ENV_CONFIGURE_ARCHS) $(ICU_TARGET_VERSION) -g -Os -Wglobal-constructors -fno-exceptions -fvisibility=hidden $(ISYSROOT) $(THUMB_FLAG)" \
694 CXXFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" $(ENV_CONFIGURE_ARCHS) $(ICU_TARGET_VERSION) -g -Os -Wglobal-constructors -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden $(ISYSROOT) $(THUMB_FLAG)" \
729e4ab9
A
695 RC_ARCHS="$(RC_ARCHS)" $(FORCEENDIAN)\
696 TZDATA="$(TZDATA)" \
51004dcb 697 DYLD_LIBRARY_PATH="$(DEST_ROOT)usr/local/lib"
729e4ab9 698
51004dcb 699 ENV= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
729e4ab9
A
700 CC="$(CC)" \
701 CXX="$(CXX)" \
51004dcb
A
702 CFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" $(RC_ARCHS:%=-arch %) $(ICU_TARGET_VERSION) -g -Os -Wglobal-constructors -fno-exceptions -fvisibility=hidden $(ISYSROOT) $(THUMB_FLAG)" \
703 CXXFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" $(RC_ARCHS:%=-arch %) $(ICU_TARGET_VERSION) -g -Os -Wglobal-constructors -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden $(ISYSROOT) $(THUMB_FLAG)" \
73c04bcf
A
704 RC_ARCHS="$(RC_ARCHS)" \
705 TZDATA="$(TZDATA)" \
51004dcb 706 DYLD_LIBRARY_PATH="$(DEST_ROOT)usr/local/lib"
73c04bcf 707
51004dcb 708 ENV_DEBUG= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
729e4ab9
A
709 CC="$(CC)" \
710 CXX="$(CXX)" \
51004dcb
A
711 CFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" $(RC_ARCHS:%=-arch %) $(ICU_TARGET_VERSION) -O0 -gfull -Wglobal-constructors -fno-exceptions -fvisibility=hidden $(ISYSROOT) $(THUMB_FLAG)" \
712 CXXFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" $(RC_ARCHS:%=-arch %) $(ICU_TARGET_VERSION) -O0 -gfull -Wglobal-constructors -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden $(ISYSROOT) $(THUMB_FLAG)" \
73c04bcf
A
713 RC_ARCHS="$(RC_ARCHS)" \
714 TZDATA="$(TZDATA)" \
51004dcb 715 DYLD_LIBRARY_PATH="$(DEST_ROOT)usr/local/lib"
73c04bcf 716
51004dcb 717 ENV_PROFILE= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
729e4ab9
A
718 CC="$(CC)" \
719 CXX="$(CXX)" \
51004dcb
A
720 CFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" $(RC_ARCHS:%=-arch %) $(ICU_TARGET_VERSION) -g -Os -pg -Wglobal-constructors -fno-exceptions -fvisibility=hidden $(ISYSROOT) $(THUMB_FLAG)" \
721 CXXFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -DICU_DATA_DIR=\"\\\"$(DATA_LOOKUP_DIR)\\\"\" $(RC_ARCHS:%=-arch %) $(ICU_TARGET_VERSION) -g -Os -pg -Wglobal-constructors -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden $(ISYSROOT) $(THUMB_FLAG)" \
73c04bcf
A
722 RC_ARCHS="$(RC_ARCHS)" \
723 TZDATA="$(TZDATA)" \
51004dcb
A
724 DYLD_LIBRARY_PATH="$(DEST_ROOT)usr/local/lib"
725
726 ENV_CONFIGURE_BUILDHOST= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
727 CPPFLAGS="$(DEFINE_BUILD_LEVEL) -DSTD_INSPIRED -DMAC_OS_X_VERSION_MIN_REQUIRED=$(MAC_OS_X_VERSION_MIN_REQUIRED) $(HOSTISYSROOT)" \
728 CC="$(HOSTCC)" \
729 CXX="$(HOSTCXX)" \
730 CFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -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" \
731 CXXFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -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 732 TZDATA="$(TZDATA)" \
51004dcb 733 DYLD_LIBRARY_PATH="$(DEST_ROOT)usr/local/lib"
73c04bcf 734
51004dcb
A
735 ENV_BUILDHOST= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
736 CC="$(HOSTCC)" \
737 CXX="$(HOSTCXX)" \
738 CFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -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" \
739 CXXFLAGS="-DU_SHOW_CPLUSPLUS_API=1 -DU_SHOW_INTERNAL_API=1 -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 740 TZDATA="$(TZDATA)" \
51004dcb 741 DYLD_LIBRARY_PATH="$(DEST_ROOT)usr/local/lib"
729e4ab9 742
73c04bcf 743endif
374ca955 744
374ca955
A
745ENV_icu = ENV
746ENV_debug = ENV_DEBUG
73c04bcf 747ENV_profile = ENV_PROFILE
374ca955 748
46f4442e
A
749ifeq "$(APPLE_EMBEDDED)" "YES"
750 ORDERFILE=$(SRCROOT)/ICU_embedded.order
751else
752 ORDERFILE=/usr/local/lib/OrderFiles/libicucore.order
753endif
374ca955
A
754ifeq "$(shell test -f $(ORDERFILE) && echo YES )" "YES"
755 SECTORDER_FLAGS=-sectorder __TEXT __text $(ORDERFILE)
756else
757 SECTORDER_FLAGS=
758endif
759
760
b75a7d8f
A
761#################################
762#################################
763# TARGETS
764#################################
765#################################
374ca955 766
729e4ab9 767.PHONY : icu check installsrc installhdrs installhdrsint clean install debug debug-install crossbuildhost
374ca955
A
768.DELETE_ON_ERROR :
769
51004dcb
A
770icu debug profile : $(OBJROOT_CURRENT)/Makefile
771 echo "# make for target";
772 (cd $(OBJROOT_CURRENT); \
374ca955 773 $(MAKE) $($(ENV_$@)); \
73c04bcf 774 if test "$(WINDOWS)" = "YES"; then \
729e4ab9
A
775 (cd common; \
776 rc.exe /folibicuuc.res $(CPPFLAGS) -DU_RELEASE=1 -D_CRT_SECURE_NO_DEPRECATE -I. -I../i18n \
777 "-DDEFAULT_ICU_PLUGINS=\"/AppleInternal/lib/icu\" " -DU_LOCAL_SERVICE_HOOK=1 libicuuc.rc; \
778 ); \
779 (cd i18n; \
780 rc.exe /folibicuin.res $(CPPFLAGS) -DU_RELEASE=1 -D_CRT_SECURE_NO_DEPRECATE -I. -I../common libicuin.rc; \
781 ); \
73c04bcf
A
782 if test "$@" = "debug"; then \
783 (cd common; \
729e4ab9
A
784 LINK.EXE /subsystem:console /DLL /nologo /base:"0x4a800000" /DYNAMICBASE /DEBUG \
785 /IMPLIB:../lib/libicuuc_$@.lib /out:../lib/libicuuc_$@.dll \
786 *.o libicuuc.res ../stubdata/icudt.lib advapi32.lib; \
787 ); \
73c04bcf 788 (cd i18n; \
729e4ab9
A
789 LINK.EXE /subsystem:console /DLL /nologo /base:"0x4a900000" /DYNAMICBASE /DEBUG \
790 /IMPLIB:../lib/libicuin_$@.lib /out:../lib/libicuin_$@.dll \
791 *.o libicuin.res ../lib/libicuuc_$@.lib ../stubdata/icudt.lib advapi32.lib; \
792 ); \
793 else \
729e4ab9 794 (cd common; \
729e4ab9 795 rm -f ../lib/libicuuc.dll.manifest; \
51004dcb
A
796 if test "$(ARCH64)" = "YES"; then \
797 LINK.EXE /DLL /NXCOMPAT /DYNAMICBASE /DEBUG /OPT:REF /MANIFEST \
798 /IMPLIB:../lib/libicuuc.lib /out:../lib/libicuuc.dll \
799 *.o libicuuc.res ../stubdata/icudt.lib advapi32.lib; \
800 else \
801 LINK.EXE /DLL /NXCOMPAT /SAFESEH /DYNAMICBASE /DEBUG /OPT:REF /MANIFEST \
802 /IMPLIB:../lib/libicuuc.lib /out:../lib/libicuuc.dll \
803 *.o libicuuc.res ../stubdata/icudt.lib advapi32.lib; \
804 fi; \
729e4ab9 805 mt.exe -nologo -manifest ../lib/libicuuc.dll.manifest -outputresource:"../lib/libicuuc.dll;2"; \
729e4ab9
A
806 ); \
807 (cd i18n; \
729e4ab9 808 rm -f ../lib/libicuin.dll.manifest; \
51004dcb
A
809 if test "$(ARCH64)" = "YES"; then \
810 LINK.EXE /DLL /NXCOMPAT /DYNAMICBASE /DEBUG /OPT:REF /MANIFEST \
811 /IMPLIB:../lib/libicuin.lib /out:../lib/libicuin.dll \
812 *.o libicuin.res ../lib/libicuuc.lib ../stubdata/icudt.lib advapi32.lib; \
813 else \
814 LINK.EXE /DLL /NXCOMPAT /SAFESEH /DYNAMICBASE /DEBUG /OPT:REF /MANIFEST \
815 /IMPLIB:../lib/libicuin.lib /out:../lib/libicuin.dll \
816 *.o libicuin.res ../lib/libicuuc.lib ../stubdata/icudt.lib advapi32.lib; \
817 fi; \
729e4ab9 818 mt.exe -nologo -manifest ../lib/libicuin.dll.manifest -outputresource:"../lib/libicuin.dll;2"; \
729e4ab9 819 ); \
51004dcb
A
820 if test "$(ARCH64)" != "YES"; then \
821 mkdir -p lib/shim; \
822 (cd common; \
823 rm -f icuuc40shim.o; \
824 rm -f ../lib/icuuc40.dll.manifest; \
825 cl -DU_DISABLE_RENAMING=1 -DU_ICU_VERSION_BUILDLEVEL_NUM=$(ICU_BUILD) \
826 -DU_RELEASE=1 -D_CRT_SECURE_NO_DEPRECATE -I. -I../i18n \
827 -DU_LOCAL_SERVICE_HOOK=1 -DWIN32 -DU_COMMON_IMPLEMENTATION \
828 /O2 /Ob2 /MD /GF /GS /Zi /nologo /D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES /EHsc /Zc:wchar_t \
829 /c /Foicuuc40shim.o icuuc40shim.cpp; \
830 rc.exe /foicuuc40shim.res $(CPPFLAGS) -DU_RELEASE=1 -D_CRT_SECURE_NO_DEPRECATE -I. -I../i18n \
831 "-DDEFAULT_ICU_PLUGINS=\"/AppleInternal/lib/icu\" " -DU_LOCAL_SERVICE_HOOK=1 icuuc40shim.rc; \
832 LINK.EXE /DLL /NXCOMPAT /SAFESEH /DYNAMICBASE /DEBUG /OPT:REF /MANIFEST \
833 /IMPLIB:../lib/shim/icuuc.lib /out:../lib/icuuc40.dll \
834 icuuc40shim.o icuuc40shim.res ../lib/libicuuc.lib ../stubdata/icudt.lib advapi32.lib; \
835 mt.exe -nologo -manifest ../lib/icuuc40.dll.manifest -outputresource:"../lib/icuuc40.dll;2"; \
836 ); \
837 (cd i18n; \
838 rm -f icuin40shim.o; \
839 rm -f ../lib/icuin40.dll.manifest; \
840 cl -DU_DISABLE_RENAMING=1 -DU_ICU_VERSION_BUILDLEVEL_NUM=$(ICU_BUILD) \
841 -DU_RELEASE=1 -D_CRT_SECURE_NO_DEPRECATE -I. -I../common \
842 -DU_LOCAL_SERVICE_HOOK=1 -DWIN32 -DU_I18N_IMPLEMENTATION \
843 /O2 /Ob2 /MD /GF /GS /Zi /nologo /D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES /EHsc /Zc:wchar_t \
844 /c /Foicuin40shim.o icuin40shim.cpp; \
845 rc.exe /foicuin40shim.res $(CPPFLAGS) -DU_RELEASE=1 -D_CRT_SECURE_NO_DEPRECATE -I. -I../common \
846 "-DDEFAULT_ICU_PLUGINS=\"/AppleInternal/lib/icu\" " -DU_LOCAL_SERVICE_HOOK=1 icuin40shim.rc; \
847 LINK.EXE /DLL /NXCOMPAT /SAFESEH /DYNAMICBASE /DEBUG /OPT:REF /MANIFEST \
848 /IMPLIB:../lib/shim/icuin.lib /out:../lib/icuin40.dll \
849 icuin40shim.o icuin40shim.res ../lib/libicuin.lib ../stubdata/icudt.lib advapi32.lib; \
850 mt.exe -nologo -manifest ../lib/icuin40.dll.manifest -outputresource:"../lib/icuin40.dll;2"; \
851 ); \
852 fi; \
73c04bcf 853 fi; \
374ca955 854 else \
729e4ab9
A
855 if test "$(LINUX)" = "YES"; then \
856 if test "$(ARCH64)" = "YES"; then \
857 $($(ENV_$@)) $(CXX) \
858 -m64 -g -Os -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden \
859 $(CXXFLAGS) $(LDFLAGS) -shared -Wl,-Bsymbolic -Wl,-soname,$($(INSTALLED_DYLIB_$@)) -Wl,-L/usr/lib64/ -ldl \
860 -o ./$($(INSTALLED_DYLIB_$@)) $(DYLIB_OBJS); \
861 else \
862 $($(ENV_$@)) $(CXX) \
863 -m32 -g -Os -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden \
864 $(CXXFLAGS) $(LDFLAGS) -shared -Wl,-Bsymbolic -Wl,-soname,$($(INSTALLED_DYLIB_$@)) -ldl \
865 -o ./$($(INSTALLED_DYLIB_$@)) $(DYLIB_OBJS); \
866 fi; \
867 else \
868 tmpfile=`mktemp -t weakexternal.XXXXXX` || exit 1; \
4388f060 869 $(NM) -m $(RC_ARCHS:%=-arch %) $(DYLIB_OBJS) | fgrep "weak external" | fgrep -v "undefined" | sed -e 's/.*weak external[^_]*//' | sort | uniq | cat >$$tmpfile; \
729e4ab9 870 $($(ENV_$@)) $(CXX) -current_version $(ICU_VERS).$(ICU_SUBVERS) -compatibility_version 1 -dynamiclib -dynamic \
4388f060 871 $(RC_ARCHS:%=-arch %) $(ICU_TARGET_VERSION) -g -Os -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden $(ISYSROOT) $(THUMB_FLAG) \
729e4ab9
A
872 $(CXXFLAGS) $(LDFLAGS) -single_module $(SECTORDER_FLAGS) -unexported_symbols_list $$tmpfile -dead_strip \
873 -install_name $(libdir)$($(INSTALLED_DYLIB_$@)) -o ./$($(INSTALLED_DYLIB_$@)) $(DYLIB_OBJS); \
874 if test "$@" = "icu"; then \
875 ln -fs $(INSTALLED_DYLIB) $(DYLIB); \
876 $($(ENV_$@)) $(CXX) $(RC_ARCHS:%=-arch %) -g -Os -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden $(ISYSROOT) $(THUMB_FLAG) \
877 $(LDFLAGS) -Wl,-S -Wl,-x -dead_strip -o ./$(INFOTOOL) $(INFOTOOL_OBJS) -L./ -l$(LIB_NAME) ; \
878 fi; \
879 fi; \
51004dcb
A
880 if test -f ./$(DATA_BUILD_SUBDIR)/$(B_DATA_FILE); then \
881 ln -fs ./$(DATA_BUILD_SUBDIR)/$(B_DATA_FILE); \
73c04bcf 882 fi; \
51004dcb
A
883 if test -f ./$(DATA_BUILD_SUBDIR)/$(L_DATA_FILE); then \
884 ln -fs ./$(DATA_BUILD_SUBDIR)/$(L_DATA_FILE); \
73c04bcf 885 else \
729e4ab9 886 DYLD_LIBRARY_PATH=$(ICUPKGTOOLIBS) \
51004dcb 887 $(ICUPKGTOOL) -tl ./$(DATA_BUILD_SUBDIR)/$(B_DATA_FILE) $(L_DATA_FILE); \
73c04bcf 888 fi; \
374ca955
A
889 fi; \
890 );
891
729e4ab9 892crossbuildhost : $(CROSSHOST_OBJROOT)/Makefile
51004dcb 893 echo "# make for crossbuild host";
729e4ab9
A
894 (cd $(CROSSHOST_OBJROOT); \
895 $(MAKE) $($(ENV_BUILDHOST)); \
896 );
897
374ca955 898check : icu
729e4ab9 899ifneq "$(CROSS_BUILD)" "YES"
51004dcb
A
900 (cd $(OBJROOT_CURRENT); \
901 ICU_DATA=$(OBJROOT_CURRENT) $(MAKE) $(ENV) check; \
73c04bcf 902 );
729e4ab9
A
903else
904 $(warning check not supported for cross-build)
905endif
73c04bcf
A
906
907check-debug: debug
729e4ab9 908ifneq "$(CROSS_BUILD)" "YES"
51004dcb
A
909 (cd $(OBJROOT_CURRENT); \
910 ICU_DATA=$(OBJROOT_CURRENT) $(MAKE) $(ENV_DEBUG) check; \
374ca955 911 );
729e4ab9
A
912else
913 $(warning check not supported for cross-build)
914endif
374ca955
A
915
916samples: icu
51004dcb 917 (cd $(OBJROOT_CURRENT)/samples; \
374ca955
A
918 $(MAKE) $(ENV_DEBUG) $(LIBOVERRIDES); \
919 );
920
921extra: icu
51004dcb 922 (cd $(OBJROOT_CURRENT)/extra; \
374ca955
A
923 $(MAKE) $(ENV_DEBUG) $(LIBOVERRIDES); \
924 );
925
729e4ab9 926ifneq "$(CROSS_BUILD)" "YES"
51004dcb 927$(OBJROOT_CURRENT)/Makefile :
729e4ab9 928else
51004dcb 929$(OBJROOT_CURRENT)/Makefile : crossbuildhost
729e4ab9 930endif
51004dcb
A
931 if test ! -d $(OBJROOT_CURRENT); then \
932 mkdir -p $(OBJROOT_CURRENT); \
374ca955 933 fi;
51004dcb 934 cp -Rpf $(SRCROOT)/icuSources/* $(OBJROOT_CURRENT)/;
73c04bcf 935 if test "$(WINDOWS)" = "YES"; then \
51004dcb
A
936 echo "# configure for target"; \
937 (cd $(OBJROOT_CURRENT)/data/unidata; mv base_unidata/*.txt .;); \
938 (cd $(OBJROOT_CURRENT)/data/unidata/norm2; mv base_norm2/*.txt .;); \
939 (cd $(OBJROOT_CURRENT)/data/in; mv base_in/*.nrm .; mv base_in/*.icu .;); \
940 (cd $(OBJROOT_CURRENT); $(ENV_CONFIGURE) ./runConfigureICU Cygwin/MSVC $(CONFIG_FLAGS);) \
729e4ab9 941 elif test "$(LINUX)" = "YES"; then \
51004dcb
A
942 echo "# configure for target"; \
943 (cd $(OBJROOT_CURRENT)/data/unidata; mv base_unidata/*.txt .;); \
944 (cd $(OBJROOT_CURRENT)/data/unidata/norm2; mv base_norm2/*.txt .;); \
945 (cd $(OBJROOT_CURRENT)/data/in; mv base_in/*.nrm .; mv base_in/*.icu .;); \
946 (cd $(OBJROOT_CURRENT); $(ENV_CONFIGURE) ./runConfigureICU Linux $(CONFIG_FLAGS);) \
729e4ab9 947 elif test "$(CROSS_BUILD)" = "YES"; then \
51004dcb
A
948 echo "# configure for crossbuild target"; \
949 (cd $(OBJROOT_CURRENT); $(ENV_CONFIGURE) ./configure --host=$(TARGET_SPEC) --with-cross-build=$(CROSSHOST_OBJROOT) $(CONFIG_FLAGS);) \
73c04bcf 950 else \
51004dcb
A
951 echo "# configure for non-crossbuild target"; \
952 (cd $(OBJROOT_CURRENT); $(ENV_CONFIGURE) ./runConfigureICU MacOSX $(CONFIG_FLAGS);) \
374ca955 953 fi;
46f4442e 954 if test "$(APPLE_EMBEDDED)" = "YES"; then \
51004dcb 955 (cd $(OBJROOT_CURRENT)/common/unicode/; patch <$(SRCROOT)/minimalpatchconfig.txt;) \
73c04bcf 956 elif test "$(WINDOWS)" = "YES"; then \
51004dcb 957 (cd $(OBJROOT_CURRENT)/common/unicode/; patch <$(SRCROOT)/windowspatchconfig.txt;) \
73c04bcf 958 else \
51004dcb 959 (cd $(OBJROOT_CURRENT)/common/unicode/; patch <$(SRCROOT)/patchconfig.txt;) \
73c04bcf 960 fi; \
729e4ab9
A
961
962# for the tools that build the data file, cannot set UDATA_DEFAULT_ACCESS = UDATA_ONLY_PACKAGES
963# as minimalpatchconfig.txt does; need different patches for the host build.
964$(CROSSHOST_OBJROOT)/Makefile :
965 if test ! -d $(CROSSHOST_OBJROOT); then \
966 mkdir -p $(CROSSHOST_OBJROOT); \
967 fi;
4388f060 968 cp -Rpf $(SRCROOT)/icuSources/* $(CROSSHOST_OBJROOT);
51004dcb 969 echo "# configure for crossbuild host";
4388f060
A
970 (cd $(CROSSHOST_OBJROOT); $(ENV_CONFIGURE_BUILDHOST) ./runConfigureICU MacOSX $(CONFIG_FLAGS);)
971 (cd $(CROSSHOST_OBJROOT)/common/unicode/; patch <$(SRCROOT)/crosshostpatchconfig.txt;)
374ca955
A
972
973#################################
974# B&I TARGETS
975#################################
976
b75a7d8f
A
977# Since our sources are in icuSources (ignore the ICU subdirectory for now), we wish to
978# copy them to somewhere else. We tar it to stdout, cd to the appropriate directory, and
979# untar from stdin. We then look for all the CVS directories and remove them. We may have
980# to remove the .cvsignore files also.
981
982installsrc :
983 if test ! -d $(SRCROOT); then mkdir $(SRCROOT); fi;
984 if test -d $(SRCROOT)/icuSources ; then rm -rf $(SRCROOT)/icuSources; fi;
46f4442e 985 tar cf - ./makefile ./ICU.plist ./license.html ./icuSources $(INSTALLSRC_VARFILES) | (cd $(SRCROOT) ; tar xfp -); \
b75a7d8f
A
986 for i in `find $(SRCROOT)/icuSources/ | grep "CVS$$"` ; do \
987 if test -d $$i ; then \
988 rm -rf $$i; \
989 fi; \
990 done
991 for j in `find $(SRCROOT)/icuSources/ | grep ".cvsignore"` ; do \
992 if test -f $$j ; then \
993 rm -f $$j; \
994 fi; \
995 done
996
46f4442e 997# This works. Just not for ~ in the DEST_ROOT. We run configure first (in case it hasn't
b75a7d8f
A
998# been already). Then we make the install-headers target on specific makefiles (since
999# not every subdirectory/sub-component has a install-headers target).
1000
46f4442e
A
1001# installhdrs should be no-op for RC_INDIGO
1002ifeq "$(RC_INDIGO)" "YES"
1003installhdrs :
1004else
1005installhdrs : installhdrsint
1006endif
1007
51004dcb
A
1008installhdrsint : $(OBJROOT_CURRENT)/Makefile
1009 (cd $(OBJROOT_CURRENT); \
73c04bcf 1010 for subdir in $(HDR_MAKE_SUBDIR); do \
46f4442e 1011 (cd $$subdir; $(MAKE) -e DESTDIR=$(DEST_ROOT) $(ENV) install-headers); \
73c04bcf 1012 done; \
729e4ab9
A
1013 if test "$(APPLE_EMBEDDED)" = "YES"; then \
1014 if test ! -d $(DEST_ROOT)$(HDR_PREFIX)/include/unicode/; then \
1015 $(INSTALL) -d -m 0755 $(DEST_ROOT)$(HDR_PREFIX)/include/unicode/; \
1016 fi; \
51004dcb 1017 if test -d $(DEST_ROOT)$(PRIVATE_HDR_PREFIX)/include/unicode/; then \
729e4ab9
A
1018 (cd $(DEST_ROOT)$(PRIVATE_HDR_PREFIX)/include/unicode; \
1019 for i in *.h; do \
1020 if fgrep -q -x $$i $(SRCROOT)/minimalapis.txt ; then \
1021 mv $$i $(DEST_ROOT)$(HDR_PREFIX)/include/unicode ; \
1022 fi ; \
1023 done ); \
1024 $(CC) $(SRCROOT)/minimalapisTest.c $(INSTALLHDRS_ARCH) $(ISYSROOT) -nostdinc \
51004dcb 1025 -I $(DEST_ROOT)$(HDR_PREFIX)/include/ -I $(SDKROOTMOD)/usr/include/ -E > /dev/null ; \
729e4ab9
A
1026 fi; \
1027 fi; \
73c04bcf 1028 );
374ca955 1029
b75a7d8f
A
1030# We run configure and run make first. This generates the .o files. We then link them
1031# all up together into libicucore. Then we put it into its install location, create
1032# symbolic links, and then strip the main dylib. Then install the remaining libraries.
1033# We cleanup the sources folder.
73c04bcf 1034
46f4442e 1035install : installhdrsint icu
73c04bcf 1036 if test "$(WINDOWS)" = "YES"; then \
51004dcb
A
1037 if test ! -d $(DEST_ROOT)$(winprogdir)/; then \
1038 $(INSTALL) -d -m 0755 $(DEST_ROOT)$(winprogdir)/; \
1039 fi; \
1040 if test ! -d $(DEST_ROOT)$(winintlibdir)/; then \
1041 $(INSTALL) -d -m 0755 $(DEST_ROOT)$(winintlibdir)/; \
1042 fi; \
1043 $(INSTALL) -b -m 0644 $(OBJROOT_CURRENT)/lib/libicuuc.lib $(DEST_ROOT)$(winintlibdir)libicuuc.lib; \
1044 $(INSTALL) -b -m 0644 $(OBJROOT_CURRENT)/lib/libicuuc.pdb $(DEST_ROOT)$(winprogdir)libicuuc.pdb; \
1045 $(INSTALL) -b -m 0755 $(OBJROOT_CURRENT)/lib/libicuuc.dll $(DEST_ROOT)$(winprogdir)libicuuc.dll; \
1046 $(INSTALL) -b -m 0644 $(OBJROOT_CURRENT)/lib/libicuin.lib $(DEST_ROOT)$(winintlibdir)libicuin.lib; \
1047 $(INSTALL) -b -m 0644 $(OBJROOT_CURRENT)/lib/libicuin.pdb $(DEST_ROOT)$(winprogdir)libicuin.pdb; \
1048 $(INSTALL) -b -m 0755 $(OBJROOT_CURRENT)/lib/libicuin.dll $(DEST_ROOT)$(winprogdir)libicuin.dll; \
1049 $(INSTALL) -b -m 0755 $(OBJROOT_CURRENT)/lib/icudt$(ICU_VERS).dll $(DEST_ROOT)$(winprogdir)icudt$(ICU_VERS).dll; \
1050 if test "$(ARCH64)" != "YES"; then \
1051 $(INSTALL) -b -m 0644 $(OBJROOT_CURRENT)/lib/shim/icuuc.lib $(DEST_ROOT)$(winintlibdir)icuuc.lib; \
1052 $(INSTALL) -b -m 0644 $(OBJROOT_CURRENT)/lib/icuuc40.pdb $(DEST_ROOT)$(winprogdir)icuuc40.pdb; \
1053 $(INSTALL) -b -m 0755 $(OBJROOT_CURRENT)/lib/icuuc40.dll $(DEST_ROOT)$(winprogdir)icuuc40.dll; \
1054 $(INSTALL) -b -m 0644 $(OBJROOT_CURRENT)/lib/shim/icuin.lib $(DEST_ROOT)$(winintlibdir)icuin.lib; \
1055 $(INSTALL) -b -m 0644 $(OBJROOT_CURRENT)/lib/icuin40.pdb $(DEST_ROOT)$(winprogdir)icuin40.pdb; \
1056 $(INSTALL) -b -m 0755 $(OBJROOT_CURRENT)/lib/icuin40.dll $(DEST_ROOT)$(winprogdir)icuin40.dll; \
73c04bcf 1057 fi; \
73c04bcf 1058 else \
51004dcb
A
1059 if test ! -d $(DEST_ROOT)$(libdir)/; then \
1060 $(INSTALL) -d -m 0755 $(DEST_ROOT)$(libdir)/; \
1061 fi; \
1062 $(INSTALL) -b -m 0755 $(OBJROOT_CURRENT)/$(INSTALLED_DYLIB) $(DEST_ROOT)$(libdir)$(INSTALLED_DYLIB); \
729e4ab9 1063 if test "$(LINUX)" = "YES"; then \
51004dcb 1064 cp $(OBJROOT_CURRENT)/$(INSTALLED_DYLIB) $(SYMROOT_CURRENT)/$(INSTALLED_DYLIB); \
729e4ab9
A
1065 strip -x -S $(DEST_ROOT)$(libdir)$(INSTALLED_DYLIB); \
1066 else \
1067 (cd $(DEST_ROOT)$(libdir); \
1068 ln -fs $(INSTALLED_DYLIB) $(DYLIB)); \
51004dcb
A
1069 cp $(OBJROOT_CURRENT)/$(INSTALLED_DYLIB) $(SYMROOT_CURRENT)/$(INSTALLED_DYLIB); \
1070 if test "$(APPLE_EMBEDDED)" = "NO"; then \
1071 $(DSYMTOOL) -o $(SYMROOT_CURRENT)/$(INSTALLED_DYLIB)$(DSYMSUFFIX) $(SYMROOT_CURRENT)/$(INSTALLED_DYLIB); \
1072 fi; \
4388f060 1073 $(STRIPCMD) -x -u -r -S $(DEST_ROOT)$(libdir)$(INSTALLED_DYLIB); \
51004dcb 1074 fi; \
73c04bcf 1075 for subdir in $(EXTRA_LIBS); do \
51004dcb 1076 (cd $(OBJROOT_CURRENT)/$$subdir; $(MAKE) -e DESTDIR=$(DEST_ROOT) $(ENV) install-library;) \
73c04bcf 1077 done; \
51004dcb
A
1078 if test ! -d $(DEST_ROOT)$(DATA_INSTALL_DIR)/; then \
1079 $(INSTALL) -d -m 0755 $(DEST_ROOT)$(DATA_INSTALL_DIR)/; \
1080 fi; \
1081 if test -f $(OBJROOT_CURRENT)/$(L_DATA_FILE); then \
1082 $(INSTALL) -b -m 0644 $(OBJROOT_CURRENT)/$(L_DATA_FILE) $(DEST_ROOT)$(DATA_INSTALL_DIR)$(L_DATA_FILE); \
73c04bcf 1083 fi; \
46f4442e
A
1084 if test ! -d $(DEST_ROOT)$(OPEN_SOURCE_VERSIONS_DIR)/; then \
1085 $(INSTALL) -d -m 0755 $(DEST_ROOT)$(OPEN_SOURCE_VERSIONS_DIR)/; \
73c04bcf 1086 fi; \
46f4442e
A
1087 $(INSTALL) -b -m 0644 $(SRCROOT)/ICU.plist $(DEST_ROOT)$(OPEN_SOURCE_VERSIONS_DIR)ICU.plist; \
1088 if test ! -d $(DEST_ROOT)$(OPEN_SOURCE_LICENSES_DIR)/; then \
1089 $(INSTALL) -d -m 0755 $(DEST_ROOT)$(OPEN_SOURCE_LICENSES_DIR)/; \
73c04bcf 1090 fi; \
46f4442e 1091 $(INSTALL) -b -m 0644 $(SRCROOT)/license.html $(DEST_ROOT)$(OPEN_SOURCE_LICENSES_DIR)ICU.html; \
51004dcb
A
1092 if test -f $(OBJROOT_CURRENT)/$(INFOTOOL); then \
1093 if test ! -d $(DEST_ROOT)$(localtooldir)/; then \
1094 $(INSTALL) -d -m 0755 $(DEST_ROOT)$(localtooldir)/; \
1095 fi; \
1096 $(INSTALL) -b -m 0755 $(OBJROOT_CURRENT)/$(INFOTOOL) $(DEST_ROOT)$(localtooldir)$(INFOTOOL); \
729e4ab9 1097 fi; \
b75a7d8f 1098 fi;
73c04bcf
A
1099
1100DEPEND_install_debug = debug
1101DEPEND_install_profile = profile
1102
1103.SECONDEXPANSION:
1104install_debug install_profile : $$(DEPEND_$$@)
73c04bcf 1105 if test "$(WINDOWS)" = "YES"; then \
51004dcb
A
1106 if test ! -d $(DEST_ROOT)$(winprogdir)/; then \
1107 $(INSTALL) -d -m 0755 $(DEST_ROOT)$(winprogdir)/; \
73c04bcf 1108 fi; \
51004dcb
A
1109 if test ! -d $(DEST_ROOT)$(winintlibdir)/; then \
1110 $(INSTALL) -d -m 0755 $(DEST_ROOT)$(winintlibdir)/; \
1111 fi; \
1112 $(INSTALL) -b -m 0644 $(OBJROOT_CURRENT)/lib/libicuuc_$(DEPEND_$@).lib $(DEST_ROOT)$(winintlibdir)libicuuc_$(DEPEND_$@).lib; \
1113 $(INSTALL) -b -m 0644 $(OBJROOT_CURRENT)/lib/libicuuc_$(DEPEND_$@).pdb $(DEST_ROOT)$(winprogdir)libicuuc_$(DEPEND_$@).pdb; \
1114 $(INSTALL) -b -m 0755 $(OBJROOT_CURRENT)/lib/libicuuc_$(DEPEND_$@).dll $(DEST_ROOT)$(winprogdir)libicuuc_$(DEPEND_$@).dll; \
1115 $(INSTALL) -b -m 0644 $(OBJROOT_CURRENT)/lib/libicuin_$(DEPEND_$@).lib $(DEST_ROOT)$(winintlibdir)libicuin_$(DEPEND_$@).lib; \
1116 $(INSTALL) -b -m 0644 $(OBJROOT_CURRENT)/lib/libicuin_$(DEPEND_$@).pdb $(DEST_ROOT)$(winprogdir)libicuin_$(DEPEND_$@).pdb; \
1117 $(INSTALL) -b -m 0755 $(OBJROOT_CURRENT)/lib/libicuin_$(DEPEND_$@).dll $(DEST_ROOT)$(winprogdir)libicuin_$(DEPEND_$@).dll; \
73c04bcf 1118 else \
51004dcb
A
1119 if test ! -d $(DEST_ROOT)$(libdir)/; then \
1120 $(INSTALL) -d -m 0755 $(DEST_ROOT)$(libdir)/; \
1121 fi; \
1122 $(INSTALL) -b -m 0664 $(OBJROOT_CURRENT)/$($(INSTALLED_DYLIB_$(DEPEND_$@))) $(DEST_ROOT)$(libdir)$($(INSTALLED_DYLIB_$(DEPEND_$@))); \
729e4ab9 1123 if test "$(LINUX)" = "YES"; then \
51004dcb 1124 cp $(OBJROOT_CURRENT)/$($(INSTALLED_DYLIB_$(DEPEND_$@))) $(SYMROOT_CURRENT)/$($(INSTALLED_DYLIB_$(DEPEND_$@))); \
729e4ab9
A
1125 strip -x -S $(DEST_ROOT)$(libdir)$($(INSTALLED_DYLIB_$(DEPEND_$@))); \
1126 else \
1127 (cd $(DEST_ROOT)$(libdir); \
1128 ln -fs $($(INSTALLED_DYLIB_$(DEPEND_$@))) $($(DYLIB_$(DEPEND_$@)))); \
51004dcb 1129 cp $(OBJROOT_CURRENT)/$($(INSTALLED_DYLIB_$(DEPEND_$@))) $(SYMROOT_CURRENT)/$($(INSTALLED_DYLIB_$(DEPEND_$@))); \
4388f060 1130 $(STRIPCMD) -x -u -r -S $(DEST_ROOT)$(libdir)$($(INSTALLED_DYLIB_$(DEPEND_$@))); \
51004dcb 1131 fi; \
73c04bcf 1132 for subdir in $(EXTRA_LIBS); do \
51004dcb 1133 (cd $(OBJROOT_CURRENT)/$$subdir; $(MAKE) -e DESTDIR=$(DEST_ROOT) $(ENV) install-library;) \
73c04bcf 1134 done; \
b75a7d8f 1135 fi;
b75a7d8f 1136
374ca955
A
1137clean :
1138 -rm -rf $(OBJROOT)
73c04bcf 1139