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