• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Make definitions that are shared by the different subprojects of ICU.
2#
3# Yves Arrouye.
4#
5# Copyright (C) 2000-2011, International Business Machines Corporation and others.
6# All Rights Reserved.
7
8#
9# Some of these variables are overridden in the config/mh-* files.
10#
11# Please be sure to update config/Makefile.inc.in  if you add something here.
12#
13
14# Shell to use
15
16SHELL = @SHELL@
17
18# Standard directories
19
20prefix = @prefix@
21exec_prefix = @exec_prefix@
22
23bindir = @bindir@
24sbindir = @sbindir@
25datarootdir = @datarootdir@
26datadir = @datadir@
27libdir = @libdir@
28includedir = @includedir@
29mandir = @mandir@
30sysconfdir = @sysconfdir@
31# controls the include of $(top_builddir)/icucross.mk at bottom of file
32cross_compiling = @cross_compiling@
33cross_buildroot = @cross_buildroot@
34
35# Package information
36
37PACKAGE_ICU_DESCRIPTION = "International Components for Unicode"
38PACKAGE_ICU_URL = "http://icu-project.org"
39PACKAGE = @PACKAGE@
40VERSION = @VERSION@
41UNICODE_VERSION = @UNICODE_VERSION@
42SO_TARGET_VERSION = @LIB_VERSION@
43SO_TARGET_VERSION_MAJOR = @LIB_VERSION_MAJOR@
44
45# The ICU data external name is usually icudata; the entry point name is
46# the version-dependent name (for no particular reason except it was easier
47# to change the build this way). When building in common mode, the data
48# name is the versioned platform-dependent one.
49
50ICUDATA_DIR = @pkgicudatadir@/$(PACKAGE)$(ICULIBSUFFIX)/$(VERSION)
51
52ICUDATA_BASENAME_VERSION = $(ICUPREFIX)dt@LIB_VERSION_MAJOR@
53# the entry point is almost like the basename, but has the lib suffix.
54ICUDATA_ENTRY_POINT = $(ICUPREFIX)dt@ICULIBSUFFIXCNAME@@LIB_VERSION_MAJOR@
55ICUDATA_CHAR = @ICUDATA_CHAR@
56ICUDATA_PLATFORM_NAME = $(ICUDATA_BASENAME_VERSION)$(ICUDATA_CHAR)
57PKGDATA_LIBSTATICNAME = -L $(STATIC_PREFIX)$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)
58ifeq ($(strip $(PKGDATA_MODE)),)
59PKGDATA_MODE=@DATA_PACKAGING_MODE@
60endif
61ifeq ($(PKGDATA_MODE),common)
62ICUDATA_NAME = $(ICUDATA_PLATFORM_NAME)
63ICUPKGDATA_DIR = $(ICUDATA_DIR)
64else
65ifeq ($(PKGDATA_MODE),dll)
66ICUDATA_NAME = $(ICUDATA_PLATFORM_NAME)
67PKGDATA_LIBNAME = -L $(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)
68ICUPKGDATA_DIR = $(libdir)
69else
70ifeq ($(PKGDATA_MODE),static)
71ICUDATA_NAME = $(ICUDATA_PLATFORM_NAME)
72PKGDATA_LIBNAME = -L $(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)
73ICUPKGDATA_DIR = $(libdir)
74else
75ICUDATA_NAME = $(ICUDATA_PLATFORM_NAME)
76ICUPKGDATA_DIR = $(ICUDATA_DIR)
77endif
78endif
79endif
80# This is needed so that make -j2 doesn't complain when invoking pkgdata's make
81PKGDATA_INVOKE_OPTS = MAKEFLAGS=
82
83# These are defined here because mh-cygwin-msvc needs to override these values.
84ICUPKGDATA_INSTALL_DIR = $(DESTDIR)$(ICUPKGDATA_DIR)
85ICUPKGDATA_INSTALL_LIBDIR = $(DESTDIR)$(libdir)
86
87# If defined to a valid value, pkgdata will generate a data library more quickly
88GENCCODE_ASSEMBLY = @GENCCODE_ASSEMBLY@
89
90# ICU specific directories
91
92pkgdatadir = $(datadir)/$(PACKAGE)$(ICULIBSUFFIX)/$(VERSION)
93pkglibdir = $(libdir)/$(PACKAGE)$(ICULIBSUFFIX)/$(VERSION)
94pkgsysconfdir = $(sysconfdir)/$(PACKAGE)$(ICULIBSUFFIX)
95
96# Installation programs
97
98MKINSTALLDIRS = $(SHELL) $(top_srcdir)/mkinstalldirs
99
100INSTALL = @INSTALL@
101INSTALL_PROGRAM = @INSTALL_PROGRAM@
102INSTALL_DATA = @INSTALL_DATA@
103INSTALL_SCRIPT = @INSTALL_SCRIPT@
104
105# Library suffix (to support different C++ compilers)
106
107ICULIBSUFFIX=@ICULIBSUFFIX@
108
109# Compiler and tools
110
111ENABLE_DEBUG = @ENABLE_DEBUG@
112ENABLE_RELEASE = @ENABLE_RELEASE@
113EXEEXT = @EXEEXT@
114CC = @CC@
115CXX = @CXX@
116AR = @AR@
117ARFLAGS = @ARFLAGS@ r
118RANLIB = @RANLIB@
119COMPILE_LINK_ENVVAR = @COMPILE_LINK_ENVVAR@
120UCLN_NO_AUTO_CLEANUP = @UCLN_NO_AUTO_CLEANUP@
121
122# Various flags for the tools
123
124# DEFS is for common macro definitions.
125# configure prevents user defined DEFS, and configure's DEFS is not needed
126# So we ignore the DEFS that comes from configure
127# U_ATTRIBUTE_DEPRECATED is defined to hide warnings about deprecated API warnings.
128DEFS = -DU_ATTRIBUTE_DEPRECATED=
129# CFLAGS is for C only flags
130CFLAGS = @CFLAGS@
131# CXXFLAGS is for C++ only flags
132CXXFLAGS = @CXXFLAGS@
133# CPPFLAGS is for C Pre-Processor flags
134CPPFLAGS = @CPPFLAGS@
135# LIBCFLAGS are the flags for static and shared libraries.
136LIBCFLAGS = @LIBCFLAGS@
137# LIBCXXFLAGS are the flags for static and shared libraries.
138LIBCXXFLAGS = @LIBCXXFLAGS@
139# DEFAULT_LIBS are the default libraries to link against
140DEFAULT_LIBS = @LIBS@
141# LIB_M is for linking against the math library
142LIB_M = @LIB_M@
143# LIB_THREAD is for linking against the threading library
144LIB_THREAD = @LIB_THREAD@
145# OUTOPT is for creating a specific output name
146OUTOPT = -o # The extra space after the argument is needed.
147# AR_OUTOPT is for creating a specific output name for static libraries.
148AR_OUTOPT =
149
150ENABLE_RPATH = @ENABLE_RPATH@
151ifeq ($(ENABLE_RPATH),YES)
152RPATHLDFLAGS = $(LD_RPATH)$(LD_RPATH_PRE)$(libdir)
153endif
154LDFLAGS = @LDFLAGS@ $(RPATHLDFLAGS)
155
156# What kind of libraries are we building and linking against?
157ENABLE_STATIC = @ENABLE_STATIC@
158ENABLE_SHARED = @ENABLE_SHARED@
159
160# Echo w/o newline
161
162#ECHO_N = @ICU_ECHO_N@
163#ECHO_C = @ICU_ECHO_C@
164
165# Commands to compile
166COMPILE.c=    $(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) -c
167COMPILE.cc=   $(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) -c
168
169# Commands to link
170LINK.c=       $(CC) $(CFLAGS) $(LDFLAGS)
171LINK.cc=      $(CXX) $(CXXFLAGS) $(LDFLAGS)
172
173# Commands to make a shared library
174SHLIB.c=      $(CC) $(CFLAGS) $(LDFLAGS) -shared $(LD_SOOPTIONS)
175SHLIB.cc=     $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(LD_SOOPTIONS)
176
177# Environment variable to set a runtime search path
178LDLIBRARYPATH_ENVVAR = LD_LIBRARY_PATH
179
180# Versioned target for a shared library.
181FINAL_SO_TARGET = $(SO_TARGET).$(SO_TARGET_VERSION)
182MIDDLE_SO_TARGET = $(SO_TARGET).$(SO_TARGET_VERSION_MAJOR)
183SHARED_OBJECT = $(FINAL_SO_TARGET)
184
185##  How ICU libraries are named...  ex. $(LIBICU)uc$(SO)
186# Prefix for the ICU library names
187ICUPREFIX = icu
188LIBPREFIX = lib
189LIBICU = $(LIBPREFIX)$(ICUPREFIX)
190
191## If we can't use the shared libraries, use the static libraries
192ifneq ($(ENABLE_SHARED),YES)
193STATIC_PREFIX_WHEN_USED = s
194else
195STATIC_PREFIX_WHEN_USED =
196endif
197
198# Static library prefix and file extension
199STATIC_PREFIX = s
200LIBSICU = $(LIBPREFIX)$(STATIC_PREFIX)$(ICUPREFIX)
201A = a
202SOBJ = $(SO)
203
204# Force removal [for make clean]
205RMV = rm -rf
206
207# Platform commands to remove or move executable and library targets
208# INSTALL-L installs libraries. Override in mh-* file to INSTALL_PROGRAM
209#           when the library needs to have executable permissions
210INSTALL-S = $(INSTALL_PROGRAM)
211INSTALL-L = $(INSTALL_PROGRAM)
212#INSTALL-L = $(INSTALL_DATA)
213
214# Location of the libraries before "make install" is used
215LIBDIR=$(top_builddir)/lib
216
217# Location of the executables before "make install" is used
218BINDIR=$(top_builddir)/bin
219
220# overridden by icucross.mk
221TOOLBINDIR=$(BINDIR)
222TOOLLIBDIR=$(LIBDIR)
223
224# Current full path directory.
225CURR_FULL_DIR=$(shell pwd | sed 's/ /\\ /g')
226# Current full path directory for use in source code in a -D compiler option.
227CURR_SRCCODE_FULL_DIR=$(shell pwd | sed 's/ /\\ /')
228
229# Name flexibility for the library naming scheme.  Any modifications should
230# be made in the mh- file for the specific platform.
231DATA_STUBNAME = data
232COMMON_STUBNAME = uc
233I18N_STUBNAME = i18n
234LAYOUT_STUBNAME = le
235LAYOUTEX_STUBNAME = lx
236IO_STUBNAME = io
237TOOLUTIL_STUBNAME = tu
238CTESTFW_STUBNAME = test
239
240# Just the libs.
241ICULIBS_DT	= -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
242ICULIBS_UC	= -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(COMMON_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
243ICULIBS_I18N	= -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(I18N_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
244ICULIBS_LE	= -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(LAYOUT_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
245ICULIBS_LX	= -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(LAYOUTEX_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
246ICULIBS_IO	= -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(IO_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
247ICULIBS_CTESTFW	= -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(CTESTFW_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
248ICULIBS_TOOLUTIL = -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(TOOLUTIL_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
249# Link commands to link to ICU libs
250LLIBDIR		= -L$(LIBDIR)
251LSTUBDIR	= -L$(top_builddir)/stubdata
252LCTESTFW	= -L$(top_builddir)/tools/ctestfw
253
254LIBICUDT	= $(LLIBDIR) $(LSTUBDIR) $(ICULIBS_DT)
255LIBICUUC	= $(LLIBDIR) $(ICULIBS_UC) $(LSTUBDIR) $(ICULIBS_DT)
256LIBICUI18N	= $(LLIBDIR) $(ICULIBS_I18N)
257LIBICULE	= $(LLIBDIR) $(ICULIBS_LE)
258LIBICULX	= $(LLIBDIR) $(ICULIBS_LX)
259LIBCTESTFW	= $(LCTESTFW) $(ICULIBS_CTESTFW)
260LIBICUTOOLUTIL	= $(LLIBDIR) $(ICULIBS_TOOLUTIL)
261LIBICUIO	= $(LLIBDIR) $(ICULIBS_IO)
262
263# Invoke, set library path for all ICU libraries.
264# overridden by icucross.mk
265INVOKE = $(LDLIBRARYPATH_ENVVAR)=$(LIBRARY_PATH_PREFIX)$(LIBDIR):$(top_builddir)/stubdata:$(top_builddir)/tools/ctestfw:$$$(LDLIBRARYPATH_ENVVAR) $(LEAK_CHECKER)
266# prefer stubdata
267PKGDATA_INVOKE = $(LDLIBRARYPATH_ENVVAR)=$(top_builddir)/stubdata:$(top_builddir)/tools/ctestfw:$(LIBRARY_PATH_PREFIX)$(LIBDIR):$$$(LDLIBRARYPATH_ENVVAR) $(LEAK_CHECKER) $(PKGDATA_INVOKE_OPTS)
268
269# Platform-specific setup
270include @platform_make_fragment@
271
272# When shared libraries are disabled and static libraries are enabled,
273# the C++ compiler must be used to link in the libraries for the tools.
274ifneq ($(ENABLE_SHARED),YES)
275LINK.c = $(LINK.cc)
276endif
277
278# some imported things from the cross env
279TOOLEXEEXT = $(EXEEXT)
280ifneq ($(strip $(cross_buildroot)),)
281include $(cross_buildroot)/config/icucross.mk
282else
283cross_buildroot = $(top_builddir)
284endif
285
286# optional include at top
287-include $(top_builddir)/icudefs.local
288