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