]> git.saurik.com Git - apple/icu.git/blame - icuSources/icudefs.mk.in
ICU-57131.0.1.tar.gz
[apple/icu.git] / icuSources / icudefs.mk.in
CommitLineData
b75a7d8f
A
1# Make definitions that are shared by the different subprojects of ICU.
2#
3# Yves Arrouye.
4#
2ca993e8 5# Copyright (C) 2000-2016, International Business Machines Corporation and others.
b75a7d8f
A
6# All Rights Reserved.
7
8#
9# Some of these variables are overridden in the config/mh-* files.
b331163b 10#
46f4442e 11# Please be sure to update config/Makefile.inc.in if you add something here.
b75a7d8f
A
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@
46f4442e 25datarootdir = @datarootdir@
b75a7d8f
A
26datadir = @datadir@
27libdir = @libdir@
28includedir = @includedir@
29mandir = @mandir@
30sysconfdir = @sysconfdir@
729e4ab9
A
31# controls the include of $(top_builddir)/icucross.mk at bottom of file
32cross_compiling = @cross_compiling@
33cross_buildroot = @cross_buildroot@
b75a7d8f
A
34
35# Package information
36
729e4ab9
A
37PACKAGE_ICU_DESCRIPTION = "International Components for Unicode"
38PACKAGE_ICU_URL = "http://icu-project.org"
b75a7d8f
A
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
374ca955 46# the version-dependent name (for no particular reason except it was easier
b75a7d8f
A
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@
729e4ab9
A
53# the entry point is almost like the basename, but has the lib suffix.
54ICUDATA_ENTRY_POINT = $(ICUPREFIX)dt@ICULIBSUFFIXCNAME@@LIB_VERSION_MAJOR@
73c04bcf
A
55ICUDATA_CHAR = @ICUDATA_CHAR@
56ICUDATA_PLATFORM_NAME = $(ICUDATA_BASENAME_VERSION)$(ICUDATA_CHAR)
374ca955 57PKGDATA_LIBSTATICNAME = -L $(STATIC_PREFIX)$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)
b75a7d8f
A
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)
374ca955
A
66ICUDATA_NAME = $(ICUDATA_PLATFORM_NAME)
67PKGDATA_LIBNAME = -L $(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)
b75a7d8f
A
68ICUPKGDATA_DIR = $(libdir)
69else
729e4ab9
A
70ifeq ($(PKGDATA_MODE),static)
71ICUDATA_NAME = $(ICUDATA_PLATFORM_NAME)
72PKGDATA_LIBNAME = -L $(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)
73ICUPKGDATA_DIR = $(libdir)
74else
374ca955 75ICUDATA_NAME = $(ICUDATA_PLATFORM_NAME)
b75a7d8f
A
76ICUPKGDATA_DIR = $(ICUDATA_DIR)
77endif
78endif
729e4ab9 79endif
b75a7d8f 80
374ca955
A
81# These are defined here because mh-cygwin-msvc needs to override these values.
82ICUPKGDATA_INSTALL_DIR = $(DESTDIR)$(ICUPKGDATA_DIR)
83ICUPKGDATA_INSTALL_LIBDIR = $(DESTDIR)$(libdir)
84
85# If defined to a valid value, pkgdata will generate a data library more quickly
86GENCCODE_ASSEMBLY = @GENCCODE_ASSEMBLY@
87
b75a7d8f
A
88# ICU specific directories
89
90pkgdatadir = $(datadir)/$(PACKAGE)$(ICULIBSUFFIX)/$(VERSION)
91pkglibdir = $(libdir)/$(PACKAGE)$(ICULIBSUFFIX)/$(VERSION)
92pkgsysconfdir = $(sysconfdir)/$(PACKAGE)$(ICULIBSUFFIX)
93
94# Installation programs
95
96MKINSTALLDIRS = $(SHELL) $(top_srcdir)/mkinstalldirs
97
98INSTALL = @INSTALL@
99INSTALL_PROGRAM = @INSTALL_PROGRAM@
100INSTALL_DATA = @INSTALL_DATA@
101INSTALL_SCRIPT = @INSTALL_SCRIPT@
102
103# Library suffix (to support different C++ compilers)
104
105ICULIBSUFFIX=@ICULIBSUFFIX@
106
107# Compiler and tools
108
374ca955
A
109ENABLE_DEBUG = @ENABLE_DEBUG@
110ENABLE_RELEASE = @ENABLE_RELEASE@
b75a7d8f
A
111EXEEXT = @EXEEXT@
112CC = @CC@
113CXX = @CXX@
b75a7d8f 114AR = @AR@
46f4442e 115ARFLAGS = @ARFLAGS@ r
b75a7d8f
A
116RANLIB = @RANLIB@
117COMPILE_LINK_ENVVAR = @COMPILE_LINK_ENVVAR@
729e4ab9 118UCLN_NO_AUTO_CLEANUP = @UCLN_NO_AUTO_CLEANUP@
b75a7d8f
A
119
120# Various flags for the tools
121
374ca955
A
122# DEFS is for common macro definitions.
123# configure prevents user defined DEFS, and configure's DEFS is not needed
124# So we ignore the DEFS that comes from configure
4388f060
A
125# U_ATTRIBUTE_DEPRECATED is defined to hide warnings about deprecated API warnings.
126DEFS = -DU_ATTRIBUTE_DEPRECATED=
b75a7d8f
A
127# CFLAGS is for C only flags
128CFLAGS = @CFLAGS@
129# CXXFLAGS is for C++ only flags
130CXXFLAGS = @CXXFLAGS@
131# CPPFLAGS is for C Pre-Processor flags
132CPPFLAGS = @CPPFLAGS@
46f4442e
A
133# LIBCFLAGS are the flags for static and shared libraries.
134LIBCFLAGS = @LIBCFLAGS@
135# LIBCXXFLAGS are the flags for static and shared libraries.
136LIBCXXFLAGS = @LIBCXXFLAGS@
b75a7d8f
A
137# DEFAULT_LIBS are the default libraries to link against
138DEFAULT_LIBS = @LIBS@
139# LIB_M is for linking against the math library
140LIB_M = @LIB_M@
46f4442e
A
141# LIB_THREAD is for linking against the threading library
142LIB_THREAD = @LIB_THREAD@
b75a7d8f 143# OUTOPT is for creating a specific output name
46f4442e
A
144OUTOPT = -o # The extra space after the argument is needed.
145# AR_OUTOPT is for creating a specific output name for static libraries.
146AR_OUTOPT =
b75a7d8f
A
147
148ENABLE_RPATH = @ENABLE_RPATH@
149ifeq ($(ENABLE_RPATH),YES)
150RPATHLDFLAGS = $(LD_RPATH)$(LD_RPATH_PRE)$(libdir)
151endif
152LDFLAGS = @LDFLAGS@ $(RPATHLDFLAGS)
153
154# What kind of libraries are we building and linking against?
155ENABLE_STATIC = @ENABLE_STATIC@
156ENABLE_SHARED = @ENABLE_SHARED@
157
158# Echo w/o newline
159
729e4ab9
A
160#ECHO_N = @ICU_ECHO_N@
161#ECHO_C = @ICU_ECHO_C@
b75a7d8f
A
162
163# Commands to compile
164COMPILE.c= $(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) -c
165COMPILE.cc= $(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) -c
166
167# Commands to link
2ca993e8
A
168LINK.c= $(CC) $(CFLAGS) $(LDFLAGS) $(LINKFLAGS)
169LINK.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) $(LINKFLAGS)
b75a7d8f
A
170
171# Commands to make a shared library
729e4ab9
A
172SHLIB.c= $(CC) $(CFLAGS) $(LDFLAGS) -shared $(LD_SOOPTIONS)
173SHLIB.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(LD_SOOPTIONS)
b75a7d8f 174
51004dcb
A
175# ICU_MSG
176ICU_MSG=@echo " $(1) "
177
178# Do not show the large compiling arguments by default.
179# To use:
180# change
181# $(CC) -o foo
182# to
183# $(call SILENT_COMPILE,$(CC) -o foo)
184ifndef VERBOSE
185 SILENT_COMPILE=$(call ICU_MSG,$(notdir $(firstword $(1)))) "... " $< && $(1) || \
186 ( echo "*** Failed compilation command follows: ----------------------------------------------------------" ; \
187 echo "$(1)" ; \
188 echo "--- ( rebuild with \"$(MAKE) VERBOSE=1 $(MAKECMDGOALS)\" to show all parameters ) --------" ; \
189 false )
190else
191 SILENT_COMPILE=$(1)
192endif
193
b75a7d8f
A
194# Environment variable to set a runtime search path
195LDLIBRARYPATH_ENVVAR = LD_LIBRARY_PATH
196
197# Versioned target for a shared library.
198FINAL_SO_TARGET = $(SO_TARGET).$(SO_TARGET_VERSION)
199MIDDLE_SO_TARGET = $(SO_TARGET).$(SO_TARGET_VERSION_MAJOR)
73c04bcf 200SHARED_OBJECT = $(FINAL_SO_TARGET)
b75a7d8f
A
201
202## How ICU libraries are named... ex. $(LIBICU)uc$(SO)
203# Prefix for the ICU library names
204ICUPREFIX = icu
374ca955
A
205LIBPREFIX = lib
206LIBICU = $(LIBPREFIX)$(ICUPREFIX)
207
208## If we can't use the shared libraries, use the static libraries
209ifneq ($(ENABLE_SHARED),YES)
210STATIC_PREFIX_WHEN_USED = s
211else
212STATIC_PREFIX_WHEN_USED =
213endif
214
215# Static library prefix and file extension
216STATIC_PREFIX = s
217LIBSICU = $(LIBPREFIX)$(STATIC_PREFIX)$(ICUPREFIX)
218A = a
73c04bcf 219SOBJ = $(SO)
b75a7d8f
A
220
221# Force removal [for make clean]
222RMV = rm -rf
374ca955 223
b75a7d8f 224# Platform commands to remove or move executable and library targets
374ca955
A
225# INSTALL-L installs libraries. Override in mh-* file to INSTALL_PROGRAM
226# when the library needs to have executable permissions
b75a7d8f 227INSTALL-S = $(INSTALL_PROGRAM)
46f4442e
A
228INSTALL-L = $(INSTALL_PROGRAM)
229#INSTALL-L = $(INSTALL_DATA)
b75a7d8f 230
374ca955
A
231# Location of the libraries before "make install" is used
232LIBDIR=$(top_builddir)/lib
233
234# Location of the executables before "make install" is used
235BINDIR=$(top_builddir)/bin
236
729e4ab9
A
237# overridden by icucross.mk
238TOOLBINDIR=$(BINDIR)
239TOOLLIBDIR=$(LIBDIR)
240
374ca955
A
241# Name flexibility for the library naming scheme. Any modifications should
242# be made in the mh- file for the specific platform.
243DATA_STUBNAME = data
244COMMON_STUBNAME = uc
245I18N_STUBNAME = i18n
246LAYOUT_STUBNAME = le
247LAYOUTEX_STUBNAME = lx
248IO_STUBNAME = io
249TOOLUTIL_STUBNAME = tu
250CTESTFW_STUBNAME = test
251
b331163b
A
252# get these from pkg-config, if available
253ICULEHB_CFLAGS=@ICULEHB_CFLAGS@
254ICULEHB_LIBS=@ICULEHB_LIBS@
255ifneq ($(ICULEHB_CFLAGS),)
256USING_ICULEHB=yes
257ICULEHB_TRUE=
258ICULEHB_FALSE=#
259ICULIBS_LE=$(ICULEHB_LIBS)
260ICULE_CFLAGS=$(ICULEHB_CFLAGS) -DUSING_ICULEHB
261else
262USING_ICULEHB=no
263ICULEHB_TRUE=#
264ICULEHB_FALSE=
265ICULIBS_LE = -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(LAYOUT_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
266ICULE_CFLAGS=-I$(top_srcdir)
267endif
268
729e4ab9
A
269# Just the libs.
270ICULIBS_DT = -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
271ICULIBS_UC = -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(COMMON_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
272ICULIBS_I18N = -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(I18N_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
729e4ab9
A
273ICULIBS_LX = -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(LAYOUTEX_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
274ICULIBS_IO = -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(IO_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
275ICULIBS_CTESTFW = -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(CTESTFW_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
276ICULIBS_TOOLUTIL = -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(TOOLUTIL_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
b75a7d8f 277# Link commands to link to ICU libs
729e4ab9
A
278LLIBDIR = -L$(LIBDIR)
279LSTUBDIR = -L$(top_builddir)/stubdata
280LCTESTFW = -L$(top_builddir)/tools/ctestfw
281
282LIBICUDT = $(LLIBDIR) $(LSTUBDIR) $(ICULIBS_DT)
283LIBICUUC = $(LLIBDIR) $(ICULIBS_UC) $(LSTUBDIR) $(ICULIBS_DT)
284LIBICUI18N = $(LLIBDIR) $(ICULIBS_I18N)
b331163b 285LIBICULE = $(ICULEHB_CFLAGS) $(LLIBDIR) $(ICULIBS_LE)
729e4ab9
A
286LIBICULX = $(LLIBDIR) $(ICULIBS_LX)
287LIBCTESTFW = $(LCTESTFW) $(ICULIBS_CTESTFW)
288LIBICUTOOLUTIL = $(LLIBDIR) $(ICULIBS_TOOLUTIL)
289LIBICUIO = $(LLIBDIR) $(ICULIBS_IO)
b75a7d8f
A
290
291# Invoke, set library path for all ICU libraries.
729e4ab9 292# overridden by icucross.mk
73c04bcf 293INVOKE = $(LDLIBRARYPATH_ENVVAR)=$(LIBRARY_PATH_PREFIX)$(LIBDIR):$(top_builddir)/stubdata:$(top_builddir)/tools/ctestfw:$$$(LDLIBRARYPATH_ENVVAR) $(LEAK_CHECKER)
729e4ab9 294# prefer stubdata
51004dcb 295PKGDATA_INVOKE = $(LDLIBRARYPATH_ENVVAR)=$(top_builddir)/stubdata:$(top_builddir)/tools/ctestfw:$(LIBRARY_PATH_PREFIX)$(LIBDIR):$$$(LDLIBRARYPATH_ENVVAR) $(LEAK_CHECKER)
4388f060 296INSTALLED_INVOKE = $(LDLIBRARYPATH_ENVVAR)=$(libdir):$$$(LDLIBRARYPATH_ENVVAR)
b75a7d8f 297
51004dcb
A
298# Current full path directory for cross compilation
299ifneq ($(strip $(cross_buildroot)),)
300include $(cross_buildroot)/config/icucross.inc
301endif
302
b75a7d8f
A
303# Platform-specific setup
304include @platform_make_fragment@
305
4388f060 306# Current full path directory.
51004dcb 307CURR_FULL_DIR?=$(shell pwd | sed 's/ /\\ /g')
4388f060 308# Current full path directory for use in source code in a -D compiler option.
51004dcb 309CURR_SRCCODE_FULL_DIR?=$(shell pwd | sed 's/ /\\ /')
4388f060 310
374ca955
A
311# When shared libraries are disabled and static libraries are enabled,
312# the C++ compiler must be used to link in the libraries for the tools.
313ifneq ($(ENABLE_SHARED),YES)
314LINK.c = $(LINK.cc)
315endif
316
729e4ab9
A
317# some imported things from the cross env
318TOOLEXEEXT = $(EXEEXT)
319ifneq ($(strip $(cross_buildroot)),)
320include $(cross_buildroot)/config/icucross.mk
321else
322cross_buildroot = $(top_builddir)
323endif
324
57a6839d
A
325# for tests
326ifneq ($(TEST_STATUS_FILE),)
327TEST_OUTPUT_OPTS="-E$(TEST_STATUS_FILE)"
328endif
329
729e4ab9
A
330# optional include at top
331-include $(top_builddir)/icudefs.local