]> git.saurik.com Git - apple/icu.git/blame - makefile
ICU-461.12.tar.gz
[apple/icu.git] / makefile
CommitLineData
b75a7d8f 1##
46f4442e 2# Wrapper makefile for ICU
729e4ab9 3# Copyright (C) 2003-2010 Apple Inc. All rights reserved.
b75a7d8f
A
4#
5# See http://www.gnu.org/manual/make/html_chapter/make_toc.html#SEC_Contents
6# for documentation on makefiles. Most of this was culled from the ncurses makefile.
7#
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
21SHELL := /bin/sh
22
23# Sane defaults, which are typically overridden on the command line.
73c04bcf 24WINDOWS=NO
729e4ab9
A
25LINUX=NO
26ARCH64=NO
27
374ca955
A
28SRCROOT=$(shell pwd)
29OBJROOT=$(SRCROOT)/build
30DSTROOT=$(OBJROOT)
b75a7d8f 31SYMROOT=$(OBJROOT)
729e4ab9 32CROSSHOST_OBJROOT=$(OBJROOT)/crossbuildhost
b75a7d8f
A
33APPLE_INTERNAL_DIR=/AppleInternal
34RC_ARCHS=
729e4ab9
A
35MAC_OS_X_VERSION_MIN_REQUIRED=1060
36MAC_OS_X_VERSION_MIN_STRING=10.6
37
38UNAME_PROCESSOR=$(shell uname -p)
39ifneq "$(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)
73c04bcf 48else
729e4ab9
A
49 CROSS_BUILD=NO
50 INSTALLHDRS_ARCH=
73c04bcf 51endif
729e4ab9
A
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#
61ifeq "$(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
72else 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=
46f4442e 78else
729e4ab9
A
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=
46f4442e 84endif
729e4ab9
A
85$(info # TARGET_SPEC=$(TARGET_SPEC))
86$(info # ENV_CONFIGURE_ARCHS=$(ENV_CONFIGURE_ARCHS))
46f4442e
A
87
88ifeq "$(RC_INDIGO)" "YES"
729e4ab9 89 -include /Developer/AppleInternal/Makefiles/Makefile.indigo
46f4442e
A
90 ifndef SDKROOT
91 SDKROOT=$(INDIGO_PREFIX)
92 endif
93 DEST_ROOT=$(DSTROOT)/$(INDIGO_PREFIX)/
73c04bcf 94else
46f4442e
A
95 DEST_ROOT=$(DSTROOT)
96endif
729e4ab9
A
97$(info # SDKROOT=$(SDKROOT))
98$(info # RC_INDIGO=$(RC_INDIGO))
99$(info # CROSS_BUILD=$(CROSS_BUILD))
46f4442e 100
729e4ab9
A
101SET_MACOSX_MIN_VER :=
102ifeq "$(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)
46f4442e
A
106 endif
107else
729e4ab9
A
108 THUMB_FLAG = -mthumb
109endif
110
111# even for a crossbuild host build, we want to use the target's tzdata
112export TZDATA:=$(lastword $(wildcard $(SDKROOT)/usr/local/share/tz/tzdata*.tar.gz))
113$(info # TZDATA=$(TZDATA))
114
115ifeq "$(WINDOWS)" "YES"
116 EMBEDDED:=0
117else ifeq "$(LINUX)" "YES"
118 CC := gcc
119 CXX := g++
46f4442e 120 EMBEDDED:=0
729e4ab9
A
121 ISYSROOT =
122else 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 =
127else
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)
46f4442e
A
132endif
133
134ifeq "$(EMBEDDED)" "1"
135 export APPLE_EMBEDDED=YES
729e4ab9 136 DISABLE_DRAFT=YES
46f4442e
A
137else ifeq "$(RC_INDIGO)" "YES"
138 export APPLE_EMBEDDED=YES
729e4ab9 139 DISABLE_DRAFT=YES
46f4442e
A
140else
141 export APPLE_EMBEDDED=NO
729e4ab9
A
142 DISABLE_DRAFT=NO
143endif
144
145ifeq "$(DISABLE_DRAFT)" "YES"
146 DRAFT_FLAG=--disable-draft
147else
148 DRAFT_FLAG=
73c04bcf
A
149endif
150
151ifndef RC_ProjectSourceVersion
152ifdef RC_PROJECTSOURCEVERSION
153 RC_ProjectSourceVersion=$(RC_PROJECTSOURCEVERSION)
154endif
155endif
156
729e4ab9
A
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
73c04bcf
A
162ifneq "$(RC_ProjectSourceVersion)" ""
163 ifeq "$(WINDOWS)" "YES"
729e4ab9
A
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/')
73c04bcf 167 else
729e4ab9
A
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
73c04bcf
A
188 endif
189else
190 ICU_BUILD := 0
191endif
729e4ab9 192$(info # ICU_BUILD=$(ICU_BUILD))
b75a7d8f 193
374ca955
A
194# Disallow $(SRCROOT) == $(OBJROOT)
195ifeq ($(OBJROOT), $(SRCROOT))
196$(error SRCROOT same as OBJROOT)
197endif
b75a7d8f 198
729e4ab9
A
199# Disallow cross builds on Windows/Linux for now
200# (since those builds are not out-of-source as required for cross-builds)
201ifeq "$(CROSS_BUILD)" "YES"
202ifeq "$(WINDOWS)" "YES"
203$(error Cross-builds currently not allowed on Windows)
204endif
205ifeq "$(LINUX)" "YES"
206$(error Cross-builds currently not allowed on Linux)
207endif
208endif
209
b75a7d8f
A
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
221EXTRA_HDRS =
222# EXTRA_HDRS = ./extra/ustdio/ ./layout/
46f4442e 223ifeq "$(APPLE_EMBEDDED)" "YES"
73c04bcf
A
224 HDR_MAKE_SUBDIR = ./common/ ./i18n/ $(EXTRA_HDRS)
225else ifeq "$(WINDOWS)" "YES"
226 HDR_MAKE_SUBDIR = ./common/ ./i18n/ $(EXTRA_HDRS)
227else
228 HDR_MAKE_SUBDIR = ./common/ ./i18n/ ./io/ $(EXTRA_HDRS)
229endif
230ifeq "$(WINDOWS)" "YES"
73c04bcf 231 PRIVATE_HDR_PREFIX=$(APPLE_INTERNAL_DIR)
729e4ab9 232else ifeq "$(APPLE_EMBEDDED)" "YES"
73c04bcf
A
233 HDR_PREFIX=/usr
234 PRIVATE_HDR_PREFIX=/usr/local
729e4ab9
A
235else
236 PRIVATE_HDR_PREFIX=/usr/local
73c04bcf 237endif
b75a7d8f
A
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
248INSTALL = /usr/bin/install
249COMMON_OBJ = ./common/*.o
250I18N_OBJ = ./i18n/*.o
73c04bcf 251IO_OBJ = ./io/*.o
b75a7d8f
A
252STUB_DATA_OBJ = ./stubdata/*.o
253EXTRA_LIBS =
254#EXTRA_LIBS =./extra/ ./layout/ ./tools/ctestfw/ ./tools/toolutil/
255#DATA_OBJ = ./data/out/build/*.o
46f4442e 256ifeq "$(APPLE_EMBEDDED)" "YES"
73c04bcf
A
257 DYLIB_OBJS=$(COMMON_OBJ) $(I18N_OBJ) $(STUB_DATA_OBJ)
258else ifeq "$(WINDOWS)" "YES"
259 DYLIB_OBJS=$(COMMON_OBJ) ./common/common.res $(I18N_OBJ) $(STUB_DATA_OBJ)
260else
261 DYLIB_OBJS=$(COMMON_OBJ) $(I18N_OBJ) $(IO_OBJ) $(STUB_DATA_OBJ)
262endif
b75a7d8f 263
46f4442e
A
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
729e4ab9 272INSTALLSRC_VARFILES=./ICU_embedded.order ./minimalapis.txt ./minimalapisTest.c ./minimalpatchconfig.txt ./windowspatchconfig.txt ./patchconfig.txt ./crosshostpatchconfig.txt
46f4442e 273
b75a7d8f
A
274#################################
275# Cleaning
276#################################
277
278#We need to clean after installing.
279
280EXTRA_CLEAN =
281
282# Some directories aren't cleaned recursively. Clean them manually...
283MANUAL_CLEAN_TOOLS = ./tools/dumpce
284MANUAL_CLEAN_EXTRA = ./extra/scrptrun ./samples/layout ./extra/ustdio ./extra
285MANUAL_CLEAN_TEST = ./test/collperf ./test/iotest ./test/letest ./test/thaitest ./test/threadtest ./test/testmap ./test
286MANUAL_CLEAN_SAMPLE = ./samples/layout ./samples
287
73c04bcf 288CLEAN_SUBDIR = ./stubdata ./common ./i18n ./io ./layout ./layoutex ./data ./tools ./$(MANUAL_CLEAN_TOOLS) $(MANUAL_CLEAN_EXTRA) $(MANUAL_CLEAN_TEST) $(MANUAL_CLEAN_SAMPLE)
b75a7d8f
A
289
290#################################
291# Config flags
292#################################
293
729e4ab9
A
294ifeq "$(WINDOWS)" "YES"
295 CONFIG_FLAGS = --disable-renaming --disable-extras --disable-layout --disable-samples --disable-icuio \
296 --with-data-packaging=library --prefix=$(PRIVATE_HDR_PREFIX) \
73c04bcf 297 $(DRAFT_FLAG)
729e4ab9
A
298else 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
308else 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
73c04bcf 312else
729e4ab9
A
313 CONFIG_FLAGS = --disable-renaming --disable-extras --disable-layout --disable-samples \
314 --with-data-packaging=archive --prefix=$(PRIVATE_HDR_PREFIX) \
73c04bcf
A
315 $(DRAFT_FLAG) --srcdir=$(SRCROOT)/icuSources
316endif
b75a7d8f
A
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
374ca955 329LIB_NAME = icucore
729e4ab9
A
330ICU_VERS = 46
331ICU_SUBVERS = 1
b75a7d8f 332CORE_VERS = A
b75a7d8f 333
73c04bcf
A
334ifeq "$(WINDOWS)" "YES"
335 DYLIB_SUFF = dll
336 libdir = /AppleInternal/bin/
337 winlibdir = /AppleInternal/lib/
729e4ab9
A
338else 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 =
73c04bcf
A
346else
347 DYLIB_SUFF = dylib
348 libdir = /usr/lib/
349 winlibdir =
350endif
351
374ca955 352DYLIB = lib$(LIB_NAME).$(DYLIB_SUFF)
73c04bcf
A
353DYLIB_DEBUG = lib$(LIB_NAME)_debug.$(DYLIB_SUFF)
354DYLIB_PROFILE = lib$(LIB_NAME)_profile.$(DYLIB_SUFF)
355ifeq "$(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)
729e4ab9
A
359else 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)
73c04bcf
A
363else
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)
367endif
368
369INSTALLED_DYLIB_icu = INSTALLED_DYLIB
370INSTALLED_DYLIB_debug = INSTALLED_DYLIB_DEBUG
371INSTALLED_DYLIB_profile = INSTALLED_DYLIB_PROFILE
372DYLIB_icu = DYLIB
373DYLIB_debug = DYLIB_DEBUG
374DYLIB_profile = DYLIB_PROFILE
b75a7d8f
A
375
376#################################
377# Data files
378#################################
379
380datadir=/usr/share/icu/
374ca955
A
381OPEN_SOURCE_VERSIONS_DIR=/usr/local/OpenSourceVersions/
382OPEN_SOURCE_LICENSES_DIR=/usr/local/OpenSourceLicenses/
383ICU_DATA_DIR= data/out
b75a7d8f
A
384B_DATA_FILE=icudt$(ICU_VERS)b.dat
385L_DATA_FILE=icudt$(ICU_VERS)l.dat
386
729e4ab9
A
387#################################
388# Info tool
389#################################
390
391localtooldir=/usr/local/bin/
392
393INFOTOOL = icuinfo
394
395INFOTOOL_OBJS = ./tools/icuinfo/icuinfo.o ./tools/toolutil/udbgutil.o ./tools/toolutil/uoptions.o
396
374ca955
A
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
407LIBOVERRIDES=LIBICUDT="-L$(OBJROOT) -l$(LIB_NAME)" \
408 LIBICUUC="-L$(OBJROOT) -l$(LIB_NAME)" \
409 LIBICUI18N="-L$(OBJROOT) -l$(LIB_NAME)"
410
46f4442e
A
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.
73c04bcf 413ifeq "$(WINDOWS)" "YES"
729e4ab9 414 export TZ_EXTRA_CXXFLAGS:=
73c04bcf 415 ifeq "$(ICU_BUILD)" "0"
729e4ab9 416 CPPOPTIONS = CPPFLAGS="-DU_DISABLE_RENAMING=1"
73c04bcf 417 else
729e4ab9 418 CPPOPTIONS = CPPFLAGS="-DU_DISABLE_RENAMING=1 -DU_ICU_VERSION_BUILDLEVEL_NUM=$(ICU_BUILD)"
73c04bcf 419 endif
729e4ab9 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"
46f4442e 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"
729e4ab9 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"
73c04bcf 423 ENV_PROFILE=
729e4ab9
A
424else 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
73c04bcf 496else
729e4ab9 497 export TZ_EXTRA_CXXFLAGS:=-DMAC_OS_X_VERSION_MIN_REQUIRED=$(MAC_OS_X_VERSION_MIN_REQUIRED) $(SET_MACOSX_MIN_VER)
73c04bcf 498 ifeq "$(ICU_BUILD)" "0"
729e4ab9 499 CPPOPTIONS = CPPFLAGS="-DSTD_INSPIRED -DMAC_OS_X_VERSION_MIN_REQUIRED=$(MAC_OS_X_VERSION_MIN_REQUIRED)"
73c04bcf 500 else
729e4ab9 501 CPPOPTIONS = CPPFLAGS="-DU_ICU_VERSION_BUILDLEVEL_NUM=$(ICU_BUILD) -DSTD_INSPIRED -DMAC_OS_X_VERSION_MIN_REQUIRED=$(MAC_OS_X_VERSION_MIN_REQUIRED)"
73c04bcf 502 endif
729e4ab9
A
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
73c04bcf 513 ENV= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \
729e4ab9
A
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)" \
73c04bcf
A
519 RC_ARCHS="$(RC_ARCHS)" \
520 TZDATA="$(TZDATA)" \
46f4442e 521 DYLD_LIBRARY_PATH="$(DEST_ROOT)/usr/local/lib"
73c04bcf 522
729e4ab9
A
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)" \
73c04bcf
A
529 RC_ARCHS="$(RC_ARCHS)" \
530 TZDATA="$(TZDATA)" \
46f4442e 531 DYLD_LIBRARY_PATH="$(DEST_ROOT)/usr/local/lib"
73c04bcf 532
729e4ab9
A
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)" \
73c04bcf
A
539 RC_ARCHS="$(RC_ARCHS)" \
540 TZDATA="$(TZDATA)" \
46f4442e 541 DYLD_LIBRARY_PATH="$(DEST_ROOT)/usr/local/lib"
729e4ab9
A
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"
73c04bcf 549
729e4ab9
A
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)" \
73c04bcf 554 TZDATA="$(TZDATA)" \
46f4442e 555 DYLD_LIBRARY_PATH="$(DEST_ROOT)/usr/local/lib"
729e4ab9 556
73c04bcf 557endif
374ca955 558
374ca955
A
559ENV_icu = ENV
560ENV_debug = ENV_DEBUG
73c04bcf 561ENV_profile = ENV_PROFILE
374ca955 562
46f4442e
A
563ifeq "$(APPLE_EMBEDDED)" "YES"
564 ORDERFILE=$(SRCROOT)/ICU_embedded.order
565else
566 ORDERFILE=/usr/local/lib/OrderFiles/libicucore.order
567endif
374ca955
A
568ifeq "$(shell test -f $(ORDERFILE) && echo YES )" "YES"
569 SECTORDER_FLAGS=-sectorder __TEXT __text $(ORDERFILE)
570else
571 SECTORDER_FLAGS=
572endif
573
574
b75a7d8f
A
575#################################
576#################################
577# TARGETS
578#################################
579#################################
374ca955 580
729e4ab9 581.PHONY : icu check installsrc installhdrs installhdrsint clean install debug debug-install crossbuildhost
374ca955
A
582.DELETE_ON_ERROR :
583
73c04bcf 584icu debug profile : $(OBJROOT)/Makefile
374ca955
A
585 (cd $(OBJROOT); \
586 $(MAKE) $($(ENV_$@)); \
73c04bcf 587 if test "$(WINDOWS)" = "YES"; then \
729e4ab9
A
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 ); \
73c04bcf
A
595 if test "$@" = "debug"; then \
596 (cd common; \
729e4ab9
A
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 ); \
73c04bcf 601 (cd i18n; \
729e4ab9
A
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 ); \
73c04bcf 648 fi; \
374ca955 649 else \
729e4ab9
A
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; \
73c04bcf
A
675 if test -f ./$(ICU_DATA_DIR)/$(B_DATA_FILE); then \
676 ln -fs ./$(ICU_DATA_DIR)/$(B_DATA_FILE); \
73c04bcf
A
677 fi; \
678 if test -f ./$(ICU_DATA_DIR)/$(L_DATA_FILE); then \
679 ln -fs ./$(ICU_DATA_DIR)/$(L_DATA_FILE); \
680 else \
729e4ab9
A
681 DYLD_LIBRARY_PATH=$(ICUPKGTOOLIBS) \
682 $(ICUPKGTOOL) -tl ./$(ICU_DATA_DIR)/$(B_DATA_FILE) $(L_DATA_FILE); \
73c04bcf 683 fi; \
374ca955
A
684 fi; \
685 );
686
729e4ab9
A
687crossbuildhost : $(CROSSHOST_OBJROOT)/Makefile
688 (cd $(CROSSHOST_OBJROOT); \
689 $(MAKE) $($(ENV_BUILDHOST)); \
690 );
691
374ca955 692check : icu
729e4ab9 693ifneq "$(CROSS_BUILD)" "YES"
374ca955 694 (cd $(OBJROOT); \
73c04bcf
A
695 ICU_DATA=$(OBJROOT) $(MAKE) $(ENV) check; \
696 );
729e4ab9
A
697else
698 $(warning check not supported for cross-build)
699endif
73c04bcf
A
700
701check-debug: debug
729e4ab9 702ifneq "$(CROSS_BUILD)" "YES"
73c04bcf
A
703 (cd $(OBJROOT); \
704 ICU_DATA=$(OBJROOT) $(MAKE) $(ENV_DEBUG) check; \
374ca955 705 );
729e4ab9
A
706else
707 $(warning check not supported for cross-build)
708endif
374ca955
A
709
710samples: icu
711 (cd $(OBJROOT)/samples; \
712 $(MAKE) $(ENV_DEBUG) $(LIBOVERRIDES); \
713 );
714
715extra: icu
716 (cd $(OBJROOT)/extra; \
717 $(MAKE) $(ENV_DEBUG) $(LIBOVERRIDES); \
718 );
719
729e4ab9 720ifneq "$(CROSS_BUILD)" "YES"
374ca955 721$(OBJROOT)/Makefile :
729e4ab9
A
722else
723$(OBJROOT)/Makefile : crossbuildhost
724endif
374ca955
A
725 if test ! -d $(OBJROOT); then \
726 mkdir -p $(OBJROOT); \
727 fi;
73c04bcf
A
728 if test "$(WINDOWS)" = "YES"; then \
729 cp -Rpf $(SRCROOT)/icuSources/* $(OBJROOT); \
730 (cd $(OBJROOT)/data/unidata; mv base_unidata/*.txt .;); \
729e4ab9
A
731 (cd $(OBJROOT)/data/unidata/norm2; mv base_norm2/*.txt .;); \
732 (cd $(OBJROOT)/data/in; mv base_in/*.nrm .; mv base_in/*.icu .;); \
73c04bcf 733 (cd $(OBJROOT); $(ENV_CONFIGURE) ./runConfigureICU Cygwin/MSVC $(CONFIG_FLAGS);) \
729e4ab9
A
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);) \
73c04bcf
A
742 else \
743 (cd $(OBJROOT); $(ENV_CONFIGURE) $(SRCROOT)/icuSources/runConfigureICU MacOSX $(CONFIG_FLAGS);) \
374ca955 744 fi;
46f4442e 745 if test "$(APPLE_EMBEDDED)" = "YES"; then \
73c04bcf
A
746 (cd $(OBJROOT)/common/unicode/; \
747 cp $(SRCROOT)/icuSources/common/unicode/uconfig.h . ; \
46f4442e 748 cp $(SRCROOT)/icuSources/common/unicode/udata.h . ; \
729e4ab9 749 cp $(SRCROOT)/icuSources/common/unicode/utypes.h . ; \
73c04bcf
A
750 patch <$(SRCROOT)/minimalpatchconfig.txt;) \
751 elif test "$(WINDOWS)" = "YES"; then \
752 (cd $(OBJROOT)/common/unicode/; \
753 cp $(SRCROOT)/icuSources/common/unicode/uconfig.h . ; \
729e4ab9 754 cp $(SRCROOT)/icuSources/common/unicode/utypes.h . ; \
73c04bcf
A
755 patch <$(SRCROOT)/windowspatchconfig.txt;) \
756 else \
757 (cd $(OBJROOT)/common/unicode/; \
758 cp $(SRCROOT)/icuSources/common/unicode/uconfig.h . ; \
729e4ab9 759 cp $(SRCROOT)/icuSources/common/unicode/utypes.h . ; \
73c04bcf
A
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;
729e4ab9
A
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;
374ca955
A
786
787#################################
788# B&I TARGETS
789#################################
790
b75a7d8f
A
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
796installsrc :
797 if test ! -d $(SRCROOT); then mkdir $(SRCROOT); fi;
798 if test -d $(SRCROOT)/icuSources ; then rm -rf $(SRCROOT)/icuSources; fi;
46f4442e 799 tar cf - ./makefile ./ICU.plist ./license.html ./icuSources $(INSTALLSRC_VARFILES) | (cd $(SRCROOT) ; tar xfp -); \
b75a7d8f
A
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
46f4442e 811# This works. Just not for ~ in the DEST_ROOT. We run configure first (in case it hasn't
b75a7d8f
A
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
46f4442e
A
815# installhdrs should be no-op for RC_INDIGO
816ifeq "$(RC_INDIGO)" "YES"
817installhdrs :
818else
819installhdrs : installhdrsint
820endif
821
822installhdrsint : $(OBJROOT)/Makefile
374ca955 823 (cd $(OBJROOT); \
73c04bcf 824 for subdir in $(HDR_MAKE_SUBDIR); do \
46f4442e 825 (cd $$subdir; $(MAKE) -e DESTDIR=$(DEST_ROOT) $(ENV) install-headers); \
73c04bcf 826 done; \
729e4ab9
A
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; \
73c04bcf 842 );
374ca955 843
b75a7d8f
A
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.
73c04bcf 848
46f4442e
A
849install : installhdrsint icu
850 if test ! -d $(DEST_ROOT)$(libdir)/; then \
851 $(INSTALL) -d -m 0755 $(DEST_ROOT)$(libdir)/; \
374ca955 852 fi;
73c04bcf 853 if test "$(WINDOWS)" = "YES"; then \
46f4442e
A
854 if test ! -d $(DEST_ROOT)$(winlibdir)/; then \
855 $(INSTALL) -d -m 0755 $(DEST_ROOT)$(winlibdir)/; \
73c04bcf 856 fi; \
729e4ab9
A
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; \
46f4442e 863 $(INSTALL) -b -m 0755 $(OBJROOT)/lib/icudt$(ICU_VERS).dll $(DEST_ROOT)$(libdir)icudt$(ICU_VERS).dll; \
729e4ab9
A
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; \
73c04bcf 870 else \
729e4ab9
A
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; \
73c04bcf 881 for subdir in $(EXTRA_LIBS); do \
46f4442e 882 (cd $(OBJROOT)/$$subdir; $(MAKE) -e DESTDIR=$(DEST_ROOT) $(ENV) install-library;) \
73c04bcf 883 done; \
46f4442e
A
884 if test ! -d $(DEST_ROOT)$(datadir)/; then \
885 $(INSTALL) -d -m 0755 $(DEST_ROOT)$(datadir)/; \
73c04bcf 886 fi; \
73c04bcf 887 if test -f $(OBJROOT)/$(L_DATA_FILE); then \
46f4442e 888 $(INSTALL) -b -m 0644 $(OBJROOT)/$(L_DATA_FILE) $(DEST_ROOT)$(datadir)$(L_DATA_FILE); \
73c04bcf 889 fi; \
46f4442e
A
890 if test ! -d $(DEST_ROOT)$(OPEN_SOURCE_VERSIONS_DIR)/; then \
891 $(INSTALL) -d -m 0755 $(DEST_ROOT)$(OPEN_SOURCE_VERSIONS_DIR)/; \
73c04bcf 892 fi; \
46f4442e
A
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)/; \
73c04bcf 896 fi; \
46f4442e 897 $(INSTALL) -b -m 0644 $(SRCROOT)/license.html $(DEST_ROOT)$(OPEN_SOURCE_LICENSES_DIR)ICU.html; \
729e4ab9
A
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; \
b75a7d8f 904 fi;
73c04bcf
A
905
906DEPEND_install_debug = debug
907DEPEND_install_profile = profile
908
909.SECONDEXPANSION:
910install_debug install_profile : $$(DEPEND_$$@)
46f4442e
A
911 if test ! -d $(DEST_ROOT)$(libdir)/; then \
912 $(INSTALL) -d -m 0755 $(DEST_ROOT)$(libdir)/; \
b75a7d8f 913 fi;
73c04bcf 914 if test "$(WINDOWS)" = "YES"; then \
46f4442e
A
915 if test ! -d $(DEST_ROOT)$(winlibdir)/; then \
916 $(INSTALL) -d -m 0755 $(DEST_ROOT)$(winlibdir)/; \
73c04bcf 917 fi; \
729e4ab9
A
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; \
73c04bcf 924 else \
46f4442e 925 $(INSTALL) -b -m 0664 $(OBJROOT)/$($(INSTALLED_DYLIB_$(DEPEND_$@))) $(DEST_ROOT)$(libdir)$($(INSTALLED_DYLIB_$(DEPEND_$@))); \
729e4ab9
A
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; \
73c04bcf 935 for subdir in $(EXTRA_LIBS); do \
46f4442e 936 (cd $(OBJROOT)/$$subdir; $(MAKE) -e DESTDIR=$(DEST_ROOT) $(ENV) install-library;) \
73c04bcf 937 done; \
b75a7d8f 938 fi;
b75a7d8f 939
374ca955
A
940clean :
941 -rm -rf $(OBJROOT)
73c04bcf 942