]>
Commit | Line | Data |
---|---|---|
f3c0d7a5 A |
1 | # Copyright (C) 2016 and later: Unicode, Inc. and others. |
2 | # License & terms of use: http://www.unicode.org/copyright.html | |
b75a7d8f A |
3 | ## -*-makefile-*- |
4 | #****************************************************************************** | |
b331163b | 5 | # Copyright (C) 1999-2014, International Business Machines |
b75a7d8f | 6 | # Corporation and others. All Rights Reserved. |
b75a7d8f A |
7 | #****************************************************************************** |
8 | # This Makefile.inc is designed to be included into projects which make use | |
9 | # of the ICU. | |
10 | ||
11 | # CONTENTS OF THIS FILE | |
12 | # 1). Base configuration information and linkage | |
13 | # 2). Variables giving access to ICU tools | |
14 | # 3). Host information | |
15 | # 4). Compiler flags and settings | |
16 | # 5). Data Packaging directives | |
17 | # 6). Include of platform make fragment (mh-* file) | |
18 | ||
19 | ################################################################## | |
20 | ################################################################## | |
21 | # | |
22 | # *1* base configuration information and linkage | |
23 | # | |
24 | ################################################################## | |
25 | # The PREFIX is the base of where ICU is installed. | |
26 | # Inside this directory you should find bin, lib, include/unicode, | |
27 | # etc. If ICU is not installed in this directory, you must change the | |
28 | # following line. There should exist $(prefix)/include/unicode/utypes.h | |
29 | # for example. | |
30 | prefix = @prefix@ | |
31 | exec_prefix = @exec_prefix@ | |
32 | libdir = @libdir@ | |
33 | libexecdir = @libexecdir@ | |
34 | bindir = @bindir@ | |
46f4442e | 35 | datarootdir = @datarootdir@ |
b75a7d8f A |
36 | datadir = @datadir@ |
37 | sbindir = @sbindir@ | |
38 | ||
39 | # about the ICU version | |
40 | VERSION = @VERSION@ | |
41 | UNICODE_VERSION = @UNICODE_VERSION@ | |
42 | ||
43 | # The prefix for ICU libraries, normally 'icu' | |
44 | ICUPREFIX = icu | |
45 | PACKAGE = @PACKAGE@ | |
46 | LIBICU = lib$(ICUPREFIX) | |
47 | ||
374ca955 A |
48 | # Static library prefix and file extension |
49 | STATIC_PREFIX = s | |
50 | LIBSICU = lib$(STATIC_PREFIX)$(ICUPREFIX) | |
51 | A = a | |
52 | ||
b75a7d8f A |
53 | # Suffix at the end of libraries. Usually empty. |
54 | ICULIBSUFFIX = @ICULIBSUFFIX@ | |
55 | # ICULIBSUFFIX_VERSION is non-empty if it is to contain a library | |
56 | # version. For example, if it is 21, it means libraries are named | |
57 | # libicuuc21.so for example. | |
58 | ||
59 | # rpath links a library search path right into the binaries. | |
60 | ## mh-files MUST NOT override RPATHLDFLAGS unless they provide | |
61 | ## equivalent '#SH#' lines for icu-config fixup | |
62 | ENABLE_RPATH = @ENABLE_RPATH@ | |
63 | ifeq ($(ENABLE_RPATH),YES) | |
64 | RPATHLDFLAGS = $(LD_RPATH)$(LD_RPATH_PRE)$(libdir) | |
65 | endif | |
66 | ||
67 | #SH## icu-config version of above 'if': | |
4388f060 A |
68 | #SH#case "x$ENABLE_RPATH" in |
69 | #SH# x[yY]*) | |
b75a7d8f A |
70 | #SH# ENABLE_RPATH=YES |
71 | #SH# RPATHLDFLAGS="${LD_RPATH}${LD_RPATH_PRE}${libdir}" | |
72 | #SH# ;; | |
73 | #SH# | |
4388f060 A |
74 | #SH# x[nN]*) |
75 | #SH# ENABLE_RPATH=NO | |
76 | #SH# RPATHLDFLAGS="" | |
77 | #SH# ;; | |
78 | #SH# | |
79 | #SH# x) | |
b75a7d8f A |
80 | #SH# ENABLE_RPATH=NO |
81 | #SH# RPATHLDFLAGS="" | |
82 | #SH# ;; | |
83 | #SH# | |
84 | #SH# *) | |
85 | #SH# echo $0: Unknown --enable-rpath value ${ENABLE_RPATH} 1>&2 | |
86 | #SH# exit 3 | |
87 | #SH# ;; | |
88 | #SH#esac | |
89 | ||
73c04bcf A |
90 | # Name flexibility for the library naming scheme. Any modifications should |
91 | # be made in the mh- file for the specific platform. | |
92 | DATA_STUBNAME = data | |
93 | COMMON_STUBNAME = uc | |
94 | I18N_STUBNAME = i18n | |
73c04bcf A |
95 | LAYOUTEX_STUBNAME = lx |
96 | IO_STUBNAME = io | |
97 | TOOLUTIL_STUBNAME = tu | |
98 | CTESTFW_STUBNAME = test | |
99 | ||
100 | ||
b75a7d8f A |
101 | |
102 | ### To link your application with ICU: | |
103 | # 1. use LDFLAGS, CFLAGS, etc from above | |
104 | # 2. link with $(ICULIBS) | |
105 | # 3. optionally, add one or more of: | |
106 | # - $(ICULIBS_I18N) - i18n library, formatting, etc. | |
374ca955 | 107 | # - $(ICULIBS_ICUIO) - ICU stdio equivalent library |
b75a7d8f A |
108 | |
109 | ICULIBS_COMMON = -l$(ICUPREFIX)uc$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION) | |
73c04bcf A |
110 | ICULIBS_DATA = -l$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION) |
111 | ICULIBS_I18N = -l$(ICUPREFIX)$(I18N_STUBNAME)$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION) | |
374ca955 | 112 | ICULIBS_TOOLUTIL = -l$(ICUPREFIX)tu$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION) |
b75a7d8f | 113 | ICULIBS_CTESTFW = -l$(ICUPREFIX)ctestfw$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION) |
374ca955 | 114 | ICULIBS_ICUIO = -l$(ICUPREFIX)io$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION) |
b75a7d8f | 115 | ICULIBS_OBSOLETE = -l$(ICUPREFIX)obsolete$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION) |
b75a7d8f | 116 | ICULIBS_LAYOUTEX = -l$(ICUPREFIX)lx$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION) |
57a6839d | 117 | ICULIBS_BASE = -L$(libdir) |
b75a7d8f A |
118 | |
119 | # for icu-config to test with | |
729e4ab9 A |
120 | ICULIBS_COMMON_LIB_NAME = ${LIBICU}${COMMON_STUBNAME}${ICULIBSUFFIX}${ICULIBSUFFIX_VERSION}.${SO} |
121 | ICULIBS_COMMON_LIB_NAME_A = ${LIBICU}${COMMON_STUBNAME}${ICULIBSUFFIX}.${A} | |
b75a7d8f A |
122 | |
123 | # ICULIBS is the set of libraries your application should link | |
124 | # with usually. Many applications will want to add $(ICULIBS_I18N) as well. | |
125 | ICULIBS = $(ICULIBS_BASE) $(ICULIBS_I18N) $(ICULIBS_COMMON) $(ICULIBS_DATA) | |
126 | ||
729e4ab9 A |
127 | # Proper echo newline handling is needed in icu-config |
128 | ECHO_N=@ICU_ECHO_N@ | |
129 | ECHO_C=@ICU_ECHO_C@ | |
130 | # Not currently being used but good to have for proper tab handling | |
131 | ECHO_T=@ICU_ECHO_T@ | |
132 | ||
b75a7d8f A |
133 | ################################################################## |
134 | ################################################################## | |
135 | # | |
136 | # *2* access to ICU tools | |
137 | # | |
138 | ################################################################## | |
139 | # Environment variable to set a runtime search path | |
140 | # (Overridden when necessary in -mh files) | |
141 | LDLIBRARYPATH_ENVVAR = LD_LIBRARY_PATH | |
142 | ||
374ca955 A |
143 | # Versioned target for a shared library |
144 | FINAL_SO_TARGET = $(SO_TARGET).$(SO_TARGET_VERSION) | |
145 | MIDDLE_SO_TARGET = $(SO_TARGET).$(SO_TARGET_VERSION_MAJOR) | |
146 | ||
b75a7d8f A |
147 | # Access to important ICU tools. |
148 | # Use as follows: $(INVOKE) $(GENRB) arguments .. | |
149 | INVOKE = $(LDLIBRARYPATH_ENVVAR)=$(libdir):$$$(LDLIBRARYPATH_ENVVAR) $(LEAK_CHECKER) | |
150 | GENCCODE = $(sbindir)/genccode | |
46f4442e | 151 | ICUPKG = $(sbindir)/icupkg |
b75a7d8f A |
152 | GENCMN = $(sbindir)/gencmn |
153 | GENRB = $(bindir)/genrb | |
154 | PKGDATA = $(bindir)/pkgdata | |
155 | ||
46f4442e A |
156 | # moved here because of dependencies |
157 | pkgdatadir = $(datadir)/$(PACKAGE)$(ICULIBSUFFIX)/$(VERSION) | |
158 | pkglibdir = $(libdir)/$(PACKAGE)$(ICULIBSUFFIX)/$(VERSION) | |
159 | ||
b75a7d8f A |
160 | ################################################################## |
161 | ################################################################## | |
162 | # | |
163 | # *3* Information about the host | |
164 | # | |
165 | ################################################################## | |
166 | ||
167 | # Information about the host that 'configure' was run on. | |
168 | host = @host@ | |
169 | host_alias = @host_alias@ | |
170 | host_cpu = @host_cpu@ | |
171 | host_vendor = @host_vendor@ | |
172 | host_os = @host_os@ | |
173 | # Our platform canonical name (as determined by configure) | |
174 | # this is a #define value (i.e. U_XXXX or XXXX) | |
175 | platform = @platform@ | |
176 | ||
177 | ################################################################## | |
178 | ################################################################## | |
179 | # | |
180 | # *4* compiler flags and misc. options | |
181 | # | |
182 | ################################################################## | |
b75a7d8f | 183 | AR = @AR@ |
73c04bcf A |
184 | # initial tab keeps it out of the shell version. |
185 | ARFLAGS := @ARFLAGS@ $(ARFLAGS) | |
186 | #SH#ARFLAGS="@ARFLAGS@ ${ARFLAGS}" | |
b75a7d8f | 187 | CC = @CC@ |
b75a7d8f | 188 | CPP = @CPP@ |
57a6839d A |
189 | CFLAGS = @UCONFIG_CFLAGS@ |
190 | CPPFLAGS = @UCONFIG_CPPFLAGS@ -I$(prefix)/include | |
191 | CXXFLAGS = @UCONFIG_CXXFLAGS@ | |
b75a7d8f | 192 | CXX = @CXX@ |
b75a7d8f A |
193 | DEFAULT_MODE = @DATA_PACKAGING_MODE@ |
194 | DEFS = @DEFS@ | |
46f4442e A |
195 | # use a consistent INSTALL |
196 | INSTALL = $(SHELL) $(pkgdatadir)/install-sh -c | |
b75a7d8f A |
197 | INSTALL_DATA = @INSTALL_DATA@ |
198 | INSTALL_DATA = @INSTALL_DATA@ | |
199 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ | |
200 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ | |
201 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ | |
57a6839d | 202 | LDFLAGS = $(RPATHLDFLAGS) |
b75a7d8f A |
203 | LIBS = @LIBS@ |
204 | LIB_M = @LIB_M@ | |
205 | LIB_VERSION = @LIB_VERSION@ | |
206 | LIB_VERSION_MAJOR = @LIB_VERSION_MAJOR@ | |
207 | MKINSTALLDIRS = $(SHELL) $(pkgdatadir)/mkinstalldirs | |
208 | RANLIB = @RANLIB@ | |
209 | RMV = rm -rf | |
210 | SHELL = @SHELL@ | |
211 | SHLIB.c= $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -shared | |
212 | SHLIB.cc= $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -shared | |
213 | U_IS_BIG_ENDIAN = @U_IS_BIG_ENDIAN@ | |
214 | includedir = @includedir@ | |
215 | infodir = @infodir@ | |
b75a7d8f A |
216 | localstatedir = @localstatedir@ |
217 | mandir = @mandir@ | |
218 | oldincludedir = @oldincludedir@ | |
219 | program_transform_name = @program_transform_name@ | |
220 | sharedstatedir = @sharedstatedir@ | |
221 | sysconfdir = @sysconfdir@ | |
222 | INSTALL-L = ${INSTALL_DATA} | |
223 | ||
51004dcb A |
224 | # for derivative builds - don't bother with VERBOSE/NONVERBOSE SILENT_COMPILE |
225 | SILENT_COMPILE=$(1) #M# | |
226 | ICU_MSG=@echo " $(1) " #M# | |
b75a7d8f A |
227 | |
228 | ################################################################## | |
229 | ################################################################## | |
230 | # | |
231 | # *5* packaging options and directories | |
232 | # | |
233 | ################################################################## | |
234 | ||
b75a7d8f A |
235 | |
236 | # The basename of the ICU data file (i.e. icudt21b ) | |
73c04bcf | 237 | ICUDATA_CHAR = @ICUDATA_CHAR@ |
b75a7d8f A |
238 | ICUDATA_NAME = icudt@LIB_VERSION_MAJOR@@ICUDATA_CHAR@ |
239 | ||
240 | # Defaults for pkgdata's mode and directories | |
241 | # The default data dir changes depending on what packaging mode | |
242 | # is being used | |
243 | ifeq ($(strip $(PKGDATA_MODE)),) | |
374ca955 A |
244 | #SH# if [ "x$PKGDATA_MODE" = "x" ]; |
245 | #SH# then | |
b75a7d8f | 246 | PKGDATA_MODE=@DATA_PACKAGING_MODE@ |
374ca955 | 247 | #SH# fi |
b75a7d8f | 248 | endif |
374ca955 A |
249 | |
250 | #SH# case "$PKGDATA_MODE" in | |
b75a7d8f | 251 | ifeq ($(PKGDATA_MODE),common) |
374ca955 | 252 | #SH# common) |
b75a7d8f A |
253 | ICUDATA_DIR = $(pkgdatadir) |
254 | ICUPKGDATA_DIR = $(ICUDATA_DIR) | |
374ca955 | 255 | #SH# ;; |
b75a7d8f A |
256 | else |
257 | ifeq ($(PKGDATA_MODE),dll) | |
374ca955 | 258 | #SH# dll) |
b75a7d8f A |
259 | ICUDATA_DIR = $(pkgdatadir) |
260 | ICUPKGDATA_DIR = $(libdir) | |
374ca955 | 261 | #SH# ;; |
b75a7d8f | 262 | else |
374ca955 A |
263 | #SH# *) |
264 | ICUDATA_DIR = $(pkgdatadir) | |
b75a7d8f | 265 | ICUPKGDATA_DIR = $(ICUDATA_DIR) |
374ca955 | 266 | #SH# ;; |
b75a7d8f A |
267 | endif |
268 | endif | |
269 | ||
374ca955 A |
270 | #SH# esac |
271 | ||
272 | GENCCODE_ASSEMBLY = @GENCCODE_ASSEMBLY@ | |
b75a7d8f A |
273 | |
274 | ################################################################## | |
275 | ################################################################## | |
276 | # | |
277 | # *6* Inclusion of platform make fragment (mh-* file) | |
278 | # | |
279 | ################################################################## | |
280 | # The mh- file ("make fragment") for the platform is included here. | |
281 | # It may override the above settings. | |
282 | # It is put last so that the mh-file can override anything. | |
729e4ab9 A |
283 | # The selfcheck is just a sanity check that this makefile is |
284 | # parseable. The mh fragment is only included if this does not occur. | |
b75a7d8f | 285 | |
729e4ab9 A |
286 | ifeq (selfcheck,$(MAKECMDGOALS)) #M# |
287 | selfcheck: #M# | |
288 | @echo passed #M# | |
289 | else #M# | |
b75a7d8f | 290 | include $(pkgdatadir)/config/@platform_make_fragment_name@ |
729e4ab9 | 291 | endif #M# |
b75a7d8f | 292 |