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