• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2016 and later: Unicode, Inc. and others.
2# License & terms of use: http://www.unicode.org/copyright.html
3## -*-makefile-*-
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
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.
30prefix = @prefix@
31exec_prefix = @exec_prefix@
32libdir = @libdir@
33libexecdir = @libexecdir@
34bindir = @bindir@
35datarootdir = @datarootdir@
36datadir = @datadir@
37sbindir = @sbindir@
38
39# about the ICU version
40VERSION = @VERSION@
41UNICODE_VERSION = @UNICODE_VERSION@
42
43# The prefix for ICU libraries, normally 'icu'
44ICUPREFIX = icu
45PACKAGE = @PACKAGE@
46LIBICU = lib$(ICUPREFIX)
47
48# Static library prefix and file extension
49STATIC_PREFIX = s
50LIBSICU = lib$(STATIC_PREFIX)$(ICUPREFIX)
51A = a
52
53# Suffix at the end of libraries. Usually empty.
54ICULIBSUFFIX = @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
62ENABLE_RPATH = @ENABLE_RPATH@
63ifeq ($(ENABLE_RPATH),YES)
64RPATHLDFLAGS = $(LD_RPATH)$(LD_RPATH_PRE)$(libdir)
65endif
66
67#SH## icu-config version of above 'if':
68#SH#case "x$ENABLE_RPATH" in
69#SH#     x[yY]*)
70#SH# 	ENABLE_RPATH=YES
71#SH# 	RPATHLDFLAGS="${LD_RPATH}${LD_RPATH_PRE}${libdir}"
72#SH# 	;;
73#SH#
74#SH#     x[nN]*)
75#SH# 	ENABLE_RPATH=NO
76#SH# 	RPATHLDFLAGS=""
77#SH# 	;;
78#SH#
79#SH#     x)
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
90# Name flexibility for the library naming scheme.  Any modifications should
91# be made in the mh- file for the specific platform.
92DATA_STUBNAME = data
93COMMON_STUBNAME = uc
94I18N_STUBNAME = i18n
95LAYOUTEX_STUBNAME = lx
96IO_STUBNAME = io
97TOOLUTIL_STUBNAME = tu
98CTESTFW_STUBNAME = test
99
100
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.
107#    - $(ICULIBS_ICUIO)   - ICU stdio equivalent library
108
109ICULIBS_COMMON = -l$(ICUPREFIX)uc$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION)
110ICULIBS_DATA   = -l$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION)
111ICULIBS_I18N   = -l$(ICUPREFIX)$(I18N_STUBNAME)$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION)
112ICULIBS_TOOLUTIL = -l$(ICUPREFIX)tu$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION)
113ICULIBS_CTESTFW = -l$(ICUPREFIX)ctestfw$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION)
114ICULIBS_ICUIO = -l$(ICUPREFIX)io$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION)
115ICULIBS_OBSOLETE = -l$(ICUPREFIX)obsolete$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION)
116ICULIBS_LAYOUTEX = -l$(ICUPREFIX)lx$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION)
117ICULIBS_BASE = -L$(libdir)
118
119# for icu-config to test with
120ICULIBS_COMMON_LIB_NAME = ${LIBICU}${COMMON_STUBNAME}${ICULIBSUFFIX}${ICULIBSUFFIX_VERSION}.${SO}
121ICULIBS_COMMON_LIB_NAME_A = ${LIBICU}${COMMON_STUBNAME}${ICULIBSUFFIX}.${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.
125ICULIBS = $(ICULIBS_BASE) $(ICULIBS_I18N) $(ICULIBS_COMMON) $(ICULIBS_DATA)
126
127# Proper echo newline handling is needed in icu-config
128ECHO_N=@ICU_ECHO_N@
129ECHO_C=@ICU_ECHO_C@
130# Not currently being used but good to have for proper tab handling
131ECHO_T=@ICU_ECHO_T@
132
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)
141LDLIBRARYPATH_ENVVAR = LD_LIBRARY_PATH
142
143# Versioned target for a shared library
144FINAL_SO_TARGET = $(SO_TARGET).$(SO_TARGET_VERSION)
145MIDDLE_SO_TARGET = $(SO_TARGET).$(SO_TARGET_VERSION_MAJOR)
146
147# Access to important ICU tools.
148# Use as follows:  $(INVOKE) $(GENRB) arguments ..
149INVOKE = $(LDLIBRARYPATH_ENVVAR)=$(libdir):$$$(LDLIBRARYPATH_ENVVAR) $(LEAK_CHECKER)
150GENCCODE = $(sbindir)/genccode
151ICUPKG   = $(sbindir)/icupkg
152GENCMN   = $(sbindir)/gencmn
153GENRB    = $(bindir)/genrb
154PKGDATA  = $(bindir)/pkgdata
155
156# moved here because of dependencies
157pkgdatadir = $(datadir)/$(PACKAGE)$(ICULIBSUFFIX)/$(VERSION)
158pkglibdir = $(libdir)/$(PACKAGE)$(ICULIBSUFFIX)/$(VERSION)
159
160##################################################################
161##################################################################
162#
163#       *3*  Information about the host
164#
165##################################################################
166
167# Information about the host that 'configure' was run on.
168host = @host@
169host_alias = @host_alias@
170host_cpu = @host_cpu@
171host_vendor = @host_vendor@
172host_os = @host_os@
173# Our platform canonical name (as determined by configure)
174# this is a #define value (i.e. U_XXXX or XXXX)
175platform = @platform@
176
177##################################################################
178##################################################################
179#
180#       *4*  compiler flags and misc. options
181#
182##################################################################
183AR = @AR@
184# initial tab keeps it out of the shell version.
185	ARFLAGS := @ARFLAGS@ $(ARFLAGS)
186#SH#ARFLAGS="@ARFLAGS@ ${ARFLAGS}"
187CC = @CC@
188CPP = @CPP@
189CFLAGS = @UCONFIG_CFLAGS@
190CPPFLAGS = @UCONFIG_CPPFLAGS@ -I$(prefix)/include
191CXXFLAGS = @UCONFIG_CXXFLAGS@
192CXX = @CXX@
193DEFAULT_MODE = @DATA_PACKAGING_MODE@
194DEFS = @DEFS@
195# use a consistent INSTALL
196INSTALL  =  $(SHELL) $(pkgdatadir)/install-sh -c
197INSTALL_DATA  =  @INSTALL_DATA@
198INSTALL_DATA = @INSTALL_DATA@
199INSTALL_PROGRAM  =  @INSTALL_PROGRAM@
200INSTALL_PROGRAM = @INSTALL_PROGRAM@
201INSTALL_SCRIPT = @INSTALL_SCRIPT@
202LDFLAGS = $(RPATHLDFLAGS)
203LIBS = @LIBS@
204LIB_M = @LIB_M@
205LIB_VERSION = @LIB_VERSION@
206LIB_VERSION_MAJOR = @LIB_VERSION_MAJOR@
207MKINSTALLDIRS = $(SHELL) $(pkgdatadir)/mkinstalldirs
208RANLIB = @RANLIB@
209RMV = rm -rf
210SHELL = @SHELL@
211SHLIB.c=      $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -shared
212SHLIB.cc=     $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -shared
213U_IS_BIG_ENDIAN = @U_IS_BIG_ENDIAN@
214includedir = @includedir@
215infodir = @infodir@
216localstatedir = @localstatedir@
217mandir = @mandir@
218oldincludedir = @oldincludedir@
219program_transform_name = @program_transform_name@
220sharedstatedir = @sharedstatedir@
221sysconfdir = @sysconfdir@
222INSTALL-L = ${INSTALL_DATA}
223
224# for derivative builds - don't bother with VERBOSE/NONVERBOSE SILENT_COMPILE
225SILENT_COMPILE=$(1)  #M#
226ICU_MSG=@echo "   $(1)	"  #M#
227
228##################################################################
229##################################################################
230#
231#       *5* packaging options and directories
232#
233##################################################################
234
235
236# The basename of the ICU data file (i.e. icudt21b )
237ICUDATA_CHAR = @ICUDATA_CHAR@
238ICUDATA_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
243ifeq ($(strip $(PKGDATA_MODE)),)
244#SH# if [ "x$PKGDATA_MODE" = "x" ];
245#SH# then
246PKGDATA_MODE=@DATA_PACKAGING_MODE@
247#SH# fi
248endif
249
250#SH# case "$PKGDATA_MODE" in
251ifeq ($(PKGDATA_MODE),common)
252#SH# common)
253ICUDATA_DIR = $(pkgdatadir)
254ICUPKGDATA_DIR = $(ICUDATA_DIR)
255#SH# ;;
256else
257ifeq ($(PKGDATA_MODE),dll)
258#SH# dll)
259ICUDATA_DIR = $(pkgdatadir)
260ICUPKGDATA_DIR = $(libdir)
261#SH# ;;
262else
263#SH# *)
264ICUDATA_DIR = $(pkgdatadir)
265ICUPKGDATA_DIR = $(ICUDATA_DIR)
266#SH# ;;
267endif
268endif
269
270#SH# esac
271
272GENCCODE_ASSEMBLY = @GENCCODE_ASSEMBLY@
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.
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.
285
286ifeq (selfcheck,$(MAKECMDGOALS)) #M#
287selfcheck: #M#
288	@echo passed #M#
289else #M#
290include $(pkgdatadir)/config/@platform_make_fragment_name@
291endif #M#
292
293