2 #******************************************************************************
3 # Copyright (C) 1999-2013, International Business Machines
4 # Corporation and others. All Rights Reserved.
5 #******************************************************************************
6 # This Makefile.inc is designed to be included into projects which make use
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)
17 ##################################################################
18 ##################################################################
20 # *1* base configuration information and linkage
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
29 exec_prefix = @exec_prefix@
31 libexecdir = @libexecdir@
33 datarootdir = @datarootdir@
37 # about the ICU version
39 UNICODE_VERSION = @UNICODE_VERSION@
41 # The prefix for ICU libraries, normally 'icu'
44 LIBICU = lib$(ICUPREFIX)
46 # Static library prefix and file extension
48 LIBSICU = lib$(STATIC_PREFIX)$(ICUPREFIX)
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.
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)
65 #SH## icu-config version of above 'if':
66 #SH#case "x$ENABLE_RPATH" in
69 #SH# RPATHLDFLAGS="${LD_RPATH}${LD_RPATH_PRE}${libdir}"
83 #SH# echo $0: Unknown --enable-rpath value ${ENABLE_RPATH} 1>&2
88 # Name flexibility for the library naming scheme. Any modifications should
89 # be made in the mh- file for the specific platform.
94 LAYOUTEX_STUBNAME = lx
96 TOOLUTIL_STUBNAME = tu
97 CTESTFW_STUBNAME = test
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.
107 # - $(ICULIBS_ICUIO) - ICU stdio equivalent library
109 ICULIBS_COMMON = -l$(ICUPREFIX)uc$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION)
110 ICULIBS_DATA = -l$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION)
111 ICULIBS_I18N = -l$(ICUPREFIX)$(I18N_STUBNAME)$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION)
112 ICULIBS_TOOLUTIL = -l$(ICUPREFIX)tu$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION)
113 ICULIBS_CTESTFW = -l$(ICUPREFIX)ctestfw$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION)
114 ICULIBS_ICUIO = -l$(ICUPREFIX)io$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION)
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)
118 ICULIBS_BASE = -L$(libdir)
120 # for icu-config to test with
121 ICULIBS_COMMON_LIB_NAME = ${LIBICU}${COMMON_STUBNAME}${ICULIBSUFFIX}${ICULIBSUFFIX_VERSION}.${SO}
122 ICULIBS_COMMON_LIB_NAME_A = ${LIBICU}${COMMON_STUBNAME}${ICULIBSUFFIX}.${A}
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)
128 # Proper echo newline handling is needed in icu-config
131 # Not currently being used but good to have for proper tab handling
134 ##################################################################
135 ##################################################################
137 # *2* access to ICU tools
139 ##################################################################
140 # Environment variable to set a runtime search path
141 # (Overridden when necessary in -mh files)
142 LDLIBRARYPATH_ENVVAR = LD_LIBRARY_PATH
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)
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
152 ICUPKG = $(sbindir)/icupkg
153 GENCMN = $(sbindir)/gencmn
154 GENRB = $(bindir)/genrb
155 PKGDATA = $(bindir)/pkgdata
157 # moved here because of dependencies
158 pkgdatadir = $(datadir)/$(PACKAGE)$(ICULIBSUFFIX)/$(VERSION)
159 pkglibdir = $(libdir)/$(PACKAGE)$(ICULIBSUFFIX)/$(VERSION)
161 ##################################################################
162 ##################################################################
164 # *3* Information about the host
166 ##################################################################
168 # Information about the host that 'configure' was run on.
170 host_alias = @host_alias@
171 host_cpu = @host_cpu@
172 host_vendor = @host_vendor@
174 # Our platform canonical name (as determined by configure)
175 # this is a #define value (i.e. U_XXXX or XXXX)
176 platform = @platform@
178 ##################################################################
179 ##################################################################
181 # *4* compiler flags and misc. options
183 ##################################################################
185 # initial tab keeps it out of the shell version.
186 ARFLAGS := @ARFLAGS@ $(ARFLAGS)
187 #SH#ARFLAGS="@ARFLAGS@ ${ARFLAGS}"
190 CFLAGS = @UCONFIG_CFLAGS@
191 CPPFLAGS = @UCONFIG_CPPFLAGS@ -I$(prefix)/include
192 CXXFLAGS = @UCONFIG_CXXFLAGS@
194 DEFAULT_MODE = @DATA_PACKAGING_MODE@
197 # use a consistent INSTALL
198 INSTALL = $(SHELL) $(pkgdatadir)/install-sh -c
199 INSTALL_DATA = @INSTALL_DATA@
200 INSTALL_DATA = @INSTALL_DATA@
201 INSTALL_PROGRAM = @INSTALL_PROGRAM@
202 INSTALL_PROGRAM = @INSTALL_PROGRAM@
203 INSTALL_SCRIPT = @INSTALL_SCRIPT@
204 LDFLAGS = $(RPATHLDFLAGS)
207 LIB_VERSION = @LIB_VERSION@
208 LIB_VERSION_MAJOR = @LIB_VERSION_MAJOR@
209 MKINSTALLDIRS = $(SHELL) $(pkgdatadir)/mkinstalldirs
213 SHLIB.c= $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -shared
214 SHLIB.cc= $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -shared
215 U_IS_BIG_ENDIAN = @U_IS_BIG_ENDIAN@
216 includedir = @includedir@
218 localstatedir = @localstatedir@
220 oldincludedir = @oldincludedir@
221 program_transform_name = @program_transform_name@
222 sharedstatedir = @sharedstatedir@
223 sysconfdir = @sysconfdir@
224 INSTALL-L = ${INSTALL_DATA}
226 # for derivative builds - don't bother with VERBOSE/NONVERBOSE SILENT_COMPILE
227 SILENT_COMPILE=$(1) #M#
228 ICU_MSG=@echo " $(1) " #M#
230 ##################################################################
231 ##################################################################
233 # *5* packaging options and directories
235 ##################################################################
238 # The basename of the ICU data file (i.e. icudt21b )
239 ICUDATA_CHAR = @ICUDATA_CHAR@
240 ICUDATA_NAME = icudt@LIB_VERSION_MAJOR@@ICUDATA_CHAR@
242 # Defaults for pkgdata's mode and directories
243 # The default data dir changes depending on what packaging mode
245 ifeq ($(strip $(PKGDATA_MODE)),)
246 #SH# if [ "x$PKGDATA_MODE" = "x" ];
248 PKGDATA_MODE=@DATA_PACKAGING_MODE@
252 #SH# case "$PKGDATA_MODE" in
253 ifeq ($(PKGDATA_MODE),common)
255 ICUDATA_DIR = $(pkgdatadir)
256 ICUPKGDATA_DIR = $(ICUDATA_DIR)
259 ifeq ($(PKGDATA_MODE),dll)
261 ICUDATA_DIR = $(pkgdatadir)
262 ICUPKGDATA_DIR = $(libdir)
266 ICUDATA_DIR = $(pkgdatadir)
267 ICUPKGDATA_DIR = $(ICUDATA_DIR)
274 GENCCODE_ASSEMBLY = @GENCCODE_ASSEMBLY@
276 ##################################################################
277 ##################################################################
279 # *6* Inclusion of platform make fragment (mh-* file)
281 ##################################################################
282 # The mh- file ("make fragment") for the platform is included here.
283 # It may override the above settings.
284 # It is put last so that the mh-file can override anything.
285 # The selfcheck is just a sanity check that this makefile is
286 # parseable. The mh fragment is only included if this does not occur.
288 ifeq (selfcheck,$(MAKECMDGOALS)) #M#
292 include $(pkgdatadir)/config/@platform_make_fragment_name@