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