2 # Make definitions that are shared by the different subprojects of ICU.
6 # Copyright (C) 2000-2004, 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_PLATFORM_NAME = $(ICUDATA_BASENAME_VERSION)@ICUDATA_CHAR@
48 PKGDATA_LIBSTATICNAME = -L $(STATIC_PREFIX)$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)
49 ifeq ($(strip $(PKGDATA_MODE)),)
50 PKGDATA_MODE=@DATA_PACKAGING_MODE@
52 ifeq ($(PKGDATA_MODE),common)
53 ICUDATA_NAME = $(ICUDATA_PLATFORM_NAME)
54 ICUPKGDATA_DIR = $(ICUDATA_DIR)
56 ifeq ($(PKGDATA_MODE),dll)
57 ICUDATA_NAME = $(ICUDATA_PLATFORM_NAME)
58 PKGDATA_LIBNAME = -L $(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)
59 ICUPKGDATA_DIR = $(libdir)
61 ICUDATA_NAME = $(ICUDATA_PLATFORM_NAME)
62 ICUPKGDATA_DIR = $(ICUDATA_DIR)
66 # These are defined here because mh-cygwin-msvc needs to override these values.
67 ICUPKGDATA_INSTALL_DIR = $(DESTDIR)$(ICUPKGDATA_DIR)
68 ICUPKGDATA_INSTALL_LIBDIR = $(DESTDIR)$(libdir)
70 # If defined to a valid value, pkgdata will generate a data library more quickly
71 GENCCODE_ASSEMBLY = @GENCCODE_ASSEMBLY@
73 # ICU specific directories
75 pkgdatadir = $(datadir)/$(PACKAGE)$(ICULIBSUFFIX)/$(VERSION)
76 pkglibdir = $(libdir)/$(PACKAGE)$(ICULIBSUFFIX)/$(VERSION)
77 pkgsysconfdir = $(sysconfdir)/$(PACKAGE)$(ICULIBSUFFIX)
79 # Installation programs
81 MKINSTALLDIRS = $(SHELL) $(top_srcdir)/mkinstalldirs
84 INSTALL_PROGRAM = @INSTALL_PROGRAM@
85 INSTALL_DATA = @INSTALL_DATA@
86 INSTALL_SCRIPT = @INSTALL_SCRIPT@
88 # Library suffix (to support different C++ compilers)
90 ICULIBSUFFIX=@ICULIBSUFFIX@
94 ENABLE_DEBUG = @ENABLE_DEBUG@
95 ENABLE_RELEASE = @ENABLE_RELEASE@
99 AIX_SHLIB = @AIX_SHLIB@
101 ARFLAGS := @ARFLAGS@ $(ARFLAGS)
103 COMPILE_LINK_ENVVAR = @COMPILE_LINK_ENVVAR@
105 # Various flags for the tools
107 # DEFS is for common macro definitions.
108 # configure prevents user defined DEFS, and configure's DEFS is not needed
109 # So we ignore the DEFS that comes from configure
111 # CFLAGS is for C only flags
113 # CXXFLAGS is for C++ only flags
114 CXXFLAGS = @CXXFLAGS@
115 # CPPFLAGS is for C Pre-Processor flags
116 CPPFLAGS = @CPPFLAGS@
117 # DEFAULT_LIBS are the default libraries to link against
118 DEFAULT_LIBS = @LIBS@
119 # LIB_M is for linking against the math library
121 # OUTOPT is for creating a specific output name
124 ENABLE_RPATH = @ENABLE_RPATH@
125 ifeq ($(ENABLE_RPATH),YES)
126 RPATHLDFLAGS = $(LD_RPATH)$(LD_RPATH_PRE)$(libdir)
128 LDFLAGS = @LDFLAGS@ $(RPATHLDFLAGS)
130 # What kind of libraries are we building and linking against?
131 ENABLE_STATIC = @ENABLE_STATIC@
132 ENABLE_SHARED = @ENABLE_SHARED@
139 # Commands to compile
140 COMPILE.c= $(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) -c
141 COMPILE.cc= $(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) -c
144 LINK.c= $(CC) $(CFLAGS) $(LDFLAGS)
145 LINK.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS)
147 # Commands to make a shared library
148 SHLIB.c= $(CC) $(CFLAGS) $(LDFLAGS) -shared
149 SHLIB.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared
151 # Environment variable to set a runtime search path
152 LDLIBRARYPATH_ENVVAR = LD_LIBRARY_PATH
154 # Versioned target for a shared library.
155 FINAL_SO_TARGET = $(SO_TARGET).$(SO_TARGET_VERSION)
156 MIDDLE_SO_TARGET = $(SO_TARGET).$(SO_TARGET_VERSION_MAJOR)
158 ## How ICU libraries are named... ex. $(LIBICU)uc$(SO)
159 # Prefix for the ICU library names
162 LIBICU = $(LIBPREFIX)$(ICUPREFIX)
164 ## If we can't use the shared libraries, use the static libraries
165 ifneq ($(ENABLE_SHARED),YES)
166 STATIC_PREFIX_WHEN_USED = s
168 STATIC_PREFIX_WHEN_USED =
171 # Static library prefix and file extension
173 LIBSICU = $(LIBPREFIX)$(STATIC_PREFIX)$(ICUPREFIX)
176 # Force removal [for make clean]
179 # Platform commands to remove or move executable and library targets
180 # INSTALL-L installs libraries. Override in mh-* file to INSTALL_PROGRAM
181 # when the library needs to have executable permissions
182 INSTALL-S = $(INSTALL_PROGRAM)
183 INSTALL-L = $(INSTALL_DATA)
185 # Location of the libraries before "make install" is used
186 LIBDIR=$(top_builddir)/lib
188 # Location of the executables before "make install" is used
189 BINDIR=$(top_builddir)/bin
191 # Current full path directory.
192 CURR_FULL_DIR=$(shell pwd)
193 # Current full path directory for use in source code in a -D compiler option.
194 CURR_SRCCODE_FULL_DIR=$(shell pwd)
196 # Name flexibility for the library naming scheme. Any modifications should
197 # be made in the mh- file for the specific platform.
202 LAYOUTEX_STUBNAME = lx
204 TOOLUTIL_STUBNAME = tu
205 CTESTFW_STUBNAME = test
207 # Link commands to link to ICU libs
208 LIBICUDT= -L$(LIBDIR) -L$(top_builddir)/stubdata -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
209 LIBICUUC= -L$(LIBDIR) -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(COMMON_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX) $(LIBICUDT)
210 LIBICUI18N= -L$(LIBDIR) -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(I18N_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
211 LIBICULE= -L$(LIBDIR) -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(LAYOUT_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
212 LIBICULX= -L$(LIBDIR) -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(LAYOUTEX_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
213 LIBCTESTFW= -L$(top_builddir)/tools/ctestfw -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(CTESTFW_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
214 LIBICUTOOLUTIL= -L$(LIBDIR) -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(TOOLUTIL_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
215 LIBICUIO= -L$(LIBDIR) -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(IO_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
217 # Invoke, set library path for all ICU libraries.
218 INVOKE = $(LDLIBRARYPATH_ENVVAR)=$(LIBDIR):$(top_builddir)/stubdata:$(top_builddir)/tools/ctestfw:$$$(LDLIBRARYPATH_ENVVAR) $(LEAK_CHECKER)
220 # Platform-specific setup
221 include @platform_make_fragment@
223 # When shared libraries are disabled and static libraries are enabled,
224 # the C++ compiler must be used to link in the libraries for the tools.
225 ifneq ($(ENABLE_SHARED),YES)