|
1 # This Source Code Form is subject to the terms of the Mozilla Public |
|
2 # License, v. 2.0. If a copy of the MPL was not distributed with this |
|
3 # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
|
4 |
|
5 STANDALONE_MAKEFILE = 1 |
|
6 |
|
7 # Ensure that this happens before including rules.mk |
|
8 ifdef ENABLE_INTL_API |
|
9 ifndef MOZ_NATIVE_ICU |
|
10 # Library names: On Windows, ICU uses modified library names for static |
|
11 # and debug libraries. |
|
12 ifeq ($(OS_ARCH),WINNT) |
|
13 ifdef MOZ_DEBUG |
|
14 ICU_LIB_SUFFIX=d |
|
15 endif |
|
16 endif # WINNT |
|
17 ifdef MOZ_SHARED_ICU |
|
18 ifeq ($(OS_ARCH),WINNT) |
|
19 ifdef JS_SHARED_LIBRARY |
|
20 ICU_FILES := $(foreach libname,$(ICU_LIB_NAMES),$(DEPTH)/intl/icu/target/lib/$(libname)$(ICU_LIB_SUFFIX)$(MOZ_ICU_VERSION).dll) |
|
21 endif |
|
22 else # ! WINNT |
|
23 ifeq ($(OS_ARCH),Darwin) |
|
24 ifdef JS_SHARED_LIBRARY |
|
25 ICU_FILES := $(foreach libname,$(ICU_LIB_NAMES),$(DEPTH)/intl/icu/target/lib/$(DLL_PREFIX)$(libname).$(MOZ_ICU_VERSION)$(DLL_SUFFIX)) |
|
26 endif |
|
27 else # ! Darwin |
|
28 ifdef JS_SHARED_LIBRARY |
|
29 ICU_FILES := $(foreach libname,$(ICU_LIB_NAMES),$(DEPTH)/intl/icu/target/lib/$(DLL_PREFIX)$(libname)$(DLL_SUFFIX).$(MOZ_ICU_VERSION)) |
|
30 endif |
|
31 endif |
|
32 endif # WINNT |
|
33 ifdef ICU_FILES |
|
34 ICU_DEST := $(DIST)/bin |
|
35 INSTALL_TARGETS += ICU |
|
36 $(ICU_FILES): buildicu |
|
37 ICU_TARGET := default |
|
38 endif |
|
39 else # !MOZ_SHARED_ICU |
|
40 ifeq ($(OS_ARCH),WINNT) |
|
41 ICU_LIB_RENAME = $(foreach libname,$(ICU_LIB_NAMES),\ |
|
42 cp -p $(DEPTH)/intl/icu/target/lib/s$(libname)$(ICU_LIB_SUFFIX).lib $(DEPTH)/intl/icu/target/lib/$(libname).lib;) |
|
43 endif |
|
44 endif # MOZ_SHARED_ICU |
|
45 endif # !MOZ_NATIVE_ICU |
|
46 endif # ENABLE_INTL_API |
|
47 |
|
48 include $(topsrcdir)/config/rules.mk |
|
49 |
|
50 ifdef ENABLE_INTL_API |
|
51 ifndef MOZ_NATIVE_ICU |
|
52 ifdef .PYMAKE |
|
53 ICU_MAKE = $(GMAKE) |
|
54 else |
|
55 ICU_MAKE = $(MAKE) |
|
56 endif |
|
57 |
|
58 default:: buildicu |
|
59 |
|
60 # - ICU requires GNU make according to its readme.html. pymake can't be used |
|
61 # because it doesn't support order only dependencies. |
|
62 # - Force ICU to use the standard suffix for object files because expandlibs |
|
63 # will discard all files with a non-standard suffix (bug 857450). |
|
64 # - Options for genrb: -k strict parsing; -R omit collation tailoring rules. |
|
65 buildicu:: |
|
66 # ICU's build system is full of races, so force non-parallel build. |
|
67 ifdef CROSS_COMPILE |
|
68 +$(ICU_MAKE) -j1 -C host STATIC_O=$(OBJ_SUFFIX) GENRBOPTS='-k -R -C' |
|
69 endif |
|
70 +$(ICU_MAKE) -j1 -C target STATIC_O=$(OBJ_SUFFIX) GENRBOPTS='-k -R' |
|
71 $(ICU_LIB_RENAME) |
|
72 |
|
73 distclean clean:: |
|
74 ifdef CROSS_COMPILE |
|
75 +$(ICU_MAKE) -C host $@ STATIC_O=$(OBJ_SUFFIX) |
|
76 endif |
|
77 +$(ICU_MAKE) -C target $@ STATIC_O=$(OBJ_SUFFIX) |
|
78 |
|
79 endif |
|
80 endif |