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