1 # Copyright (C) 2016 and later: Unicode, Inc. and others.
2 # License & terms of use: http://www.unicode.org/copyright.html
4 #******************************************************************************
5 # Copyright (C) 1999-2014, International Business Machines
6 # Corporation and others. All Rights Reserved.
7 #******************************************************************************
8 # This Makefile.inc is designed to be included into projects which make use
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)
19 ##################################################################
20 ##################################################################
22 # *1* base configuration information and linkage
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
31 exec_prefix = @exec_prefix@
33 libexecdir = @libexecdir@
35 datarootdir = @datarootdir@
39 # about the ICU version
41 UNICODE_VERSION = @UNICODE_VERSION@
43 # The prefix for ICU libraries, normally 'icu'
46 LIBICU = lib$(ICUPREFIX)
48 # Static library prefix and file extension
50 LIBSICU = lib$(STATIC_PREFIX)$(ICUPREFIX)
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.
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)
67 #SH## icu-config version of above 'if':
68 #SH#case "x$ENABLE_RPATH" in
71 #SH# RPATHLDFLAGS="${LD_RPATH}${LD_RPATH_PRE}${libdir}"
85 #SH# echo $0: Unknown --enable-rpath value ${ENABLE_RPATH} 1>&2
90 # Name flexibility for the library naming scheme. Any modifications should
91 # be made in the mh- file for the specific platform.
95 LAYOUTEX_STUBNAME = lx
97 TOOLUTIL_STUBNAME = tu
98 CTESTFW_STUBNAME = test
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.
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_LAYOUTEX = -l$(ICUPREFIX)lx$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION)
117 ICULIBS_BASE = -L$(libdir)
119 # for icu-config to test with
120 ICULIBS_COMMON_LIB_NAME = ${LIBICU}${COMMON_STUBNAME}${ICULIBSUFFIX}${ICULIBSUFFIX_VERSION}.${SO}
121 ICULIBS_COMMON_LIB_NAME_A = ${LIBICU}${COMMON_STUBNAME}${ICULIBSUFFIX}.${A}
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)
127 # Proper echo newline handling is needed in icu-config
130 # Not currently being used but good to have for proper tab handling
133 ##################################################################
134 ##################################################################
136 # *2* access to ICU tools
138 ##################################################################
139 # Environment variable to set a runtime search path
140 # (Overridden when necessary in -mh files)
141 LDLIBRARYPATH_ENVVAR = LD_LIBRARY_PATH
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)
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
151 ICUPKG = $(sbindir)/icupkg
152 GENCMN = $(sbindir)/gencmn
153 GENRB = $(bindir)/genrb
154 PKGDATA = $(bindir)/pkgdata
156 # moved here because of dependencies
157 pkgdatadir = $(datadir)/$(PACKAGE)$(ICULIBSUFFIX)/$(VERSION)
158 pkglibdir = $(libdir)/$(PACKAGE)$(ICULIBSUFFIX)/$(VERSION)
160 ##################################################################
161 ##################################################################
163 # *3* Information about the host
165 ##################################################################
167 # Information about the host that 'configure' was run on.
169 host_alias = @host_alias@
170 host_cpu = @host_cpu@
171 host_vendor = @host_vendor@
173 # Our platform canonical name (as determined by configure)
174 # this is a #define value (i.e. U_XXXX or XXXX)
175 platform = @platform@
177 ##################################################################
178 ##################################################################
180 # *4* compiler flags and misc. options
182 ##################################################################
184 # initial tab keeps it out of the shell version.
185 ARFLAGS := @ARFLAGS@ $(ARFLAGS)
186 #SH#ARFLAGS="@ARFLAGS@ ${ARFLAGS}"
189 CFLAGS = @UCONFIG_CFLAGS@
190 CPPFLAGS = @UCONFIG_CPPFLAGS@ -I$(prefix)/include
191 CXXFLAGS = @UCONFIG_CXXFLAGS@
193 DEFAULT_MODE = @DATA_PACKAGING_MODE@
195 # use a consistent INSTALL
196 INSTALL = $(SHELL) $(pkgdatadir)/install-sh -c
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@
202 LDFLAGS = $(RPATHLDFLAGS)
205 LIB_VERSION = @LIB_VERSION@
206 LIB_VERSION_MAJOR = @LIB_VERSION_MAJOR@
207 MKINSTALLDIRS = $(SHELL) $(pkgdatadir)/mkinstalldirs
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@
216 localstatedir = @localstatedir@
218 oldincludedir = @oldincludedir@
219 program_transform_name = @program_transform_name@
220 sharedstatedir = @sharedstatedir@
221 sysconfdir = @sysconfdir@
222 INSTALL-L = ${INSTALL_DATA}
224 # for derivative builds - don't bother with VERBOSE/NONVERBOSE SILENT_COMPILE
225 SILENT_COMPILE=$(1) #M#
226 ICU_MSG=@echo " $(1) " #M#
228 ##################################################################
229 ##################################################################
231 # *5* packaging options and directories
233 ##################################################################
236 # The basename of the ICU data file (i.e. icudt21b )
237 ICUDATA_CHAR = @ICUDATA_CHAR@
238 ICUDATA_NAME = icudt@LIB_VERSION_MAJOR@@ICUDATA_CHAR@
240 # Defaults for pkgdata's mode and directories
241 # The default data dir changes depending on what packaging mode
243 ifeq ($(strip $(PKGDATA_MODE)),)
244 #SH# if [ "x$PKGDATA_MODE" = "x" ];
246 PKGDATA_MODE=@DATA_PACKAGING_MODE@
250 #SH# case "$PKGDATA_MODE" in
251 ifeq ($(PKGDATA_MODE),common)
253 ICUDATA_DIR = $(pkgdatadir)
254 ICUPKGDATA_DIR = $(ICUDATA_DIR)
257 ifeq ($(PKGDATA_MODE),dll)
259 ICUDATA_DIR = $(pkgdatadir)
260 ICUPKGDATA_DIR = $(libdir)
264 ICUDATA_DIR = $(pkgdatadir)
265 ICUPKGDATA_DIR = $(ICUDATA_DIR)
272 GENCCODE_ASSEMBLY = @GENCCODE_ASSEMBLY@
274 ##################################################################
275 ##################################################################
277 # *6* Inclusion of platform make fragment (mh-* file)
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.
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.
286 ifeq (selfcheck,$(MAKECMDGOALS)) #M#
290 include $(pkgdatadir)/config/@platform_make_fragment_name@