blob: a6923e32fac3eb1be38ecd4a4a9eca758ac53f66 [file] [log] [blame]
Jean-Baptiste Querub13da9d2009-07-17 17:53:22 -07001# Make definitions that are shared by the different subprojects of ICU.
2#
3# Yves Arrouye.
4#
claireho27f65472011-06-09 11:11:49 -07005# Copyright (C) 2000-2010, International Business Machines Corporation and others.
Jean-Baptiste Querub13da9d2009-07-17 17:53:22 -07006# All Rights Reserved.
7
8#
9# Some of these variables are overridden in the config/mh-* files.
Jean-Baptiste Queruc69afce2009-07-20 15:02:39 -070010#
11# Please be sure to update config/Makefile.inc.in if you add something here.
Jean-Baptiste Querub13da9d2009-07-17 17:53:22 -070012#
13
14# Shell to use
15
16SHELL = @SHELL@
17
18# Standard directories
19
20prefix = @prefix@
21exec_prefix = @exec_prefix@
22
23bindir = @bindir@
24sbindir = @sbindir@
Jean-Baptiste Queruc69afce2009-07-20 15:02:39 -070025datarootdir = @datarootdir@
Jean-Baptiste Querub13da9d2009-07-17 17:53:22 -070026datadir = @datadir@
27libdir = @libdir@
28includedir = @includedir@
29mandir = @mandir@
30sysconfdir = @sysconfdir@
Jean-Baptiste Querub0ac9372009-07-20 15:09:32 -070031# controls the include of $(top_builddir)/icucross.mk at bottom of file
32cross_compiling = @cross_compiling@
33cross_buildroot = @cross_buildroot@
Jean-Baptiste Querub13da9d2009-07-17 17:53:22 -070034
35# Package information
36
claireho27f65472011-06-09 11:11:49 -070037PACKAGE_ICU_DESCRIPTION = "International Components for Unicode"
38PACKAGE_ICU_URL = "http://icu-project.org"
Jean-Baptiste Querub13da9d2009-07-17 17:53:22 -070039PACKAGE = @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@
claireho50294ea2010-05-03 15:44:48 -070053# the entry point is almost like the basename, but has the lib suffix.
54ICUDATA_ENTRY_POINT = $(ICUPREFIX)dt@ICULIBSUFFIXCNAME@@LIB_VERSION_MAJOR@
Jean-Baptiste Querub13da9d2009-07-17 17:53:22 -070055ICUDATA_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
claireho50294ea2010-05-03 15:44:48 -070070ifeq ($(PKGDATA_MODE),static)
71ICUDATA_NAME = $(ICUDATA_PLATFORM_NAME)
72PKGDATA_LIBNAME = -L $(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)
73ICUPKGDATA_DIR = $(libdir)
74else
Jean-Baptiste Querub13da9d2009-07-17 17:53:22 -070075ICUDATA_NAME = $(ICUDATA_PLATFORM_NAME)
76ICUPKGDATA_DIR = $(ICUDATA_DIR)
77endif
78endif
claireho50294ea2010-05-03 15:44:48 -070079endif
Jean-Baptiste Querub13da9d2009-07-17 17:53:22 -070080# 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@
claireho50294ea2010-05-03 15:44:48 -0700120UCLN_NO_AUTO_CLEANUP = @UCLN_NO_AUTO_CLEANUP@
Jean-Baptiste Querub13da9d2009-07-17 17:53:22 -0700121
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
127DEFS =
128# CFLAGS is for C only flags
129CFLAGS = @CFLAGS@
130# CXXFLAGS is for C++ only flags
131CXXFLAGS = @CXXFLAGS@
132# CPPFLAGS is for C Pre-Processor flags
133CPPFLAGS = @CPPFLAGS@
134# LIBCFLAGS are the flags for static and shared libraries.
135LIBCFLAGS = @LIBCFLAGS@
136# LIBCXXFLAGS are the flags for static and shared libraries.
137LIBCXXFLAGS = @LIBCXXFLAGS@
138# DEFAULT_LIBS are the default libraries to link against
139DEFAULT_LIBS = @LIBS@
140# LIB_M is for linking against the math library
141LIB_M = @LIB_M@
142# LIB_THREAD is for linking against the threading library
143LIB_THREAD = @LIB_THREAD@
144# OUTOPT is for creating a specific output name
145OUTOPT = -o # The extra space after the argument is needed.
146# AR_OUTOPT is for creating a specific output name for static libraries.
147AR_OUTOPT =
148
149ENABLE_RPATH = @ENABLE_RPATH@
150ifeq ($(ENABLE_RPATH),YES)
151RPATHLDFLAGS = $(LD_RPATH)$(LD_RPATH_PRE)$(libdir)
152endif
153LDFLAGS = @LDFLAGS@ $(RPATHLDFLAGS)
154
155# What kind of libraries are we building and linking against?
156ENABLE_STATIC = @ENABLE_STATIC@
157ENABLE_SHARED = @ENABLE_SHARED@
158
159# Echo w/o newline
160
claireho27f65472011-06-09 11:11:49 -0700161#ECHO_N = @ICU_ECHO_N@
162#ECHO_C = @ICU_ECHO_C@
Jean-Baptiste Querub13da9d2009-07-17 17:53:22 -0700163
164# Commands to compile
165COMPILE.c= $(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) -c
166COMPILE.cc= $(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) -c
167
168# Commands to link
169LINK.c= $(CC) $(CFLAGS) $(LDFLAGS)
170LINK.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS)
171
172# Commands to make a shared library
claireho50294ea2010-05-03 15:44:48 -0700173SHLIB.c= $(CC) $(CFLAGS) $(LDFLAGS) -shared $(LD_SOOPTIONS)
174SHLIB.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(LD_SOOPTIONS)
Jean-Baptiste Querub13da9d2009-07-17 17:53:22 -0700175
176# Environment variable to set a runtime search path
177LDLIBRARYPATH_ENVVAR = LD_LIBRARY_PATH
178
179# Versioned target for a shared library.
180FINAL_SO_TARGET = $(SO_TARGET).$(SO_TARGET_VERSION)
181MIDDLE_SO_TARGET = $(SO_TARGET).$(SO_TARGET_VERSION_MAJOR)
182SHARED_OBJECT = $(FINAL_SO_TARGET)
183
184## How ICU libraries are named... ex. $(LIBICU)uc$(SO)
185# Prefix for the ICU library names
186ICUPREFIX = icu
187LIBPREFIX = lib
188LIBICU = $(LIBPREFIX)$(ICUPREFIX)
189
190## If we can't use the shared libraries, use the static libraries
191ifneq ($(ENABLE_SHARED),YES)
192STATIC_PREFIX_WHEN_USED = s
193else
194STATIC_PREFIX_WHEN_USED =
195endif
196
197# Static library prefix and file extension
198STATIC_PREFIX = s
199LIBSICU = $(LIBPREFIX)$(STATIC_PREFIX)$(ICUPREFIX)
200A = a
201SOBJ = $(SO)
202
203# Force removal [for make clean]
204RMV = rm -rf
205
206# Platform commands to remove or move executable and library targets
207# INSTALL-L installs libraries. Override in mh-* file to INSTALL_PROGRAM
208# when the library needs to have executable permissions
209INSTALL-S = $(INSTALL_PROGRAM)
Jean-Baptiste Queruc69afce2009-07-20 15:02:39 -0700210INSTALL-L = $(INSTALL_PROGRAM)
211#INSTALL-L = $(INSTALL_DATA)
Jean-Baptiste Querub13da9d2009-07-17 17:53:22 -0700212
213# Location of the libraries before "make install" is used
214LIBDIR=$(top_builddir)/lib
215
216# Location of the executables before "make install" is used
217BINDIR=$(top_builddir)/bin
218
Jean-Baptiste Querub0ac9372009-07-20 15:09:32 -0700219# overridden by icucross.mk
220TOOLBINDIR=$(BINDIR)
221TOOLLIBDIR=$(LIBDIR)
222
Jean-Baptiste Querub13da9d2009-07-17 17:53:22 -0700223# Current full path directory.
claireho27f65472011-06-09 11:11:49 -0700224CURR_FULL_DIR=$(shell pwd | sed 's/ /\\ /g')
Jean-Baptiste Querub13da9d2009-07-17 17:53:22 -0700225# Current full path directory for use in source code in a -D compiler option.
claireho27f65472011-06-09 11:11:49 -0700226CURR_SRCCODE_FULL_DIR=$(shell pwd | sed 's/ /\\ /')
Jean-Baptiste Querub13da9d2009-07-17 17:53:22 -0700227
228# Name flexibility for the library naming scheme. Any modifications should
229# be made in the mh- file for the specific platform.
230DATA_STUBNAME = data
231COMMON_STUBNAME = uc
232I18N_STUBNAME = i18n
233LAYOUT_STUBNAME = le
234LAYOUTEX_STUBNAME = lx
235IO_STUBNAME = io
236TOOLUTIL_STUBNAME = tu
237CTESTFW_STUBNAME = test
238
claireho27f65472011-06-09 11:11:49 -0700239# Just the libs.
240ICULIBS_DT = -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
241ICULIBS_UC = -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(COMMON_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
242ICULIBS_I18N = -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(I18N_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
243ICULIBS_LE = -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(LAYOUT_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
244ICULIBS_LX = -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(LAYOUTEX_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
245ICULIBS_IO = -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(IO_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
246ICULIBS_CTESTFW = -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(CTESTFW_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
247ICULIBS_TOOLUTIL = -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(TOOLUTIL_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
Jean-Baptiste Querub13da9d2009-07-17 17:53:22 -0700248# Link commands to link to ICU libs
claireho27f65472011-06-09 11:11:49 -0700249LLIBDIR = -L$(LIBDIR)
250LSTUBDIR = -L$(top_builddir)/stubdata
251LCTESTFW = -L$(top_builddir)/tools/ctestfw
252
253LIBICUDT = $(LLIBDIR) $(LSTUBDIR) $(ICULIBS_DT)
254LIBICUUC = $(LLIBDIR) $(ICULIBS_UC) $(LSTUBDIR) $(ICULIBS_DT)
255LIBICUI18N = $(LLIBDIR) $(ICULIBS_I18N)
256LIBICULE = $(LLIBDIR) $(ICULIBS_LE)
257LIBICULX = $(LLIBDIR) $(ICULIBS_LX)
258LIBCTESTFW = $(LCTESTFW) $(ICULIBS_CTESTFW)
259LIBICUTOOLUTIL = $(LLIBDIR) $(ICULIBS_TOOLUTIL)
260LIBICUIO = $(LLIBDIR) $(ICULIBS_IO)
Jean-Baptiste Querub13da9d2009-07-17 17:53:22 -0700261
262# Invoke, set library path for all ICU libraries.
Jean-Baptiste Querub0ac9372009-07-20 15:09:32 -0700263# overridden by icucross.mk
Jean-Baptiste Querub13da9d2009-07-17 17:53:22 -0700264INVOKE = $(LDLIBRARYPATH_ENVVAR)=$(LIBRARY_PATH_PREFIX)$(LIBDIR):$(top_builddir)/stubdata:$(top_builddir)/tools/ctestfw:$$$(LDLIBRARYPATH_ENVVAR) $(LEAK_CHECKER)
Jean-Baptiste Querub0ac9372009-07-20 15:09:32 -0700265# prefer stubdata
266PKGDATA_INVOKE = $(LDLIBRARYPATH_ENVVAR)=$(top_builddir)/stubdata:$(top_builddir)/tools/ctestfw:$(LIBRARY_PATH_PREFIX)$(LIBDIR):$$$(LDLIBRARYPATH_ENVVAR) $(LEAK_CHECKER) $(PKGDATA_INVOKE_OPTS)
Jean-Baptiste Querub13da9d2009-07-17 17:53:22 -0700267
268# Platform-specific setup
269include @platform_make_fragment@
270
271# When shared libraries are disabled and static libraries are enabled,
272# the C++ compiler must be used to link in the libraries for the tools.
273ifneq ($(ENABLE_SHARED),YES)
274LINK.c = $(LINK.cc)
275endif
276
Jean-Baptiste Querub0ac9372009-07-20 15:09:32 -0700277# some imported things from the cross env
278TOOLEXEEXT = $(EXEEXT)
279ifneq ($(strip $(cross_buildroot)),)
280include $(cross_buildroot)/config/icucross.mk
281else
282cross_buildroot = $(top_builddir)
283endif
284
285# optional include at top
286-include $(top_builddir)/icudefs.local