1## -*-makefile-*-
2#******************************************************************************
3#   Copyright (C) 1999-2008, 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 "$ENABLE_RPATH" in 
67#SH#     [yY]*)
68#SH# 	ENABLE_RPATH=YES
69#SH# 	RPATHLDFLAGS="${LD_RPATH}${LD_RPATH_PRE}${libdir}"
70#SH# 	;;
71#SH#
72#SH#     [nN]*)
73#SH# 	ENABLE_RPATH=NO
74#SH# 	RPATHLDFLAGS=""
75#SH# 	;;
76#SH#
77#SH#     *)
78#SH# 	echo $0: Unknown --enable-rpath value ${ENABLE_RPATH} 1>&2
79#SH# 	exit 3
80#SH# 	;;
81#SH#esac
82
83# Name flexibility for the library naming scheme.  Any modifications should
84# be made in the mh- file for the specific platform.
85DATA_STUBNAME = data
86COMMON_STUBNAME = uc
87I18N_STUBNAME = i18n
88LAYOUT_STUBNAME = le
89LAYOUTEX_STUBNAME = lx
90IO_STUBNAME = io
91TOOLUTIL_STUBNAME = tu
92CTESTFW_STUBNAME = test
93 
94
95
96### To link your application with ICU:
97# 1. use LDFLAGS, CFLAGS, etc from above
98# 2. link with $(ICULIBS)
99# 3. optionally, add one or more of:
100#    - $(ICULIBS_I18N)    - i18n library, formatting, etc.
101#    - $(ICULIBS_LAYOUT)  - ICU layout library. 
102#    - $(ICULIBS_ICUIO)   - ICU stdio equivalent library
103
104ICULIBS_COMMON = -l$(ICUPREFIX)uc$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION)
105ICULIBS_DATA   = -l$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION)
106ICULIBS_I18N   = -l$(ICUPREFIX)$(I18N_STUBNAME)$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION)
107ICULIBS_TOOLUTIL = -l$(ICUPREFIX)tu$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION)
108ICULIBS_CTESTFW = -l$(ICUPREFIX)ctestfw$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION)
109ICULIBS_ICUIO = -l$(ICUPREFIX)io$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION)
110ICULIBS_OBSOLETE = -l$(ICUPREFIX)obsolete$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION)
111ICULIBS_LAYOUT = -l$(ICUPREFIX)le$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION)
112ICULIBS_LAYOUTEX = -l$(ICUPREFIX)lx$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION)
113ICULIBS_BASE = $(LIBS) -L$(libdir)
114
115# for icu-config to test with
116ICULIBS_COMMON_LIB_NAME = ${LIBICU}uc${ICULIBSUFFIX}${ICULIBSUFFIX_VERSION}.${SO}
117
118# ICULIBS is the set of libraries your application should link
119# with usually. Many applications will want to add $(ICULIBS_I18N) as well. 
120ICULIBS = $(ICULIBS_BASE) $(ICULIBS_I18N) $(ICULIBS_COMMON) $(ICULIBS_DATA) 
121
122# Proper echo newline handling is needed in icu-config
123ECHO_N=@ECHO_N@
124ECHO_C=@ECHO_C@
125# Not currently being used but good to have for proper tab handling
126ECHO_T=@ECHO_T@
127
128##################################################################
129##################################################################
130#
131#       *2*  access to ICU tools
132#
133##################################################################
134# Environment variable to set a runtime search path
135#   (Overridden when necessary in -mh files)
136LDLIBRARYPATH_ENVVAR = LD_LIBRARY_PATH
137
138# Versioned target for a shared library
139FINAL_SO_TARGET = $(SO_TARGET).$(SO_TARGET_VERSION)
140MIDDLE_SO_TARGET = $(SO_TARGET).$(SO_TARGET_VERSION_MAJOR)
141
142# Access to important ICU tools.
143# Use as follows:  $(INVOKE) $(GENRB) arguments .. 
144INVOKE = $(LDLIBRARYPATH_ENVVAR)=$(libdir):$$$(LDLIBRARYPATH_ENVVAR) $(LEAK_CHECKER)
145GENCCODE = $(sbindir)/genccode
146ICUPKG   = $(sbindir)/icupkg
147GENCMN   = $(sbindir)/gencmn
148GENRB    = $(bindir)/genrb
149PKGDATA  = $(bindir)/pkgdata
150
151# moved here because of dependencies
152pkgdatadir = $(datadir)/$(PACKAGE)$(ICULIBSUFFIX)/$(VERSION)
153pkglibdir = $(libdir)/$(PACKAGE)$(ICULIBSUFFIX)/$(VERSION)
154
155##################################################################
156##################################################################
157#
158#       *3*  Information about the host
159#
160##################################################################
161
162# Information about the host that 'configure' was run on.
163host = @host@
164host_alias = @host_alias@
165host_cpu = @host_cpu@
166host_vendor = @host_vendor@
167host_os = @host_os@
168# Our platform canonical name (as determined by configure)
169# this is a #define value (i.e. U_XXXX or XXXX)
170platform = @platform@
171
172##################################################################
173##################################################################
174#
175#       *4*  compiler flags and misc. options
176#
177##################################################################
178AR = @AR@
179# initial tab keeps it out of the shell version.
180	ARFLAGS := @ARFLAGS@ $(ARFLAGS)
181#SH#ARFLAGS="@ARFLAGS@ ${ARFLAGS}"
182CC = @CC@
183CFLAGS = @CFLAGS@ 
184CPP = @CPP@
185CPPFLAGS = @CPPFLAGS@ $(LIBCPPFLAGS) -I$(prefix)/include
186CXX = @CXX@
187CXXFLAGS = @CXXFLAGS@ 
188DEFAULT_MODE = @DATA_PACKAGING_MODE@
189DEFS = @DEFS@ 
190FFLAGS = @FFLAGS@
191# use a consistent INSTALL 
192INSTALL  =  $(SHELL) $(pkgdatadir)/install-sh -c
193INSTALL_DATA  =  @INSTALL_DATA@
194INSTALL_DATA = @INSTALL_DATA@
195INSTALL_PROGRAM  =  @INSTALL_PROGRAM@
196INSTALL_PROGRAM = @INSTALL_PROGRAM@
197INSTALL_SCRIPT = @INSTALL_SCRIPT@
198LDFLAGS = @LDFLAGS@ $(RPATHLDFLAGS)
199LIBS = @LIBS@ 
200LIB_M = @LIB_M@
201LIB_VERSION = @LIB_VERSION@
202LIB_VERSION_MAJOR = @LIB_VERSION_MAJOR@
203MKINSTALLDIRS = $(SHELL) $(pkgdatadir)/mkinstalldirs
204RANLIB = @RANLIB@
205RMV = rm -rf
206SHELL = @SHELL@
207SHLIB.c=      $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -shared
208SHLIB.cc=     $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -shared
209U_IS_BIG_ENDIAN = @U_IS_BIG_ENDIAN@
210includedir = @includedir@
211infodir = @infodir@
212localstatedir = @localstatedir@
213mandir = @mandir@
214oldincludedir = @oldincludedir@
215program_transform_name = @program_transform_name@
216sharedstatedir = @sharedstatedir@
217sysconfdir = @sysconfdir@
218INSTALL-L = ${INSTALL_DATA}
219
220
221##################################################################
222##################################################################
223#
224#       *5* packaging options and directories
225#
226##################################################################
227
228
229# The basename of the ICU data file (i.e. icudt21b )
230ICUDATA_CHAR = @ICUDATA_CHAR@
231ICUDATA_NAME = icudt@LIB_VERSION_MAJOR@@ICUDATA_CHAR@
232
233# Defaults for pkgdata's mode and directories
234# The default data dir changes depending on what packaging mode 
235# is being used
236ifeq ($(strip $(PKGDATA_MODE)),)
237#SH# if [ "x$PKGDATA_MODE" = "x" ];
238#SH# then
239PKGDATA_MODE=@DATA_PACKAGING_MODE@
240#SH# fi
241endif
242
243#SH# case "$PKGDATA_MODE" in
244ifeq ($(PKGDATA_MODE),common)
245#SH# common)
246ICUDATA_DIR = $(pkgdatadir)
247ICUPKGDATA_DIR = $(ICUDATA_DIR)
248#SH# ;;
249else
250ifeq ($(PKGDATA_MODE),dll)
251#SH# dll)
252ICUDATA_DIR = $(pkgdatadir)
253ICUPKGDATA_DIR = $(libdir)
254#SH# ;;
255else
256#SH# *)
257ICUDATA_DIR = $(pkgdatadir)
258ICUPKGDATA_DIR = $(ICUDATA_DIR)
259#SH# ;;
260endif
261endif
262
263#SH# esac
264
265GENCCODE_ASSEMBLY = @GENCCODE_ASSEMBLY@
266
267##################################################################
268##################################################################
269#
270#       *6* Inclusion of platform make fragment (mh-* file)
271#
272##################################################################
273# The mh- file ("make fragment") for the platform is included here. 
274# It may override the above settings.
275# It is put last so that the mh-file can override anything.
276# The selfcheck is just a sanity check that this makefile is
277# parseable. The mh fragment is only included if this does not occur.
278
279ifeq (selfcheck,$(MAKECMDGOALS)) #M#
280selfcheck: #M#
281	@echo passed #M#
282else #M#
283include $(pkgdatadir)/config/@platform_make_fragment_name@
284endif #M#
285
286