]>
Commit | Line | Data |
---|---|---|
1 | # Make definitions that are shared by the different subprojects of ICU. | |
2 | # | |
3 | # Yves Arrouye. | |
4 | # | |
5 | # Copyright (C) 2016 and later: Unicode, Inc. and others. | |
6 | # License & terms of use: http://www.unicode.org/copyright.html | |
7 | # Copyright (C) 2000-2016, International Business Machines Corporation and others. | |
8 | # All Rights Reserved. | |
9 | ||
10 | # | |
11 | # Some of these variables are overridden in the config/mh-* files. | |
12 | # | |
13 | # Please be sure to update config/Makefile.inc.in if you add something here. | |
14 | # | |
15 | ||
16 | # Shell to use | |
17 | ||
18 | SHELL = @SHELL@ | |
19 | ||
20 | # Standard directories | |
21 | ||
22 | prefix = @prefix@ | |
23 | exec_prefix = @exec_prefix@ | |
24 | ||
25 | bindir = @bindir@ | |
26 | sbindir = @sbindir@ | |
27 | datarootdir = @datarootdir@ | |
28 | datadir = @datadir@ | |
29 | libdir = @libdir@ | |
30 | includedir = @includedir@ | |
31 | mandir = @mandir@ | |
32 | sysconfdir = @sysconfdir@ | |
33 | # controls the include of $(top_builddir)/icucross.mk at bottom of file | |
34 | cross_compiling = @cross_compiling@ | |
35 | cross_buildroot = @cross_buildroot@ | |
36 | ||
37 | # Package information | |
38 | ||
39 | PACKAGE_ICU_DESCRIPTION = "International Components for Unicode" | |
40 | PACKAGE_ICU_URL = "http://icu-project.org" | |
41 | PACKAGE = @PACKAGE@ | |
42 | VERSION = @VERSION@ | |
43 | UNICODE_VERSION = @UNICODE_VERSION@ | |
44 | SO_TARGET_VERSION = @LIB_VERSION@ | |
45 | SO_TARGET_VERSION_MAJOR = @LIB_VERSION_MAJOR@ | |
46 | ||
47 | # The ICU data external name is usually icudata; the entry point name is | |
48 | # the version-dependent name (for no particular reason except it was easier | |
49 | # to change the build this way). When building in common mode, the data | |
50 | # name is the versioned platform-dependent one. | |
51 | ||
52 | ICUDATA_DIR = @pkgicudatadir@/$(PACKAGE)$(ICULIBSUFFIX)/$(VERSION) | |
53 | ||
54 | ICUDATA_BASENAME_VERSION = $(ICUPREFIX)dt@LIB_VERSION_MAJOR@ | |
55 | # the entry point is almost like the basename, but has the lib suffix. | |
56 | ICUDATA_ENTRY_POINT = $(ICUPREFIX)dt@ICULIBSUFFIXCNAME@@LIB_VERSION_MAJOR@ | |
57 | ICUDATA_CHAR = @ICUDATA_CHAR@ | |
58 | ICUDATA_PLATFORM_NAME = $(ICUDATA_BASENAME_VERSION)$(ICUDATA_CHAR) | |
59 | PKGDATA_LIBSTATICNAME = -L $(STATIC_PREFIX)$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX) | |
60 | ifeq ($(strip $(PKGDATA_MODE)),) | |
61 | PKGDATA_MODE=@DATA_PACKAGING_MODE@ | |
62 | endif | |
63 | ifeq ($(PKGDATA_MODE),common) | |
64 | ICUDATA_NAME = $(ICUDATA_PLATFORM_NAME) | |
65 | ICUPKGDATA_DIR = $(ICUDATA_DIR) | |
66 | else | |
67 | ifeq ($(PKGDATA_MODE),dll) | |
68 | ICUDATA_NAME = $(ICUDATA_PLATFORM_NAME) | |
69 | PKGDATA_LIBNAME = -L $(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX) | |
70 | ICUPKGDATA_DIR = $(libdir) | |
71 | else | |
72 | ifeq ($(PKGDATA_MODE),static) | |
73 | ICUDATA_NAME = $(ICUDATA_PLATFORM_NAME) | |
74 | PKGDATA_LIBNAME = -L $(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX) | |
75 | ICUPKGDATA_DIR = $(libdir) | |
76 | else | |
77 | ICUDATA_NAME = $(ICUDATA_PLATFORM_NAME) | |
78 | ICUPKGDATA_DIR = $(ICUDATA_DIR) | |
79 | endif | |
80 | endif | |
81 | endif | |
82 | ||
83 | # These are defined here because mh-cygwin-msvc needs to override these values. | |
84 | ICUPKGDATA_INSTALL_DIR = $(DESTDIR)$(ICUPKGDATA_DIR) | |
85 | ICUPKGDATA_INSTALL_LIBDIR = $(DESTDIR)$(libdir) | |
86 | ||
87 | # If defined to a valid value, pkgdata will generate a data library more quickly | |
88 | GENCCODE_ASSEMBLY = @GENCCODE_ASSEMBLY@ | |
89 | ||
90 | # ICU specific directories | |
91 | ||
92 | pkgdatadir = $(datadir)/$(PACKAGE)$(ICULIBSUFFIX)/$(VERSION) | |
93 | pkglibdir = $(libdir)/$(PACKAGE)$(ICULIBSUFFIX)/$(VERSION) | |
94 | pkgsysconfdir = $(sysconfdir)/$(PACKAGE)$(ICULIBSUFFIX) | |
95 | ||
96 | # Installation programs | |
97 | ||
98 | MKINSTALLDIRS = $(SHELL) $(top_srcdir)/mkinstalldirs | |
99 | ||
100 | INSTALL = @INSTALL@ | |
101 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ | |
102 | INSTALL_DATA = @INSTALL_DATA@ | |
103 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ | |
104 | ||
105 | # Library suffix (to support different C++ compilers) | |
106 | ||
107 | ICULIBSUFFIX=@ICULIBSUFFIX@ | |
108 | ||
109 | # Compiler and tools | |
110 | ||
111 | ENABLE_DEBUG = @ENABLE_DEBUG@ | |
112 | ENABLE_RELEASE = @ENABLE_RELEASE@ | |
113 | EXEEXT = @EXEEXT@ | |
114 | CC = @CC@ | |
115 | CXX = @CXX@ | |
116 | AR = @AR@ | |
117 | ARFLAGS = @ARFLAGS@ r | |
118 | RANLIB = @RANLIB@ | |
119 | COMPILE_LINK_ENVVAR = @COMPILE_LINK_ENVVAR@ | |
120 | UCLN_NO_AUTO_CLEANUP = @UCLN_NO_AUTO_CLEANUP@ | |
121 | SED = @SED@ | |
122 | ||
123 | # Various flags for the tools | |
124 | ||
125 | # DEFS is for common macro definitions. | |
126 | # configure prevents user defined DEFS, and configure's DEFS is not needed | |
127 | # So we ignore the DEFS that comes from configure | |
128 | # U_ATTRIBUTE_DEPRECATED is defined to hide warnings about deprecated API warnings. | |
129 | DEFS = -DU_ATTRIBUTE_DEPRECATED= | |
130 | # CFLAGS is for C only flags | |
131 | CFLAGS = @CFLAGS@ | |
132 | # CXXFLAGS is for C++ only flags | |
133 | CXXFLAGS = @CXXFLAGS@ | |
134 | # CPPFLAGS is for C Pre-Processor flags | |
135 | CPPFLAGS = @CPPFLAGS@ | |
136 | # LIBCFLAGS are the flags for static and shared libraries. | |
137 | LIBCFLAGS = @LIBCFLAGS@ | |
138 | # LIBCXXFLAGS are the flags for static and shared libraries. | |
139 | LIBCXXFLAGS = @LIBCXXFLAGS@ | |
140 | # DEFAULT_LIBS are the default libraries to link against | |
141 | DEFAULT_LIBS = @LIBS@ | |
142 | # LIB_M is for linking against the math library | |
143 | LIB_M = @LIB_M@ | |
144 | # LIB_THREAD is for linking against the threading library | |
145 | LIB_THREAD = @LIB_THREAD@ | |
146 | # OUTOPT is for creating a specific output name | |
147 | OUTOPT = -o # The extra space after the argument is needed. | |
148 | # AR_OUTOPT is for creating a specific output name for static libraries. | |
149 | AR_OUTOPT = | |
150 | ||
151 | ENABLE_RPATH = @ENABLE_RPATH@ | |
152 | ifeq ($(ENABLE_RPATH),YES) | |
153 | RPATHLDFLAGS = $(LD_RPATH)$(LD_RPATH_PRE)$(libdir) | |
154 | endif | |
155 | LDFLAGS = @LDFLAGS@ $(RPATHLDFLAGS) | |
156 | ||
157 | # What kind of libraries are we building and linking against? | |
158 | ENABLE_STATIC = @ENABLE_STATIC@ | |
159 | ENABLE_SHARED = @ENABLE_SHARED@ | |
160 | ||
161 | # Echo w/o newline | |
162 | ||
163 | #ECHO_N = @ICU_ECHO_N@ | |
164 | #ECHO_C = @ICU_ECHO_C@ | |
165 | ||
166 | # Commands to compile | |
167 | COMPILE.c= $(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) -c | |
168 | COMPILE.cc= $(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) -c | |
169 | ||
170 | # Commands to link | |
171 | LINK.c= $(CC) $(CFLAGS) $(LDFLAGS) $(LINKFLAGS) | |
172 | LINK.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) $(LINKFLAGS) | |
173 | ||
174 | # Commands to make a shared library | |
175 | SHLIB.c= $(CC) $(CFLAGS) $(LDFLAGS) -shared $(LD_SOOPTIONS) | |
176 | SHLIB.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(LD_SOOPTIONS) | |
177 | ||
178 | # ICU_MSG | |
179 | ICU_MSG=@echo " $(1) " | |
180 | ||
181 | # Do not show the large compiling arguments by default. | |
182 | # To use: | |
183 | # change | |
184 | # $(CC) -o foo | |
185 | # to | |
186 | # $(call SILENT_COMPILE,$(CC) -o foo) | |
187 | ifndef VERBOSE | |
188 | SILENT_COMPILE=$(call ICU_MSG,$(notdir $(firstword $(1)))) "... " $< && $(1) || \ | |
189 | ( echo "*** Failed compilation command follows: ----------------------------------------------------------" ; \ | |
190 | echo "$(1)" ; \ | |
191 | echo "--- ( rebuild with \"$(MAKE) VERBOSE=1 $(MAKECMDGOALS)\" to show all parameters ) --------" ; \ | |
192 | false ) | |
193 | else | |
194 | SILENT_COMPILE=$(1) | |
195 | endif | |
196 | ||
197 | # Environment variable to set a runtime search path | |
198 | LDLIBRARYPATH_ENVVAR = LD_LIBRARY_PATH | |
199 | ||
200 | # Versioned target for a shared library. | |
201 | FINAL_SO_TARGET = $(SO_TARGET).$(SO_TARGET_VERSION) | |
202 | MIDDLE_SO_TARGET = $(SO_TARGET).$(SO_TARGET_VERSION_MAJOR) | |
203 | SHARED_OBJECT = $(FINAL_SO_TARGET) | |
204 | ||
205 | ## How ICU libraries are named... ex. $(LIBICU)uc$(SO) | |
206 | # Prefix for the ICU library names | |
207 | ICUPREFIX = icu | |
208 | LIBPREFIX = lib | |
209 | LIBICU = $(LIBPREFIX)$(ICUPREFIX) | |
210 | ||
211 | ## If we can't use the shared libraries, use the static libraries | |
212 | ifneq ($(ENABLE_SHARED),YES) | |
213 | STATIC_PREFIX_WHEN_USED = s | |
214 | else | |
215 | STATIC_PREFIX_WHEN_USED = | |
216 | endif | |
217 | ||
218 | # Static library prefix and file extension | |
219 | STATIC_PREFIX = s | |
220 | LIBSICU = $(LIBPREFIX)$(STATIC_PREFIX)$(ICUPREFIX) | |
221 | A = a | |
222 | SOBJ = $(SO) | |
223 | ||
224 | # Force removal [for make clean] | |
225 | RMV = rm -rf | |
226 | ||
227 | # Platform commands to remove or move executable and library targets | |
228 | # INSTALL-L installs libraries. Override in mh-* file to INSTALL_PROGRAM | |
229 | # when the library needs to have executable permissions | |
230 | INSTALL-S = $(INSTALL_PROGRAM) | |
231 | INSTALL-L = $(INSTALL_PROGRAM) | |
232 | #INSTALL-L = $(INSTALL_DATA) | |
233 | ||
234 | # Location of the libraries before "make install" is used | |
235 | LIBDIR=$(top_builddir)/lib | |
236 | ||
237 | # Location of the executables before "make install" is used | |
238 | BINDIR=$(top_builddir)/bin | |
239 | ||
240 | # overridden by icucross.mk | |
241 | TOOLBINDIR=$(BINDIR) | |
242 | TOOLLIBDIR=$(LIBDIR) | |
243 | ||
244 | # Name flexibility for the library naming scheme. Any modifications should | |
245 | # be made in the mh- file for the specific platform. | |
246 | DATA_STUBNAME = data | |
247 | COMMON_STUBNAME = uc | |
248 | I18N_STUBNAME = i18n | |
249 | LAYOUTEX_STUBNAME = lx | |
250 | IO_STUBNAME = io | |
251 | TOOLUTIL_STUBNAME = tu | |
252 | CTESTFW_STUBNAME = test | |
253 | ||
254 | # get these from pkg-config, if available | |
255 | ICULEHB_CFLAGS=@ICULEHB_CFLAGS@ | |
256 | ICULEHB_LIBS=@ICULEHB_LIBS@ | |
257 | ifneq ($(ICULEHB_CFLAGS),) | |
258 | USING_ICULEHB=yes | |
259 | ICULEHB_TRUE= | |
260 | ICULEHB_FALSE=# | |
261 | ICULIBS_LE=$(ICULEHB_LIBS) | |
262 | ICULE_CFLAGS=$(ICULEHB_CFLAGS) -DUSING_ICULEHB | |
263 | else | |
264 | USING_ICULEHB=no | |
265 | ICULEHB_TRUE=# | |
266 | ICULEHB_FALSE= | |
267 | endif | |
268 | ||
269 | # Just the libs. | |
270 | ICULIBS_DT = -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX) | |
271 | ICULIBS_UC = -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(COMMON_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX) | |
272 | ICULIBS_I18N = -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(I18N_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX) | |
273 | ICULIBS_LX = -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(LAYOUTEX_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX) | |
274 | ICULIBS_IO = -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(IO_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX) | |
275 | ICULIBS_CTESTFW = -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(CTESTFW_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX) | |
276 | ICULIBS_TOOLUTIL = -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(TOOLUTIL_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX) | |
277 | # Link commands to link to ICU libs | |
278 | LLIBDIR = -L$(LIBDIR) | |
279 | LSTUBDIR = -L$(top_builddir)/stubdata | |
280 | LCTESTFW = -L$(top_builddir)/tools/ctestfw | |
281 | ||
282 | LIBICUDT = $(LLIBDIR) $(LSTUBDIR) $(ICULIBS_DT) | |
283 | LIBICUUC = $(LLIBDIR) $(ICULIBS_UC) $(LSTUBDIR) $(ICULIBS_DT) | |
284 | LIBICUI18N = $(LLIBDIR) $(ICULIBS_I18N) | |
285 | LIBICULE = $(ICULEHB_CFLAGS) $(LLIBDIR) $(ICULIBS_LE) | |
286 | LIBICULX = $(LLIBDIR) $(ICULIBS_LX) | |
287 | LIBCTESTFW = $(LCTESTFW) $(ICULIBS_CTESTFW) | |
288 | LIBICUTOOLUTIL = $(LLIBDIR) $(ICULIBS_TOOLUTIL) | |
289 | LIBICUIO = $(LLIBDIR) $(ICULIBS_IO) | |
290 | ||
291 | # Invoke, set library path for all ICU libraries. | |
292 | # overridden by icucross.mk | |
293 | INVOKE = $(LDLIBRARYPATH_ENVVAR)=$(LIBRARY_PATH_PREFIX)$(LIBDIR):$(top_builddir)/stubdata:$(top_builddir)/tools/ctestfw:$$$(LDLIBRARYPATH_ENVVAR) $(LEAK_CHECKER) | |
294 | # prefer stubdata | |
295 | PKGDATA_INVOKE = $(LDLIBRARYPATH_ENVVAR)=$(top_builddir)/stubdata:$(top_builddir)/tools/ctestfw:$(LIBRARY_PATH_PREFIX)$(LIBDIR):$$$(LDLIBRARYPATH_ENVVAR) $(LEAK_CHECKER) | |
296 | INSTALLED_INVOKE = $(LDLIBRARYPATH_ENVVAR)=$(libdir):$$$(LDLIBRARYPATH_ENVVAR) | |
297 | ||
298 | # Current full path directory for cross compilation | |
299 | ifneq ($(strip $(cross_buildroot)),) | |
300 | include $(cross_buildroot)/config/icucross.inc | |
301 | endif | |
302 | ||
303 | # Platform-specific setup | |
304 | include @platform_make_fragment@ | |
305 | ||
306 | # Current full path directory. | |
307 | CURR_FULL_DIR?=$(shell pwd | sed 's/ /\\ /g') | |
308 | # Current full path directory for use in source code in a -D compiler option. | |
309 | CURR_SRCCODE_FULL_DIR?=$(shell pwd | sed 's/ /\\ /') | |
310 | ||
311 | # When shared libraries are disabled and static libraries are enabled, | |
312 | # the C++ compiler must be used to link in the libraries for the tools. | |
313 | ifneq ($(ENABLE_SHARED),YES) | |
314 | LINK.c = $(LINK.cc) | |
315 | endif | |
316 | ||
317 | # some imported things from the cross env | |
318 | TOOLEXEEXT = $(EXEEXT) | |
319 | ifneq ($(strip $(cross_buildroot)),) | |
320 | include $(cross_buildroot)/config/icucross.mk | |
321 | else | |
322 | cross_buildroot = $(top_builddir) | |
323 | endif | |
324 | ||
325 | # for tests | |
326 | ifneq ($(TEST_STATUS_FILE),) | |
327 | TEST_OUTPUT_OPTS="-E$(TEST_STATUS_FILE)" | |
328 | endif | |
329 | ||
330 | # optional include at top | |
331 | -include $(top_builddir)/icudefs.local |