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