1 # Make definitions that are shared by the different subprojects of ICU.
5 # Copyright (C) 2000-2008, International Business Machines Corporation and others.
9 # Some of these variables are overridden in the config/mh-* files.
11 # Please be sure to update config/Makefile.inc.in if you add something here.
18 # Standard directories
21 exec_prefix = @exec_prefix@
25 datarootdir = @datarootdir@
28 includedir = @includedir@
30 sysconfdir = @sysconfdir@
36 UNICODE_VERSION = @UNICODE_VERSION@
37 SO_TARGET_VERSION = @LIB_VERSION@
38 SO_TARGET_VERSION_MAJOR = @LIB_VERSION_MAJOR@
40 # The ICU data external name is usually icudata; the entry point name is
41 # the version-dependent name (for no particular reason except it was easier
42 # to change the build this way). When building in common mode, the data
43 # name is the versioned platform-dependent one.
45 ICUDATA_DIR = @pkgicudatadir@/$(PACKAGE)$(ICULIBSUFFIX)/$(VERSION)
47 ICUDATA_BASENAME_VERSION = $(ICUPREFIX)dt@LIB_VERSION_MAJOR@
48 ICUDATA_ENTRY_POINT = $(ICUDATA_BASENAME_VERSION)
49 ICUDATA_CHAR = @ICUDATA_CHAR@
50 ICUDATA_PLATFORM_NAME = $(ICUDATA_BASENAME_VERSION)$(ICUDATA_CHAR)
51 PKGDATA_LIBSTATICNAME = -L $(STATIC_PREFIX)$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)
52 ifeq ($(strip $(PKGDATA_MODE)),)
53 PKGDATA_MODE=@DATA_PACKAGING_MODE@
55 ifeq ($(PKGDATA_MODE),common)
56 ICUDATA_NAME = $(ICUDATA_PLATFORM_NAME)
57 ICUPKGDATA_DIR = $(ICUDATA_DIR)
59 ifeq ($(PKGDATA_MODE),dll)
60 ICUDATA_NAME = $(ICUDATA_PLATFORM_NAME)
61 PKGDATA_LIBNAME = -L $(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)
62 ICUPKGDATA_DIR = $(libdir)
64 ICUDATA_NAME = $(ICUDATA_PLATFORM_NAME)
65 ICUPKGDATA_DIR = $(ICUDATA_DIR)
68 # This is needed so that make -j2 doesn't complain when invoking pkgdata's make
69 PKGDATA_INVOKE_OPTS = MAKEFLAGS=
71 # These are defined here because mh-cygwin-msvc needs to override these values.
72 ICUPKGDATA_INSTALL_DIR = $(DESTDIR)$(ICUPKGDATA_DIR)
73 ICUPKGDATA_INSTALL_LIBDIR = $(DESTDIR)$(libdir)
75 # If defined to a valid value, pkgdata will generate a data library more quickly
76 GENCCODE_ASSEMBLY = @GENCCODE_ASSEMBLY@
78 # ICU specific directories
80 pkgdatadir = $(datadir)/$(PACKAGE)$(ICULIBSUFFIX)/$(VERSION)
81 pkglibdir = $(libdir)/$(PACKAGE)$(ICULIBSUFFIX)/$(VERSION)
82 pkgsysconfdir = $(sysconfdir)/$(PACKAGE)$(ICULIBSUFFIX)
84 # Installation programs
86 MKINSTALLDIRS = $(SHELL) $(top_srcdir)/mkinstalldirs
89 INSTALL_PROGRAM = @INSTALL_PROGRAM@
90 INSTALL_DATA = @INSTALL_DATA@
91 INSTALL_SCRIPT = @INSTALL_SCRIPT@
93 # Library suffix (to support different C++ compilers)
95 ICULIBSUFFIX=@ICULIBSUFFIX@
99 ENABLE_DEBUG = @ENABLE_DEBUG@
100 ENABLE_RELEASE = @ENABLE_RELEASE@
105 ARFLAGS = @ARFLAGS@ r
107 COMPILE_LINK_ENVVAR = @COMPILE_LINK_ENVVAR@
109 # Various flags for the tools
111 # DEFS is for common macro definitions.
112 # configure prevents user defined DEFS, and configure's DEFS is not needed
113 # So we ignore the DEFS that comes from configure
115 # CFLAGS is for C only flags
117 # CXXFLAGS is for C++ only flags
118 CXXFLAGS = @CXXFLAGS@
119 # CPPFLAGS is for C Pre-Processor flags
120 CPPFLAGS = @CPPFLAGS@
121 # LIBCFLAGS are the flags for static and shared libraries.
122 LIBCFLAGS = @LIBCFLAGS@
123 # LIBCXXFLAGS are the flags for static and shared libraries.
124 LIBCXXFLAGS = @LIBCXXFLAGS@
125 # DEFAULT_LIBS are the default libraries to link against
126 DEFAULT_LIBS = @LIBS@
127 # LIB_M is for linking against the math library
129 # LIB_THREAD is for linking against the threading library
130 LIB_THREAD = @LIB_THREAD@
131 # OUTOPT is for creating a specific output name
132 OUTOPT = -o # The extra space after the argument is needed.
133 # AR_OUTOPT is for creating a specific output name for static libraries.
136 ENABLE_RPATH = @ENABLE_RPATH@
137 ifeq ($(ENABLE_RPATH),YES)
138 RPATHLDFLAGS = $(LD_RPATH)$(LD_RPATH_PRE)$(libdir)
140 LDFLAGS = @LDFLAGS@ $(RPATHLDFLAGS)
142 # What kind of libraries are we building and linking against?
143 ENABLE_STATIC = @ENABLE_STATIC@
144 ENABLE_SHARED = @ENABLE_SHARED@
151 # Commands to compile
152 COMPILE.c= $(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) -c
153 COMPILE.cc= $(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) -c
156 LINK.c= $(CC) $(CFLAGS) $(LDFLAGS)
157 LINK.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS)
159 # Commands to make a shared library
160 SHLIB.c= $(CC) $(CFLAGS) $(LDFLAGS) -shared
161 SHLIB.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared
163 # Environment variable to set a runtime search path
164 LDLIBRARYPATH_ENVVAR = LD_LIBRARY_PATH
166 # Versioned target for a shared library.
167 FINAL_SO_TARGET = $(SO_TARGET).$(SO_TARGET_VERSION)
168 MIDDLE_SO_TARGET = $(SO_TARGET).$(SO_TARGET_VERSION_MAJOR)
169 SHARED_OBJECT = $(FINAL_SO_TARGET)
171 ## How ICU libraries are named... ex. $(LIBICU)uc$(SO)
172 # Prefix for the ICU library names
175 LIBICU = $(LIBPREFIX)$(ICUPREFIX)
177 ## If we can't use the shared libraries, use the static libraries
178 ifneq ($(ENABLE_SHARED),YES)
179 STATIC_PREFIX_WHEN_USED = s
181 STATIC_PREFIX_WHEN_USED =
184 # Static library prefix and file extension
186 LIBSICU = $(LIBPREFIX)$(STATIC_PREFIX)$(ICUPREFIX)
190 # Force removal [for make clean]
193 # Platform commands to remove or move executable and library targets
194 # INSTALL-L installs libraries. Override in mh-* file to INSTALL_PROGRAM
195 # when the library needs to have executable permissions
196 INSTALL-S = $(INSTALL_PROGRAM)
197 INSTALL-L = $(INSTALL_PROGRAM)
198 #INSTALL-L = $(INSTALL_DATA)
200 # Location of the libraries before "make install" is used
201 LIBDIR=$(top_builddir)/lib
203 # Location of the executables before "make install" is used
204 BINDIR=$(top_builddir)/bin
206 # Current full path directory.
207 CURR_FULL_DIR=$(shell pwd)
208 # Current full path directory for use in source code in a -D compiler option.
209 CURR_SRCCODE_FULL_DIR=$(shell pwd)
211 # Name flexibility for the library naming scheme. Any modifications should
212 # be made in the mh- file for the specific platform.
217 LAYOUTEX_STUBNAME = lx
219 TOOLUTIL_STUBNAME = tu
220 CTESTFW_STUBNAME = test
222 # Link commands to link to ICU libs
223 LIBICUDT= -L$(LIBDIR) -L$(top_builddir)/stubdata -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
224 LIBICUUC= -L$(LIBDIR) -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(COMMON_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX) $(LIBICUDT)
225 LIBICUI18N= -L$(LIBDIR) -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(I18N_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
226 LIBICULE= -L$(LIBDIR) -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(LAYOUT_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
227 LIBICULX= -L$(LIBDIR) -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(LAYOUTEX_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
228 LIBCTESTFW= -L$(top_builddir)/tools/ctestfw -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(CTESTFW_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
229 LIBICUTOOLUTIL= -L$(LIBDIR) -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(TOOLUTIL_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
230 LIBICUIO= -L$(LIBDIR) -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(IO_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
232 # Invoke, set library path for all ICU libraries.
233 INVOKE = $(LDLIBRARYPATH_ENVVAR)=$(LIBRARY_PATH_PREFIX)$(LIBDIR):$(top_builddir)/stubdata:$(top_builddir)/tools/ctestfw:$$$(LDLIBRARYPATH_ENVVAR) $(LEAK_CHECKER)
235 # Platform-specific setup
236 include @platform_make_fragment@
238 # When shared libraries are disabled and static libraries are enabled,
239 # the C++ compiler must be used to link in the libraries for the tools.
240 ifneq ($(ENABLE_SHARED),YES)