]>
Commit | Line | Data |
---|---|---|
b75a7d8f | 1 | ## |
46f4442e A |
2 | # Wrapper makefile for ICU |
3 | # Copyright (C) 2003-2009 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 | ||
21 | SHELL := /bin/sh | |
22 | ||
23 | # Sane defaults, which are typically overridden on the command line. | |
73c04bcf | 24 | WINDOWS=NO |
374ca955 A |
25 | SRCROOT=$(shell pwd) |
26 | OBJROOT=$(SRCROOT)/build | |
27 | DSTROOT=$(OBJROOT) | |
b75a7d8f | 28 | SYMROOT=$(OBJROOT) |
b75a7d8f A |
29 | APPLE_INTERNAL_DIR=/AppleInternal |
30 | RC_ARCHS= | |
73c04bcf A |
31 | DISABLE_DRAFT=NO |
32 | ||
33 | ifeq "$(DISABLE_DRAFT)" "YES" | |
34 | DRAFT_FLAG=--disable-draft | |
35 | else | |
36 | DRAFT_FLAG= | |
37 | endif | |
38 | ||
46f4442e A |
39 | ifeq "$(filter arm armv6,$(RC_ARCHS))" "" |
40 | THUMB_FLAG = | |
41 | else | |
73c04bcf | 42 | THUMB_FLAG = -mthumb |
46f4442e A |
43 | endif |
44 | ||
45 | ifeq "$(RC_INDIGO)" "YES" | |
46 | include $(APPLE_INTERNAL_DIR)/Indigo/Makefile.indigo | |
47 | ifndef SDKROOT | |
48 | SDKROOT=$(INDIGO_PREFIX) | |
49 | endif | |
50 | DEST_ROOT=$(DSTROOT)/$(INDIGO_PREFIX)/ | |
73c04bcf | 51 | else |
46f4442e A |
52 | DEST_ROOT=$(DSTROOT) |
53 | endif | |
54 | ||
55 | TZDATA=$(lastword $(wildcard $(SDKROOT)/usr/local/share/tz/tzdata*.tar.gz)) | |
56 | ||
57 | ifeq "$(WINDOWS)" "NO" | |
58 | ifeq "$(SDKROOT)" "" | |
59 | EMBEDDED:=$(shell $(CXX) -E -dM -x c -include TargetConditionals.h /dev/null | fgrep TARGET_OS_EMBEDDED | cut -d' ' -f3) | |
60 | ISYSROOT = | |
61 | else | |
62 | EMBEDDED:=$(shell $(CXX) -E -dM -x c -isysroot $(SDKROOT) -include TargetConditionals.h /dev/null | fgrep TARGET_OS_EMBEDDED | cut -d' ' -f3) | |
63 | ifeq "$(RC_INDIGO)" "YES" | |
64 | ISYSROOT = -isysroot $(SDKROOT) | |
65 | else | |
66 | ISYSROOT = | |
67 | endif | |
68 | endif | |
69 | else | |
70 | EMBEDDED:=0 | |
71 | endif | |
72 | ||
73 | ifeq "$(EMBEDDED)" "1" | |
74 | export APPLE_EMBEDDED=YES | |
75 | else ifeq "$(RC_INDIGO)" "YES" | |
76 | export APPLE_EMBEDDED=YES | |
77 | else | |
78 | export APPLE_EMBEDDED=NO | |
73c04bcf A |
79 | endif |
80 | ||
81 | ifndef RC_ProjectSourceVersion | |
82 | ifdef RC_PROJECTSOURCEVERSION | |
83 | RC_ProjectSourceVersion=$(RC_PROJECTSOURCEVERSION) | |
84 | endif | |
85 | endif | |
86 | ||
87 | ifneq "$(RC_ProjectSourceVersion)" "" | |
88 | ifeq "$(WINDOWS)" "YES" | |
89 | ICU_BUILD := $(shell echo $(RC_ProjectSourceVersion) | sed -r -e 's/[0-9]+.([0-9]+)(.[0-9]+)?/\1/') | |
90 | else | |
91 | ICU_BUILD := $(shell echo $(RC_ProjectSourceVersion) | sed -E -e 's/[0-9]+.([0-9]+)(.[0-9]+)?/\1/') | |
92 | endif | |
93 | else | |
94 | ICU_BUILD := 0 | |
95 | endif | |
b75a7d8f | 96 | |
374ca955 A |
97 | # Disallow $(SRCROOT) == $(OBJROOT) |
98 | ifeq ($(OBJROOT), $(SRCROOT)) | |
99 | $(error SRCROOT same as OBJROOT) | |
100 | endif | |
b75a7d8f A |
101 | |
102 | ################################# | |
103 | # Headers | |
104 | ################################# | |
105 | ||
106 | # For installhdrs. Not every compiled module has an associated header. Normally, | |
107 | # ICU installs headers as a sub-targe of the install target. But since we only want | |
108 | # certain libraries to install (and since we link all of our own .o modules), we need | |
109 | # invoke the headers targets ourselves. This may be problematic because there isn't a | |
110 | # good way to dist-clean afterwards...we need to do explicit dist-cleans, especially if | |
111 | # install the extra libraries. | |
112 | ||
113 | EXTRA_HDRS = | |
114 | # EXTRA_HDRS = ./extra/ustdio/ ./layout/ | |
46f4442e | 115 | ifeq "$(APPLE_EMBEDDED)" "YES" |
73c04bcf A |
116 | HDR_MAKE_SUBDIR = ./common/ ./i18n/ $(EXTRA_HDRS) |
117 | else ifeq "$(WINDOWS)" "YES" | |
118 | HDR_MAKE_SUBDIR = ./common/ ./i18n/ $(EXTRA_HDRS) | |
119 | else | |
120 | HDR_MAKE_SUBDIR = ./common/ ./i18n/ ./io/ $(EXTRA_HDRS) | |
121 | endif | |
122 | ifeq "$(WINDOWS)" "YES" | |
123 | HDR_PREFIX=$(APPLE_INTERNAL_DIR) | |
124 | PRIVATE_HDR_PREFIX=$(APPLE_INTERNAL_DIR) | |
125 | else | |
126 | HDR_PREFIX=/usr | |
127 | PRIVATE_HDR_PREFIX=/usr/local | |
128 | endif | |
b75a7d8f A |
129 | |
130 | ################################# | |
131 | # Install | |
132 | ################################# | |
133 | ||
134 | # For install. We currently don't install EXTRA_LIBS. We also don't install the data | |
135 | # directly into the ICU library. It is now installed at /usr/share/icu/*.dat. Thus we | |
136 | # don't use DATA_OBJ anymore. This could change if we decide to move the data back into | |
137 | # the icucore monolithic library. | |
138 | ||
139 | INSTALL = /usr/bin/install | |
140 | COMMON_OBJ = ./common/*.o | |
141 | I18N_OBJ = ./i18n/*.o | |
73c04bcf | 142 | IO_OBJ = ./io/*.o |
b75a7d8f | 143 | STUB_DATA_OBJ = ./stubdata/*.o |
73c04bcf A |
144 | #COMMON_SRC = $(OBJROOT)/common/*.c |
145 | #I18N_SRC = $(OBJROOT)/i18n/*.c | |
146 | #IO_SRC = $(OBJROOT)/io/*.c | |
147 | #STUB_DATA_SRC = $(OBJROOT)/stubdata/*.c | |
b75a7d8f A |
148 | EXTRA_LIBS = |
149 | #EXTRA_LIBS =./extra/ ./layout/ ./tools/ctestfw/ ./tools/toolutil/ | |
150 | #DATA_OBJ = ./data/out/build/*.o | |
46f4442e | 151 | ifeq "$(APPLE_EMBEDDED)" "YES" |
73c04bcf A |
152 | DYLIB_OBJS=$(COMMON_OBJ) $(I18N_OBJ) $(STUB_DATA_OBJ) |
153 | else ifeq "$(WINDOWS)" "YES" | |
154 | DYLIB_OBJS=$(COMMON_OBJ) ./common/common.res $(I18N_OBJ) $(STUB_DATA_OBJ) | |
155 | else | |
156 | DYLIB_OBJS=$(COMMON_OBJ) $(I18N_OBJ) $(IO_OBJ) $(STUB_DATA_OBJ) | |
157 | endif | |
b75a7d8f | 158 | |
46f4442e A |
159 | ################################# |
160 | # Sources | |
161 | ################################# | |
162 | ||
163 | # For installsrc (B&I) | |
164 | # Note that installsrc is run on the system from which ICU is submitted, which | |
165 | # may be a different environment than the one for a which a build is targeted. | |
166 | ||
167 | INSTALLSRC_VARFILES=./ICU_embedded.order ./minimalpatchconfig.txt ./windowspatchconfig.txt ./patchconfig.txt | |
168 | ||
b75a7d8f A |
169 | ################################# |
170 | # Cleaning | |
171 | ################################# | |
172 | ||
173 | #We need to clean after installing. | |
174 | ||
175 | EXTRA_CLEAN = | |
176 | ||
177 | # Some directories aren't cleaned recursively. Clean them manually... | |
178 | MANUAL_CLEAN_TOOLS = ./tools/dumpce | |
179 | MANUAL_CLEAN_EXTRA = ./extra/scrptrun ./samples/layout ./extra/ustdio ./extra | |
180 | MANUAL_CLEAN_TEST = ./test/collperf ./test/iotest ./test/letest ./test/thaitest ./test/threadtest ./test/testmap ./test | |
181 | MANUAL_CLEAN_SAMPLE = ./samples/layout ./samples | |
182 | ||
73c04bcf | 183 | CLEAN_SUBDIR = ./stubdata ./common ./i18n ./io ./layout ./layoutex ./data ./tools ./$(MANUAL_CLEAN_TOOLS) $(MANUAL_CLEAN_EXTRA) $(MANUAL_CLEAN_TEST) $(MANUAL_CLEAN_SAMPLE) |
b75a7d8f A |
184 | |
185 | ################################# | |
186 | # Config flags | |
187 | ################################# | |
188 | ||
46f4442e | 189 | ifeq "$(APPLE_EMBEDDED)" "YES" |
73c04bcf A |
190 | CONFIG_FLAGS = --disable-renaming --disable-extras --disable-icuio --disable-layout \ |
191 | --disable-samples --with-data-packaging=archive --prefix=$(PRIVATE_HDR_PREFIX) \ | |
192 | $(DRAFT_FLAG) --srcdir=$(SRCROOT)/icuSources | |
193 | else ifeq "$(WINDOWS)" "YES" | |
194 | CONFIG_FLAGS = --disable-extras --disable-icuio --disable-layout \ | |
195 | --disable-samples --with-data-packaging=library --prefix=$(PRIVATE_HDR_PREFIX) \ | |
196 | $(DRAFT_FLAG) | |
197 | else | |
198 | CONFIG_FLAGS = --disable-renaming --disable-extras --disable-layout \ | |
199 | --disable-samples --with-data-packaging=archive --prefix=$(PRIVATE_HDR_PREFIX) \ | |
200 | $(DRAFT_FLAG) --srcdir=$(SRCROOT)/icuSources | |
201 | endif | |
b75a7d8f A |
202 | |
203 | ################################# | |
204 | # Install paths | |
205 | ################################# | |
206 | ||
207 | # This may or may not be an appropriate name for the icu dylib. This naming scheme is | |
208 | # an attempt to follow the icu convention in naming the dylib and then having symbolic | |
209 | # links of easier to remember library names point it it. *UPDATE* the version and | |
210 | # sub-version variables as needed. The Core version should be 'A' until the core | |
211 | # version changes it's API...that is a new version isn't backwards compatible. | |
212 | # The ICU version/subversion should reflect the actual ICU version. | |
213 | ||
374ca955 | 214 | LIB_NAME = icucore |
46f4442e | 215 | ICU_VERS = 40 |
b75a7d8f A |
216 | ICU_SUBVERS = 0 |
217 | CORE_VERS = A | |
b75a7d8f | 218 | |
73c04bcf A |
219 | ifeq "$(WINDOWS)" "YES" |
220 | DYLIB_SUFF = dll | |
221 | libdir = /AppleInternal/bin/ | |
222 | winlibdir = /AppleInternal/lib/ | |
223 | else | |
224 | DYLIB_SUFF = dylib | |
225 | libdir = /usr/lib/ | |
226 | winlibdir = | |
227 | endif | |
228 | ||
374ca955 | 229 | DYLIB = lib$(LIB_NAME).$(DYLIB_SUFF) |
73c04bcf A |
230 | DYLIB_DEBUG = lib$(LIB_NAME)_debug.$(DYLIB_SUFF) |
231 | DYLIB_PROFILE = lib$(LIB_NAME)_profile.$(DYLIB_SUFF) | |
232 | ifeq "$(WINDOWS)" "YES" | |
233 | INSTALLED_DYLIB = $(LIB_NAME).$(DYLIB_SUFF) | |
234 | INSTALLED_DYLIB_DEBUG = $(LIB_NAME)_debug.$(DYLIB_SUFF) | |
235 | INSTALLED_DYLIB_PROFILE = $(LIB_NAME)_profile.$(DYLIB_SUFF) | |
236 | else | |
237 | INSTALLED_DYLIB = lib$(LIB_NAME).$(CORE_VERS).$(DYLIB_SUFF) | |
238 | INSTALLED_DYLIB_DEBUG = lib$(LIB_NAME).$(CORE_VERS)_debug.$(DYLIB_SUFF) | |
239 | INSTALLED_DYLIB_PROFILE = lib$(LIB_NAME).$(CORE_VERS)_profile.$(DYLIB_SUFF) | |
240 | endif | |
241 | ||
242 | INSTALLED_DYLIB_icu = INSTALLED_DYLIB | |
243 | INSTALLED_DYLIB_debug = INSTALLED_DYLIB_DEBUG | |
244 | INSTALLED_DYLIB_profile = INSTALLED_DYLIB_PROFILE | |
245 | DYLIB_icu = DYLIB | |
246 | DYLIB_debug = DYLIB_DEBUG | |
247 | DYLIB_profile = DYLIB_PROFILE | |
b75a7d8f A |
248 | |
249 | ################################# | |
250 | # Data files | |
251 | ################################# | |
252 | ||
253 | datadir=/usr/share/icu/ | |
374ca955 A |
254 | OPEN_SOURCE_VERSIONS_DIR=/usr/local/OpenSourceVersions/ |
255 | OPEN_SOURCE_LICENSES_DIR=/usr/local/OpenSourceLicenses/ | |
256 | ICU_DATA_DIR= data/out | |
b75a7d8f A |
257 | B_DATA_FILE=icudt$(ICU_VERS)b.dat |
258 | L_DATA_FILE=icudt$(ICU_VERS)l.dat | |
259 | ||
374ca955 A |
260 | ################################# |
261 | # Environment variables | |
262 | ################################# | |
263 | ||
264 | # $(RC_ARCHS:%=-arch %) is a substitution reference. It denotes, in this case, | |
265 | # for every value <val> in RC_ARCHS, replace it with "-arch <val>". Substitution | |
266 | # references have the form $(var:a=b). We can insert the strip and prebinding commands | |
267 | # into CFLAGS (and CXXFLAGS). This controls a lot of the external variables so we don't | |
268 | # need to directly modify the ICU files (like for CFLAGS, etc). | |
269 | ||
270 | LIBOVERRIDES=LIBICUDT="-L$(OBJROOT) -l$(LIB_NAME)" \ | |
271 | LIBICUUC="-L$(OBJROOT) -l$(LIB_NAME)" \ | |
272 | LIBICUI18N="-L$(OBJROOT) -l$(LIB_NAME)" | |
273 | ||
46f4442e A |
274 | # For normal Windows builds set the ENV= options here; for debug Windows builds set the ENV_DEBUG= |
275 | # options here and also the update the LINK.EXE lines in the TARGETS section below. | |
73c04bcf A |
276 | ifeq "$(WINDOWS)" "YES" |
277 | ifeq "$(ICU_BUILD)" "0" | |
278 | CPPOPTIONS = | |
279 | else | |
280 | CPPOPTIONS = CPPFLAGS="-DU_ICU_VERSION_BUILDLEVEL_NUM=$(ICU_BUILD)" | |
281 | endif | |
46f4442e A |
282 | ENV= 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" LDFLAGS="/NXCOMPAT /SAFESEH /DYNAMICBASE" |
283 | 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" | |
284 | 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" LDFLAGS="/DEBUG" | |
73c04bcf A |
285 | ENV_PROFILE= |
286 | else | |
287 | ifeq "$(ICU_BUILD)" "0" | |
288 | CPPOPTIONS = CPPFLAGS="-DSTD_INSPIRED -DMAC_OS_X_VERSION_MIN_REQUIRED=1040" | |
289 | else | |
290 | CPPOPTIONS = CPPFLAGS="-DU_ICU_VERSION_BUILDLEVEL_NUM=$(ICU_BUILD) -DSTD_INSPIRED -DMAC_OS_X_VERSION_MIN_REQUIRED=1040" | |
291 | endif | |
292 | ENV= APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \ | |
46f4442e A |
293 | CFLAGS="-DICU_DATA_DIR=\"\\\"/usr/share/icu/\\\"\" $(RC_ARCHS:%=-arch %) -g -Os -fno-exceptions -fvisibility=hidden $(ISYSROOT) $(THUMB_FLAG)" \ |
294 | CXXFLAGS="-DICU_DATA_DIR=\"\\\"/usr/share/icu/\\\"\" $(RC_ARCHS:%=-arch %) -g -Os -fno-exceptions -fno-rtti -fvisibility=hidden -fvisibility-inlines-hidden $(ISYSROOT) $(THUMB_FLAG)" \ | |
73c04bcf A |
295 | RC_ARCHS="$(RC_ARCHS)" \ |
296 | TZDATA="$(TZDATA)" \ | |
46f4442e | 297 | DYLD_LIBRARY_PATH="$(DEST_ROOT)/usr/local/lib" |
73c04bcf A |
298 | |
299 | ENV_CONFIGURE= $(CPPOPTIONS) APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \ | |
46f4442e A |
300 | CFLAGS="-DICU_DATA_DIR=\"\\\"/usr/share/icu/\\\"\" -g -Os -fno-exceptions -fvisibility=hidden $(ISYSROOT) $(THUMB_FLAG)" \ |
301 | CXXFLAGS="-DICU_DATA_DIR=\"\\\"/usr/share/icu/\\\"\" -g -Os -fno-exceptions -fno-rtti -fvisibility=hidden -fvisibility-inlines-hidden $(ISYSROOT) $(THUMB_FLAG)" \ | |
73c04bcf A |
302 | RC_ARCHS="$(RC_ARCHS)" \ |
303 | TZDATA="$(TZDATA)" \ | |
46f4442e | 304 | DYLD_LIBRARY_PATH="$(DEST_ROOT)/usr/local/lib" |
73c04bcf A |
305 | |
306 | ENV_DEBUG = APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \ | |
46f4442e A |
307 | CFLAGS="-DICU_DATA_DIR=\"\\\"/usr/share/icu/\\\"\" $(RC_ARCHS:%=-arch %) -O0 -gfull -fno-exceptions -fvisibility=hidden $(ISYSROOT) $(THUMB_FLAG)" \ |
308 | CXXFLAGS="-DICU_DATA_DIR=\"\\\"/usr/share/icu/\\\"\" $(RC_ARCHS:%=-arch %) -O0 -gfull -fno-exceptions -fno-rtti -fvisibility=hidden -fvisibility-inlines-hidden $(ISYSROOT) $(THUMB_FLAG)" \ | |
73c04bcf A |
309 | RC_ARCHS="$(RC_ARCHS)" \ |
310 | TZDATA="$(TZDATA)" \ | |
46f4442e | 311 | DYLD_LIBRARY_PATH="$(DEST_ROOT)/usr/local/lib" |
73c04bcf A |
312 | |
313 | ENV_PROFILE = APPLE_INTERNAL_DIR="$(APPLE_INTERNAL_DIR)" \ | |
46f4442e A |
314 | CFLAGS="-DICU_DATA_DIR=\"\\\"/usr/share/icu/\\\"\" $(RC_ARCHS:%=-arch %) -g -Os -pg -fno-exceptions -fvisibility=hidden $(ISYSROOT) $(THUMB_FLAG)" \ |
315 | CXXFLAGS="-DICU_DATA_DIR=\"\\\"/usr/share/icu/\\\"\" $(RC_ARCHS:%=-arch %) -g -Os -pg -fno-exceptions -fno-rtti -fvisibility=hidden -fvisibility-inlines-hidden $(ISYSROOT) $(THUMB_FLAG)" \ | |
73c04bcf A |
316 | RC_ARCHS="$(RC_ARCHS)" \ |
317 | TZDATA="$(TZDATA)" \ | |
46f4442e | 318 | DYLD_LIBRARY_PATH="$(DEST_ROOT)/usr/local/lib" |
73c04bcf | 319 | endif |
374ca955 | 320 | |
374ca955 A |
321 | ENV_icu = ENV |
322 | ENV_debug = ENV_DEBUG | |
73c04bcf | 323 | ENV_profile = ENV_PROFILE |
374ca955 | 324 | |
46f4442e A |
325 | ifeq "$(APPLE_EMBEDDED)" "YES" |
326 | ORDERFILE=$(SRCROOT)/ICU_embedded.order | |
327 | else | |
328 | ORDERFILE=/usr/local/lib/OrderFiles/libicucore.order | |
329 | endif | |
374ca955 A |
330 | ifeq "$(shell test -f $(ORDERFILE) && echo YES )" "YES" |
331 | SECTORDER_FLAGS=-sectorder __TEXT __text $(ORDERFILE) | |
332 | else | |
333 | SECTORDER_FLAGS= | |
334 | endif | |
335 | ||
336 | ||
b75a7d8f A |
337 | ################################# |
338 | ################################# | |
339 | # TARGETS | |
340 | ################################# | |
341 | ################################# | |
374ca955 | 342 | |
46f4442e | 343 | .PHONY : icu check installsrc installhdrs installhdrsint clean install debug debug-install |
374ca955 A |
344 | .DELETE_ON_ERROR : |
345 | ||
73c04bcf | 346 | icu debug profile : $(OBJROOT)/Makefile |
374ca955 A |
347 | (cd $(OBJROOT); \ |
348 | $(MAKE) $($(ENV_$@)); \ | |
73c04bcf A |
349 | if test "$(WINDOWS)" = "YES"; then \ |
350 | if test "$@" = "debug"; then \ | |
351 | (cd common; \ | |
352 | LINK.EXE /subsystem:console /DLL /nologo /base:"0x4a800000" /DEBUG \ | |
353 | /IMPLIB:../lib/icuuc_$@.lib /out:../lib/icuuc$(ICU_VERS)_$@.dll *.o \ | |
354 | common.res ../stubdata/icudt.lib advapi32.lib;); \ | |
355 | (cd i18n; \ | |
356 | LINK.EXE /subsystem:console /DLL /nologo /base:"0x4a900000" /DEBUG \ | |
357 | /IMPLIB:../lib/icuin_$@.lib /out:../lib/icuin$(ICU_VERS)_$@.dll *.o \ | |
358 | i18n.res ../lib/icuuc_$@.lib ../stubdata/icudt.lib advapi32.lib;); \ | |
359 | fi; \ | |
374ca955 | 360 | else \ |
73c04bcf | 361 | tmpfile=`mktemp -t weakexternal` || exit 1; \ |
46f4442e | 362 | nm -m $(RC_ARCHS:%=-arch %) $(DYLIB_OBJS) | fgrep "weak external" | fgrep -v "undefined" | sed -e 's/.*weak external[^_]*//' | sort | uniq | cat >$$tmpfile; \ |
73c04bcf A |
363 | $($(ENV_$@)) $(CXX) -current_version $(ICU_VERS).$(ICU_SUBVERS) -compatibility_version 1 -dynamiclib -dynamic \ |
364 | $(RC_ARCHS:%=-arch %) $(CXXFLAGS) $(LDFLAGS) -single_module $(SECTORDER_FLAGS) -unexported_symbols_list $$tmpfile -dead_strip \ | |
365 | -install_name $(libdir)$($(INSTALLED_DYLIB_$@)) -o ./$($(INSTALLED_DYLIB_$@)) $(DYLIB_OBJS); \ | |
366 | if test -f ./$(ICU_DATA_DIR)/$(B_DATA_FILE); then \ | |
367 | ln -fs ./$(ICU_DATA_DIR)/$(B_DATA_FILE); \ | |
368 | else \ | |
369 | DYLD_LIBRARY_PATH="./lib:./stubdata" \ | |
370 | ./bin/icupkg -tb ./$(ICU_DATA_DIR)/$(L_DATA_FILE) $(B_DATA_FILE); \ | |
371 | fi; \ | |
372 | if test -f ./$(ICU_DATA_DIR)/$(L_DATA_FILE); then \ | |
373 | ln -fs ./$(ICU_DATA_DIR)/$(L_DATA_FILE); \ | |
374 | else \ | |
375 | DYLD_LIBRARY_PATH="./lib:./stubdata" \ | |
376 | ./bin/icupkg -tl ./$(ICU_DATA_DIR)/$(B_DATA_FILE) $(L_DATA_FILE); \ | |
377 | fi; \ | |
374ca955 A |
378 | fi; \ |
379 | ); | |
380 | ||
381 | check : icu | |
382 | (cd $(OBJROOT); \ | |
73c04bcf A |
383 | ICU_DATA=$(OBJROOT) $(MAKE) $(ENV) check; \ |
384 | ); | |
385 | ||
386 | check-debug: debug | |
387 | (cd $(OBJROOT); \ | |
388 | ICU_DATA=$(OBJROOT) $(MAKE) $(ENV_DEBUG) check; \ | |
374ca955 A |
389 | ); |
390 | ||
391 | samples: icu | |
392 | (cd $(OBJROOT)/samples; \ | |
393 | $(MAKE) $(ENV_DEBUG) $(LIBOVERRIDES); \ | |
394 | ); | |
395 | ||
396 | extra: icu | |
397 | (cd $(OBJROOT)/extra; \ | |
398 | $(MAKE) $(ENV_DEBUG) $(LIBOVERRIDES); \ | |
399 | ); | |
400 | ||
401 | $(OBJROOT)/Makefile : | |
402 | if test ! -d $(OBJROOT); then \ | |
403 | mkdir -p $(OBJROOT); \ | |
404 | fi; | |
73c04bcf A |
405 | if test "$(WINDOWS)" = "YES"; then \ |
406 | cp -Rpf $(SRCROOT)/icuSources/* $(OBJROOT); \ | |
407 | (cd $(OBJROOT)/data/unidata; mv base_unidata/*.txt .;); \ | |
408 | (cd $(OBJROOT); $(ENV_CONFIGURE) ./runConfigureICU Cygwin/MSVC $(CONFIG_FLAGS);) \ | |
409 | else \ | |
410 | (cd $(OBJROOT); $(ENV_CONFIGURE) $(SRCROOT)/icuSources/runConfigureICU MacOSX $(CONFIG_FLAGS);) \ | |
374ca955 | 411 | fi; |
46f4442e | 412 | if test "$(APPLE_EMBEDDED)" = "YES"; then \ |
73c04bcf A |
413 | (cd $(OBJROOT)/common/unicode/; \ |
414 | cp $(SRCROOT)/icuSources/common/unicode/uconfig.h . ; \ | |
46f4442e | 415 | cp $(SRCROOT)/icuSources/common/unicode/udata.h . ; \ |
73c04bcf A |
416 | patch <$(SRCROOT)/minimalpatchconfig.txt;) \ |
417 | elif test "$(WINDOWS)" = "YES"; then \ | |
418 | (cd $(OBJROOT)/common/unicode/; \ | |
419 | cp $(SRCROOT)/icuSources/common/unicode/uconfig.h . ; \ | |
420 | patch <$(SRCROOT)/windowspatchconfig.txt;) \ | |
421 | else \ | |
422 | (cd $(OBJROOT)/common/unicode/; \ | |
423 | cp $(SRCROOT)/icuSources/common/unicode/uconfig.h . ; \ | |
424 | patch <$(SRCROOT)/patchconfig.txt;) \ | |
425 | fi; \ | |
426 | if test -f $(SRCROOT)/icuSources/common/Makefile.local; then \ | |
427 | cp -p $(SRCROOT)/icuSources/common/Makefile.local $(OBJROOT)/common/ ; \ | |
428 | fi; | |
374ca955 A |
429 | |
430 | ################################# | |
431 | # B&I TARGETS | |
432 | ################################# | |
433 | ||
b75a7d8f A |
434 | # Since our sources are in icuSources (ignore the ICU subdirectory for now), we wish to |
435 | # copy them to somewhere else. We tar it to stdout, cd to the appropriate directory, and | |
436 | # untar from stdin. We then look for all the CVS directories and remove them. We may have | |
437 | # to remove the .cvsignore files also. | |
438 | ||
439 | installsrc : | |
440 | if test ! -d $(SRCROOT); then mkdir $(SRCROOT); fi; | |
441 | if test -d $(SRCROOT)/icuSources ; then rm -rf $(SRCROOT)/icuSources; fi; | |
46f4442e | 442 | tar cf - ./makefile ./ICU.plist ./license.html ./icuSources $(INSTALLSRC_VARFILES) | (cd $(SRCROOT) ; tar xfp -); \ |
b75a7d8f A |
443 | for i in `find $(SRCROOT)/icuSources/ | grep "CVS$$"` ; do \ |
444 | if test -d $$i ; then \ | |
445 | rm -rf $$i; \ | |
446 | fi; \ | |
447 | done | |
448 | for j in `find $(SRCROOT)/icuSources/ | grep ".cvsignore"` ; do \ | |
449 | if test -f $$j ; then \ | |
450 | rm -f $$j; \ | |
451 | fi; \ | |
452 | done | |
453 | ||
46f4442e | 454 | # This works. Just not for ~ in the DEST_ROOT. We run configure first (in case it hasn't |
b75a7d8f A |
455 | # been already). Then we make the install-headers target on specific makefiles (since |
456 | # not every subdirectory/sub-component has a install-headers target). | |
457 | ||
46f4442e A |
458 | # installhdrs should be no-op for RC_INDIGO |
459 | ifeq "$(RC_INDIGO)" "YES" | |
460 | installhdrs : | |
461 | else | |
462 | installhdrs : installhdrsint | |
463 | endif | |
464 | ||
465 | installhdrsint : $(OBJROOT)/Makefile | |
374ca955 | 466 | (cd $(OBJROOT); \ |
73c04bcf | 467 | for subdir in $(HDR_MAKE_SUBDIR); do \ |
46f4442e | 468 | (cd $$subdir; $(MAKE) -e DESTDIR=$(DEST_ROOT) $(ENV) install-headers); \ |
73c04bcf A |
469 | done; \ |
470 | ); | |
374ca955 | 471 | |
b75a7d8f A |
472 | # We run configure and run make first. This generates the .o files. We then link them |
473 | # all up together into libicucore. Then we put it into its install location, create | |
474 | # symbolic links, and then strip the main dylib. Then install the remaining libraries. | |
475 | # We cleanup the sources folder. | |
73c04bcf | 476 | |
46f4442e A |
477 | install : installhdrsint icu |
478 | if test ! -d $(DEST_ROOT)$(libdir)/; then \ | |
479 | $(INSTALL) -d -m 0755 $(DEST_ROOT)$(libdir)/; \ | |
374ca955 | 480 | fi; |
73c04bcf | 481 | if test "$(WINDOWS)" = "YES"; then \ |
46f4442e A |
482 | if test ! -d $(DEST_ROOT)$(winlibdir)/; then \ |
483 | $(INSTALL) -d -m 0755 $(DEST_ROOT)$(winlibdir)/; \ | |
73c04bcf | 484 | fi; \ |
46f4442e A |
485 | $(INSTALL) -b -m 0644 $(OBJROOT)/lib/icuuc.lib $(DEST_ROOT)$(winlibdir)icuuc.lib; \ |
486 | $(INSTALL) -b -m 0644 $(OBJROOT)/lib/icuuc$(ICU_VERS).pdb $(DEST_ROOT)$(libdir)icuuc$(ICU_VERS).pdb; \ | |
487 | $(INSTALL) -b -m 0755 $(OBJROOT)/lib/icuuc$(ICU_VERS).dll $(DEST_ROOT)$(libdir)icuuc$(ICU_VERS).dll; \ | |
488 | $(INSTALL) -b -m 0644 $(OBJROOT)/lib/icuin.lib $(DEST_ROOT)$(winlibdir)icuin.lib; \ | |
489 | $(INSTALL) -b -m 0644 $(OBJROOT)/lib/icuin$(ICU_VERS).pdb $(DEST_ROOT)$(libdir)icuin$(ICU_VERS).pdb; \ | |
490 | $(INSTALL) -b -m 0755 $(OBJROOT)/lib/icuin$(ICU_VERS).dll $(DEST_ROOT)$(libdir)icuin$(ICU_VERS).dll; \ | |
491 | $(INSTALL) -b -m 0755 $(OBJROOT)/lib/icudt$(ICU_VERS).dll $(DEST_ROOT)$(libdir)icudt$(ICU_VERS).dll; \ | |
73c04bcf | 492 | else \ |
46f4442e A |
493 | $(INSTALL) -b -m 0664 $(OBJROOT)/$(INSTALLED_DYLIB) $(DEST_ROOT)$(libdir)$(INSTALLED_DYLIB); \ |
494 | (cd $(DEST_ROOT)$(libdir); \ | |
73c04bcf A |
495 | ln -fs $(INSTALLED_DYLIB) $(DYLIB)); \ |
496 | cp $(OBJROOT)/$(INSTALLED_DYLIB) $(SYMROOT)/$(INSTALLED_DYLIB); \ | |
46f4442e | 497 | strip -x -u -r -S $(DEST_ROOT)$(libdir)$(INSTALLED_DYLIB); \ |
73c04bcf | 498 | for subdir in $(EXTRA_LIBS); do \ |
46f4442e | 499 | (cd $(OBJROOT)/$$subdir; $(MAKE) -e DESTDIR=$(DEST_ROOT) $(ENV) install-library;) \ |
73c04bcf | 500 | done; \ |
46f4442e A |
501 | if test ! -d $(DEST_ROOT)$(datadir)/; then \ |
502 | $(INSTALL) -d -m 0755 $(DEST_ROOT)$(datadir)/; \ | |
73c04bcf A |
503 | fi; \ |
504 | if test -f $(OBJROOT)/$(B_DATA_FILE); then \ | |
46f4442e | 505 | $(INSTALL) -b -m 0644 $(OBJROOT)/$(B_DATA_FILE) $(DEST_ROOT)$(datadir)$(B_DATA_FILE); \ |
73c04bcf A |
506 | fi; \ |
507 | if test -f $(OBJROOT)/$(L_DATA_FILE); then \ | |
46f4442e | 508 | $(INSTALL) -b -m 0644 $(OBJROOT)/$(L_DATA_FILE) $(DEST_ROOT)$(datadir)$(L_DATA_FILE); \ |
73c04bcf | 509 | fi; \ |
46f4442e A |
510 | if test ! -d $(DEST_ROOT)$(OPEN_SOURCE_VERSIONS_DIR)/; then \ |
511 | $(INSTALL) -d -m 0755 $(DEST_ROOT)$(OPEN_SOURCE_VERSIONS_DIR)/; \ | |
73c04bcf | 512 | fi; \ |
46f4442e A |
513 | $(INSTALL) -b -m 0644 $(SRCROOT)/ICU.plist $(DEST_ROOT)$(OPEN_SOURCE_VERSIONS_DIR)ICU.plist; \ |
514 | if test ! -d $(DEST_ROOT)$(OPEN_SOURCE_LICENSES_DIR)/; then \ | |
515 | $(INSTALL) -d -m 0755 $(DEST_ROOT)$(OPEN_SOURCE_LICENSES_DIR)/; \ | |
73c04bcf | 516 | fi; \ |
46f4442e | 517 | $(INSTALL) -b -m 0644 $(SRCROOT)/license.html $(DEST_ROOT)$(OPEN_SOURCE_LICENSES_DIR)ICU.html; \ |
b75a7d8f | 518 | fi; |
73c04bcf A |
519 | |
520 | DEPEND_install_debug = debug | |
521 | DEPEND_install_profile = profile | |
522 | ||
523 | .SECONDEXPANSION: | |
524 | install_debug install_profile : $$(DEPEND_$$@) | |
46f4442e A |
525 | if test ! -d $(DEST_ROOT)$(libdir)/; then \ |
526 | $(INSTALL) -d -m 0755 $(DEST_ROOT)$(libdir)/; \ | |
b75a7d8f | 527 | fi; |
73c04bcf | 528 | if test "$(WINDOWS)" = "YES"; then \ |
46f4442e A |
529 | if test ! -d $(DEST_ROOT)$(winlibdir)/; then \ |
530 | $(INSTALL) -d -m 0755 $(DEST_ROOT)$(winlibdir)/; \ | |
73c04bcf | 531 | fi; \ |
46f4442e A |
532 | $(INSTALL) -b -m 0644 $(OBJROOT)/lib/icuuc_$(DEPEND_$@).lib $(DEST_ROOT)$(winlibdir)icuuc_$(DEPEND_$@).lib; \ |
533 | $(INSTALL) -b -m 0644 $(OBJROOT)/lib/icuuc$(ICU_VERS)_$(DEPEND_$@).pdb $(DEST_ROOT)$(libdir)icuuc$(ICU_VERS)_$(DEPEND_$@).pdb; \ | |
534 | $(INSTALL) -b -m 0755 $(OBJROOT)/lib/icuuc$(ICU_VERS)_$(DEPEND_$@).dll $(DEST_ROOT)$(libdir)icuuc$(ICU_VERS)_$(DEPEND_$@).dll; \ | |
535 | $(INSTALL) -b -m 0644 $(OBJROOT)/lib/icuin_$(DEPEND_$@).lib $(DEST_ROOT)$(winlibdir)icuin_$(DEPEND_$@).lib; \ | |
536 | $(INSTALL) -b -m 0644 $(OBJROOT)/lib/icuin$(ICU_VERS)_$(DEPEND_$@).pdb $(DEST_ROOT)$(libdir)icuin$(ICU_VERS)_$(DEPEND_$@).pdb; \ | |
537 | $(INSTALL) -b -m 0755 $(OBJROOT)/lib/icuin$(ICU_VERS)_$(DEPEND_$@).dll $(DEST_ROOT)$(libdir)icuin$(ICU_VERS)_$(DEPEND_$@).dll; \ | |
73c04bcf | 538 | else \ |
46f4442e A |
539 | $(INSTALL) -b -m 0664 $(OBJROOT)/$($(INSTALLED_DYLIB_$(DEPEND_$@))) $(DEST_ROOT)$(libdir)$($(INSTALLED_DYLIB_$(DEPEND_$@))); \ |
540 | (cd $(DEST_ROOT)$(libdir); \ | |
73c04bcf A |
541 | ln -fs $($(INSTALLED_DYLIB_$(DEPEND_$@))) $($(DYLIB_$(DEPEND_$@)))); \ |
542 | cp $(OBJROOT)/$($(INSTALLED_DYLIB_$(DEPEND_$@))) $(SYMROOT)/$($(INSTALLED_DYLIB_$(DEPEND_$@))); \ | |
46f4442e | 543 | strip -x -u -r -S $(DEST_ROOT)$(libdir)$($(INSTALLED_DYLIB_$(DEPEND_$@))); \ |
73c04bcf | 544 | for subdir in $(EXTRA_LIBS); do \ |
46f4442e | 545 | (cd $(OBJROOT)/$$subdir; $(MAKE) -e DESTDIR=$(DEST_ROOT) $(ENV) install-library;) \ |
73c04bcf | 546 | done; \ |
b75a7d8f | 547 | fi; |
b75a7d8f | 548 | |
374ca955 A |
549 | clean : |
550 | -rm -rf $(OBJROOT) | |
73c04bcf | 551 |