2 # Make definitions that are shared by the different subprojects of ICU.
6 # Copyright (C) 2000-2005, International Business Machines Corporation and others.
10 # Some of these variables are overridden in the config/mh-* files.
17 # Standard directories
20 exec_prefix = @exec_prefix@
26 includedir = @includedir@
28 sysconfdir = @sysconfdir@
34 UNICODE_VERSION = @UNICODE_VERSION@
35 SO_TARGET_VERSION = @LIB_VERSION@
36 SO_TARGET_VERSION_MAJOR = @LIB_VERSION_MAJOR@
38 # The ICU data external name is usually icudata; the entry point name is
39 # the version-dependent name (for no particular reason except it was easier
40 # to change the build this way). When building in common mode, the data
41 # name is the versioned platform-dependent one.
43 ICUDATA_DIR = @pkgicudatadir@/$(PACKAGE)$(ICULIBSUFFIX)/$(VERSION)
45 ICUDATA_BASENAME_VERSION = $(ICUPREFIX)dt@LIB_VERSION_MAJOR@
46 ICUDATA_ENTRY_POINT = $(ICUDATA_BASENAME_VERSION)
47 ICUDATA_CHAR = @ICUDATA_CHAR@
48 ICUDATA_PLATFORM_NAME = $(ICUDATA_BASENAME_VERSION)$(ICUDATA_CHAR)
49 PKGDATA_LIBSTATICNAME = -L $(STATIC_PREFIX)$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)
50 ifeq ($(strip $(PKGDATA_MODE)),)
51 PKGDATA_MODE=@DATA_PACKAGING_MODE@
53 ifeq ($(PKGDATA_MODE),common)
54 ICUDATA_NAME = $(ICUDATA_PLATFORM_NAME)
55 ICUPKGDATA_DIR = $(ICUDATA_DIR)
57 ifeq ($(PKGDATA_MODE),dll)
58 ICUDATA_NAME = $(ICUDATA_PLATFORM_NAME)
59 PKGDATA_LIBNAME = -L $(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)
60 ICUPKGDATA_DIR = $(libdir)
62 ICUDATA_NAME = $(ICUDATA_PLATFORM_NAME)
63 ICUPKGDATA_DIR = $(ICUDATA_DIR)
67 # These are defined here because mh-cygwin-msvc needs to override these values.
68 ICUPKGDATA_INSTALL_DIR = $(DESTDIR)$(ICUPKGDATA_DIR)
69 ICUPKGDATA_INSTALL_LIBDIR = $(DESTDIR)$(libdir)
71 # If defined to a valid value, pkgdata will generate a data library more quickly
72 GENCCODE_ASSEMBLY = @GENCCODE_ASSEMBLY@
74 # ICU specific directories
76 pkgdatadir = $(datadir)/$(PACKAGE)$(ICULIBSUFFIX)/$(VERSION)
77 pkglibdir = $(libdir)/$(PACKAGE)$(ICULIBSUFFIX)/$(VERSION)
78 pkgsysconfdir = $(sysconfdir)/$(PACKAGE)$(ICULIBSUFFIX)
80 # Installation programs
82 MKINSTALLDIRS = $(SHELL) $(top_srcdir)/mkinstalldirs
85 INSTALL_PROGRAM = @INSTALL_PROGRAM@
86 INSTALL_DATA = @INSTALL_DATA@
87 INSTALL_SCRIPT = @INSTALL_SCRIPT@
89 # Library suffix (to support different C++ compilers)
91 ICULIBSUFFIX=@ICULIBSUFFIX@
95 ENABLE_DEBUG = @ENABLE_DEBUG@
96 ENABLE_RELEASE = @ENABLE_RELEASE@
100 AIX_SHLIB = @AIX_SHLIB@
102 ARFLAGS := @ARFLAGS@ $(ARFLAGS)
104 COMPILE_LINK_ENVVAR = @COMPILE_LINK_ENVVAR@
106 # Various flags for the tools
108 # DEFS is for common macro definitions.
109 # configure prevents user defined DEFS, and configure's DEFS is not needed
110 # So we ignore the DEFS that comes from configure
112 # CFLAGS is for C only flags
114 # CXXFLAGS is for C++ only flags
115 CXXFLAGS = @CXXFLAGS@
116 # CPPFLAGS is for C Pre-Processor flags
117 CPPFLAGS = @CPPFLAGS@
118 # DEFAULT_LIBS are the default libraries to link against
119 DEFAULT_LIBS = @LIBS@
120 # LIB_M is for linking against the math library
122 # OUTOPT is for creating a specific output name
125 ENABLE_RPATH = @ENABLE_RPATH@
126 ifeq ($(ENABLE_RPATH),YES)
127 RPATHLDFLAGS = $(LD_RPATH)$(LD_RPATH_PRE)$(libdir)
129 LDFLAGS = @LDFLAGS@ $(RPATHLDFLAGS)
131 # What kind of libraries are we building and linking against?
132 ENABLE_STATIC = @ENABLE_STATIC@
133 ENABLE_SHARED = @ENABLE_SHARED@
140 # Commands to compile
141 COMPILE.c= $(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) -c
142 COMPILE.cc= $(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) -c
145 LINK.c= $(CC) $(CFLAGS) $(LDFLAGS)
146 LINK.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS)
148 # Commands to make a shared library
149 SHLIB.c= $(CC) $(CFLAGS) $(LDFLAGS) -shared
150 SHLIB.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared
152 # Environment variable to set a runtime search path
153 LDLIBRARYPATH_ENVVAR = LD_LIBRARY_PATH
155 # Versioned target for a shared library.
156 FINAL_SO_TARGET = $(SO_TARGET).$(SO_TARGET_VERSION)
157 MIDDLE_SO_TARGET = $(SO_TARGET).$(SO_TARGET_VERSION_MAJOR)
158 SHARED_OBJECT = $(FINAL_SO_TARGET)
160 ## How ICU libraries are named... ex. $(LIBICU)uc$(SO)
161 # Prefix for the ICU library names
164 LIBICU = $(LIBPREFIX)$(ICUPREFIX)
166 ## If we can't use the shared libraries, use the static libraries
167 ifneq ($(ENABLE_SHARED),YES)
168 STATIC_PREFIX_WHEN_USED = s
170 STATIC_PREFIX_WHEN_USED =
173 # Static library prefix and file extension
175 LIBSICU = $(LIBPREFIX)$(STATIC_PREFIX)$(ICUPREFIX)
179 # Force removal [for make clean]
182 # Platform commands to remove or move executable and library targets
183 # INSTALL-L installs libraries. Override in mh-* file to INSTALL_PROGRAM
184 # when the library needs to have executable permissions
185 INSTALL-S = $(INSTALL_PROGRAM)
186 INSTALL-L = $(INSTALL_DATA)
188 # Location of the libraries before "make install" is used
189 LIBDIR=$(top_builddir)/lib
191 # Location of the executables before "make install" is used
192 BINDIR=$(top_builddir)/bin
194 # Current full path directory.
195 CURR_FULL_DIR=$(shell pwd)
196 # Current full path directory for use in source code in a -D compiler option.
197 CURR_SRCCODE_FULL_DIR=$(shell pwd)
199 # Name flexibility for the library naming scheme. Any modifications should
200 # be made in the mh- file for the specific platform.
205 LAYOUTEX_STUBNAME = lx
207 TOOLUTIL_STUBNAME = tu
208 CTESTFW_STUBNAME = test
210 # Link commands to link to ICU libs
211 LIBICUDT= -L$(LIBDIR) -L$(top_builddir)/stubdata -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
212 LIBICUUC= -L$(LIBDIR) -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(COMMON_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX) $(LIBICUDT)
213 LIBICUI18N= -L$(LIBDIR) -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(I18N_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
214 LIBICULE= -L$(LIBDIR) -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(LAYOUT_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
215 LIBICULX= -L$(LIBDIR) -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(LAYOUTEX_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
216 LIBCTESTFW= -L$(top_builddir)/tools/ctestfw -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(CTESTFW_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
217 LIBICUTOOLUTIL= -L$(LIBDIR) -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(TOOLUTIL_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
218 LIBICUIO= -L$(LIBDIR) -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(IO_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
220 # Invoke, set library path for all ICU libraries.
221 INVOKE = $(LDLIBRARYPATH_ENVVAR)=$(LIBRARY_PATH_PREFIX)$(LIBDIR):$(top_builddir)/stubdata:$(top_builddir)/tools/ctestfw:$$$(LDLIBRARYPATH_ENVVAR) $(LEAK_CHECKER)
223 # Platform-specific setup
224 include @platform_make_fragment@
226 # When shared libraries are disabled and static libraries are enabled,
227 # the C++ compiler must be used to link in the libraries for the tools.
228 ifneq ($(ENABLE_SHARED),YES)