2 # Wrapper makefile for ICU
3 # Copyright (C) 2003-2010 Apple Inc. All rights reserved.
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.
10 #################################
11 #################################
13 #################################
14 #################################
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.
23 # Sane defaults, which are typically overridden on the command line.
29 OBJROOT=$(SRCROOT)/build
32 CROSSHOST_OBJROOT=$(OBJROOT)/crossbuildhost
33 APPLE_INTERNAL_DIR=/AppleInternal
35 MAC_OS_X_VERSION_MIN_REQUIRED=1060
36 MAC_OS_X_VERSION_MIN_STRING=10.6
38 UNAME_PROCESSOR=$(shell uname -p)
39 ifneq "$(RC_ARCHS)" ""
42 else ifeq "$(RC_INDIGO)" "YES"
47 INSTALLHDRS_ARCH=-arch $(shell echo $(RC_ARCHS) | cut -d' ' -f1)
52 $(info # RC_ARCHS=$(RC_ARCHS))
53 $(info # INSTALLHDRS_ARCH=$(INSTALLHDRS_ARCH))
54 $(info # buildhost=$(UNAME_PROCESSOR))
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.
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
72 else ifeq "$(LINUX)" "YES"
73 TARGET_SPEC=$(UNAME_PROCESSOR)-unknown-linux-gnu
75 ICUPKGTOOLIBS="$(OBJROOT)/lib:$(OBJROOT)/stubdata"
76 ICUPKGTOOL=$(OBJROOT)/bin/icupkg
79 TARGET_SPEC=$(UNAME_PROCESSOR)-apple-darwin10.0.0
81 ICUPKGTOOLIBS="$(OBJROOT)/lib:$(OBJROOT)/stubdata"
82 ICUPKGTOOL=$(OBJROOT)/bin/icupkg
85 $(info # TARGET_SPEC=$(TARGET_SPEC))
86 $(info # ENV_CONFIGURE_ARCHS=$(ENV_CONFIGURE_ARCHS))
88 ifeq "$(RC_INDIGO)" "YES"
89 -include /Developer/AppleInternal/Makefiles/Makefile.indigo
91 SDKROOT=$(INDIGO_PREFIX)
93 DEST_ROOT=$(DSTROOT)/$(INDIGO_PREFIX)/
97 $(info # SDKROOT=$(SDKROOT))
98 $(info # RC_INDIGO=$(RC_INDIGO))
99 $(info # CROSS_BUILD=$(CROSS_BUILD))
101 SET_MACOSX_MIN_VER :=
102 ifeq "$(filter arm armv6 armv7,$(RC_ARCHS))" ""
104 ifneq "$(SDKROOT)" ""
105 SET_MACOSX_MIN_VER := -mmacosx-version-min=$(MAC_OS_X_VERSION_MIN_STRING)
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))
115 ifeq "$(WINDOWS)" "YES"
117 else ifeq "$(LINUX)" "YES"
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)
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)
134 ifeq "$(EMBEDDED)" "1"
135 export APPLE_EMBEDDED=YES
137 else ifeq "$(RC_INDIGO)" "YES"
138 export APPLE_EMBEDDED=YES
141 export APPLE_EMBEDDED=NO
145 ifeq "$(DISABLE_DRAFT)" "YES"
146 DRAFT_FLAG=--disable-draft
151 ifndef RC_ProjectSourceVersion
152 ifdef RC_PROJECTSOURCEVERSION
153 RC_ProjectSourceVersion=$(RC_PROJECTSOURCEVERSION)
157 # An Apple submission version (passed in RC_ProjectSourceVersion for official builds) is
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/')
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/')
172 ifeq "$(ICU_BUILD_Y)" ""
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))
180 ifeq "$(ICU_BUILD_Z2)" ""
181 ICU_BUILD := $(subst b,0,$(ICU_BUILD))
182 ICU_BUILD := $(subst c,$(ICU_BUILD_Z1),$(ICU_BUILD))
184 ICU_BUILD := $(subst b,$(ICU_BUILD_Z1),$(ICU_BUILD))
185 ICU_BUILD := $(subst c,$(ICU_BUILD_Z2),$(ICU_BUILD))
192 $(info # ICU_BUILD=$(ICU_BUILD))
194 # Disallow $(SRCROOT) == $(OBJROOT)
195 ifeq ($(OBJROOT), $(SRCROOT))
196 $(error SRCROOT same as OBJROOT)
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)
205 ifeq "$(LINUX)" "YES"
206 $(error Cross-builds currently not allowed on Linux)
210 #################################
212 #################################
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.
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)
228 HDR_MAKE_SUBDIR = ./common/ ./i18n/ ./io/ $(EXTRA_HDRS)
230 ifeq "$(WINDOWS)" "YES"
231 PRIVATE_HDR_PREFIX=$(APPLE_INTERNAL_DIR)
232 else ifeq "$(APPLE_EMBEDDED)" "YES"
234 PRIVATE_HDR_PREFIX=/usr/local
236 PRIVATE_HDR_PREFIX=/usr/local
239 #################################
241 #################################
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.
248 INSTALL = /usr/bin/install
249 COMMON_OBJ = ./common/*.o
250 I18N_OBJ = ./i18n/*.o
252 STUB_DATA_OBJ = ./stubdata/*.o
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)
261 DYLIB_OBJS=$(COMMON_OBJ) $(I18N_OBJ) $(IO_OBJ) $(STUB_DATA_OBJ)
264 #################################
266 #################################
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.
272 INSTALLSRC_VARFILES=./ICU_embedded.order ./minimalapis.txt ./minimalapisTest.c ./minimalpatchconfig.txt ./windowspatchconfig.txt ./patchconfig.txt ./crosshostpatchconfig.txt
274 #################################
276 #################################
278 #We need to clean after installing.
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
288 CLEAN_SUBDIR = ./stubdata ./common ./i18n ./io ./layout ./layoutex ./data ./tools ./$(MANUAL_CLEAN_TOOLS) $(MANUAL_CLEAN_EXTRA) $(MANUAL_CLEAN_TEST) $(MANUAL_CLEAN_SAMPLE)
290 #################################
292 #################################
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) \
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 \
304 CONFIG_FLAGS = --disable-renaming --disable-extras --disable-layout --disable-samples \
305 --with-data-packaging=archive --prefix=$(PRIVATE_HDR_PREFIX) --with-library-bits=32 \
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
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
318 #################################
320 #################################
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.
334 ifeq "$(WINDOWS)" "YES"
336 libdir = /AppleInternal/bin/
337 winlibdir = /AppleInternal/lib/
338 else ifeq "$(LINUX)" "YES"
340 ifeq "$(ARCH64)" "YES"
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)
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)
369 INSTALLED_DYLIB_icu = INSTALLED_DYLIB
370 INSTALLED_DYLIB_debug = INSTALLED_DYLIB_DEBUG
371 INSTALLED_DYLIB_profile = INSTALLED_DYLIB_PROFILE
373 DYLIB_debug = DYLIB_DEBUG
374 DYLIB_profile = DYLIB_PROFILE
376 #################################
378 #################################
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
387 #################################
389 #################################
391 localtooldir=/usr/local/bin/
395 INFOTOOL_OBJS = ./tools/icuinfo/icuinfo.o ./tools/toolutil/udbgutil.o ./tools/toolutil/uoptions.o
397 #################################
398 # Environment variables
399 #################################
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).
407 LIBOVERRIDES=LIBICUDT="-L$(OBJROOT) -l$(LIB_NAME)" \
408 LIBICUUC="-L$(OBJROOT) -l$(LIB_NAME)" \
409 LIBICUI18N="-L$(OBJROOT) -l$(LIB_NAME)"
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"
418 CPPOPTIONS = CPPFLAGS="-DU_DISABLE_RENAMING=1 -DU_ICU_VERSION_BUILDLEVEL_NUM=$(ICU_BUILD)"
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"
424 else ifeq "$(LINUX)" "YES"
425 export TZ_EXTRA_CXXFLAGS:=
426 ifeq "$(ICU_BUILD)" "0"
427 CPPOPTIONS = CPPFLAGS="-DU_DISABLE_RENAMING=1"
429 CPPOPTIONS = CPPFLAGS="-DU_DISABLE_RENAMING=1 -DU_ICU_VERSION_BUILDLEVEL_NUM=$(ICU_BUILD)"
431 ifeq "$(ARCH64)" "YES"
432 ENV_CONFIGURE= $(CPPOPTIONS) APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
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" \
438 DYLD_LIBRARY_PATH="$(DEST_ROOT)/usr/local/lib64"
440 ENV= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
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" \
446 DYLD_LIBRARY_PATH="$(DEST_ROOT)/usr/local/lib64"
448 ENV_DEBUG = APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
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" \
454 DYLD_LIBRARY_PATH="$(DEST_ROOT)/usr/local/lib64"
456 ENV_PROFILE = APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
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" \
462 DYLD_LIBRARY_PATH="$(DEST_ROOT)/usr/local/lib64"
464 ENV_CONFIGURE= $(CPPOPTIONS) APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
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" \
470 DYLD_LIBRARY_PATH="$(DEST_ROOT)/usr/local/lib"
472 ENV= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
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" \
478 DYLD_LIBRARY_PATH="$(DEST_ROOT)/usr/local/lib"
480 ENV_DEBUG = APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
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" \
486 DYLD_LIBRARY_PATH="$(DEST_ROOT)/usr/local/lib"
488 ENV_PROFILE = APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
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" \
494 DYLD_LIBRARY_PATH="$(DEST_ROOT)/usr/local/lib"
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)"
501 CPPOPTIONS = CPPFLAGS="-DU_ICU_VERSION_BUILDLEVEL_NUM=$(ICU_BUILD) -DSTD_INSPIRED -DMAC_OS_X_VERSION_MIN_REQUIRED=$(MAC_OS_X_VERSION_MIN_REQUIRED)"
503 ENV_CONFIGURE= $(CPPOPTIONS) APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
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)\
511 DYLD_LIBRARY_PATH="$(DEST_ROOT)/usr/local/lib"
513 ENV= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
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)" \
521 DYLD_LIBRARY_PATH="$(DEST_ROOT)/usr/local/lib"
523 ENV_DEBUG = APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
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)" \
531 DYLD_LIBRARY_PATH="$(DEST_ROOT)/usr/local/lib"
533 ENV_PROFILE = APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
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)" \
541 DYLD_LIBRARY_PATH="$(DEST_ROOT)/usr/local/lib"
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)" \
548 DYLD_LIBRARY_PATH="$(DEST_ROOT)/usr/local/lib"
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)" \
555 DYLD_LIBRARY_PATH="$(DEST_ROOT)/usr/local/lib"
560 ENV_debug = ENV_DEBUG
561 ENV_profile = ENV_PROFILE
563 ifeq "$(APPLE_EMBEDDED)" "YES"
564 ORDERFILE=$(SRCROOT)/ICU_embedded.order
566 ORDERFILE=/usr/local/lib/OrderFiles/libicucore.order
568 ifeq "$(shell test -f $(ORDERFILE) && echo YES )" "YES"
569 SECTORDER_FLAGS=-sectorder __TEXT __text $(ORDERFILE)
575 #################################
576 #################################
578 #################################
579 #################################
581 .PHONY : icu check installsrc installhdrs installhdrsint clean install debug debug-install crossbuildhost
584 icu debug profile : $(OBJROOT)/Makefile
586 $(MAKE) $($(ENV_$@)); \
587 if test "$(WINDOWS)" = "YES"; then \
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; \
593 rc.exe /folibicuin.res $(CPPFLAGS) -DU_RELEASE=1 -D_CRT_SECURE_NO_DEPRECATE -I. -I../common libicuin.rc; \
595 if test "$@" = "debug"; then \
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; \
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; \
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"; \
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"; \
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); \
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); \
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) ; \
675 if test -f ./$(ICU_DATA_DIR)/$(B_DATA_FILE); then \
676 ln -fs ./$(ICU_DATA_DIR)/$(B_DATA_FILE); \
678 if test -f ./$(ICU_DATA_DIR)/$(L_DATA_FILE); then \
679 ln -fs ./$(ICU_DATA_DIR)/$(L_DATA_FILE); \
681 DYLD_LIBRARY_PATH=$(ICUPKGTOOLIBS) \
682 $(ICUPKGTOOL) -tl ./$(ICU_DATA_DIR)/$(B_DATA_FILE) $(L_DATA_FILE); \
687 crossbuildhost : $(CROSSHOST_OBJROOT)/Makefile
688 (cd $(CROSSHOST_OBJROOT); \
689 $(MAKE) $($(ENV_BUILDHOST)); \
693 ifneq "$(CROSS_BUILD)" "YES"
695 ICU_DATA=$(OBJROOT) $(MAKE) $(ENV) check; \
698 $(warning check not supported for cross-build)
702 ifneq "$(CROSS_BUILD)" "YES"
704 ICU_DATA=$(OBJROOT) $(MAKE) $(ENV_DEBUG) check; \
707 $(warning check not supported for cross-build)
711 (cd $(OBJROOT)/samples; \
712 $(MAKE) $(ENV_DEBUG) $(LIBOVERRIDES); \
716 (cd $(OBJROOT)/extra; \
717 $(MAKE) $(ENV_DEBUG) $(LIBOVERRIDES); \
720 ifneq "$(CROSS_BUILD)" "YES"
721 $(OBJROOT)/Makefile :
723 $(OBJROOT)/Makefile : crossbuildhost
725 if test ! -d $(OBJROOT); then \
726 mkdir -p $(OBJROOT); \
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);) \
743 (cd $(OBJROOT); $(ENV_CONFIGURE) $(SRCROOT)/icuSources/runConfigureICU MacOSX $(CONFIG_FLAGS);) \
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;) \
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;) \
762 if test -f $(SRCROOT)/icuSources/common/Makefile.local; then \
763 cp -p $(SRCROOT)/icuSources/common/Makefile.local $(OBJROOT)/common/ ; \
765 if test -f $(SRCROOT)/icuSources/i18n/Makefile.local; then \
766 cp -p $(SRCROOT)/icuSources/i18n/Makefile.local $(OBJROOT)/i18n/ ; \
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); \
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/ ; \
783 if test -f $(SRCROOT)/icuSources/i18n/Makefile.local; then \
784 cp -p $(SRCROOT)/icuSources/i18n/Makefile.local $(CROSSHOST_OBJROOT)/i18n/ ; \
787 #################################
789 #################################
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.
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 \
805 for j in `find $(SRCROOT)/icuSources/ | grep ".cvsignore"` ; do \
806 if test -f $$j ; then \
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).
815 # installhdrs should be no-op for RC_INDIGO
816 ifeq "$(RC_INDIGO)" "YES"
819 installhdrs : installhdrsint
822 installhdrsint : $(OBJROOT)/Makefile
824 for subdir in $(HDR_MAKE_SUBDIR); do \
825 (cd $$subdir; $(MAKE) -e DESTDIR=$(DEST_ROOT) $(ENV) install-headers); \
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/; \
831 if test -d $(DEST_ROOT)/$(PRIVATE_HDR_PREFIX)/include/unicode/; then \
832 (cd $(DEST_ROOT)$(PRIVATE_HDR_PREFIX)/include/unicode; \
834 if fgrep -q -x $$i $(SRCROOT)/minimalapis.txt ; then \
835 mv $$i $(DEST_ROOT)$(HDR_PREFIX)/include/unicode ; \
838 $(CC) $(SRCROOT)/minimalapisTest.c $(INSTALLHDRS_ARCH) $(ISYSROOT) -nostdinc \
839 -I $(DEST_ROOT)$(HDR_PREFIX)/include/ -I $(SDKROOT)/usr/include/ -E > /dev/null ; \
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.
849 install : installhdrsint icu
850 if test ! -d $(DEST_ROOT)$(libdir)/; then \
851 $(INSTALL) -d -m 0755 $(DEST_ROOT)$(libdir)/; \
853 if test "$(WINDOWS)" = "YES"; then \
854 if test ! -d $(DEST_ROOT)$(winlibdir)/; then \
855 $(INSTALL) -d -m 0755 $(DEST_ROOT)$(winlibdir)/; \
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; \
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); \
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); \
881 for subdir in $(EXTRA_LIBS); do \
882 (cd $(OBJROOT)/$$subdir; $(MAKE) -e DESTDIR=$(DEST_ROOT) $(ENV) install-library;) \
884 if test ! -d $(DEST_ROOT)$(datadir)/; then \
885 $(INSTALL) -d -m 0755 $(DEST_ROOT)$(datadir)/; \
887 if test -f $(OBJROOT)/$(L_DATA_FILE); then \
888 $(INSTALL) -b -m 0644 $(OBJROOT)/$(L_DATA_FILE) $(DEST_ROOT)$(datadir)$(L_DATA_FILE); \
890 if test ! -d $(DEST_ROOT)$(OPEN_SOURCE_VERSIONS_DIR)/; then \
891 $(INSTALL) -d -m 0755 $(DEST_ROOT)$(OPEN_SOURCE_VERSIONS_DIR)/; \
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)/; \
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)/; \
901 if test -f $(OBJROOT)/$(INFOTOOL); then \
902 $(INSTALL) -b -m 0755 $(OBJROOT)/$(INFOTOOL) $(DEST_ROOT)$(localtooldir)$(INFOTOOL); \
906 DEPEND_install_debug = debug
907 DEPEND_install_profile = profile
910 install_debug install_profile : $$(DEPEND_$$@)
911 if test ! -d $(DEST_ROOT)$(libdir)/; then \
912 $(INSTALL) -d -m 0755 $(DEST_ROOT)$(libdir)/; \
914 if test "$(WINDOWS)" = "YES"; then \
915 if test ! -d $(DEST_ROOT)$(winlibdir)/; then \
916 $(INSTALL) -d -m 0755 $(DEST_ROOT)$(winlibdir)/; \
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; \
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_$@))); \
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_$@))); \
935 for subdir in $(EXTRA_LIBS); do \
936 (cd $(OBJROOT)/$$subdir; $(MAKE) -e DESTDIR=$(DEST_ROOT) $(ENV) install-library;) \