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