]> git.saurik.com Git - apple/icu.git/blame - icuSources/icudefs.mk.in
ICU-62141.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#
f3c0d7a5
A
5# Copyright (C) 2016 and later: Unicode, Inc. and others.
6# License & terms of use: http://www.unicode.org/copyright.html
2ca993e8 7# Copyright (C) 2000-2016, International Business Machines Corporation and others.
b75a7d8f
A
8# All Rights Reserved.
9
10#
11# Some of these variables are overridden in the config/mh-* files.
b331163b 12#
46f4442e 13# Please be sure to update config/Makefile.inc.in if you add something here.
b75a7d8f
A
14#
15
16# Shell to use
17
18SHELL = @SHELL@
19
20# Standard directories
21
22prefix = @prefix@
23exec_prefix = @exec_prefix@
24
25bindir = @bindir@
26sbindir = @sbindir@
46f4442e 27datarootdir = @datarootdir@
b75a7d8f
A
28datadir = @datadir@
29libdir = @libdir@
30includedir = @includedir@
31mandir = @mandir@
32sysconfdir = @sysconfdir@
729e4ab9
A
33# controls the include of $(top_builddir)/icucross.mk at bottom of file
34cross_compiling = @cross_compiling@
35cross_buildroot = @cross_buildroot@
b75a7d8f
A
36
37# Package information
38
729e4ab9
A
39PACKAGE_ICU_DESCRIPTION = "International Components for Unicode"
40PACKAGE_ICU_URL = "http://icu-project.org"
b75a7d8f
A
41PACKAGE = @PACKAGE@
42VERSION = @VERSION@
43UNICODE_VERSION = @UNICODE_VERSION@
44SO_TARGET_VERSION = @LIB_VERSION@
45SO_TARGET_VERSION_MAJOR = @LIB_VERSION_MAJOR@
46
47# The ICU data external name is usually icudata; the entry point name is
374ca955 48# the version-dependent name (for no particular reason except it was easier
b75a7d8f
A
49# to change the build this way). When building in common mode, the data
50# name is the versioned platform-dependent one.
51
52ICUDATA_DIR = @pkgicudatadir@/$(PACKAGE)$(ICULIBSUFFIX)/$(VERSION)
53
54ICUDATA_BASENAME_VERSION = $(ICUPREFIX)dt@LIB_VERSION_MAJOR@
729e4ab9
A
55# the entry point is almost like the basename, but has the lib suffix.
56ICUDATA_ENTRY_POINT = $(ICUPREFIX)dt@ICULIBSUFFIXCNAME@@LIB_VERSION_MAJOR@
73c04bcf
A
57ICUDATA_CHAR = @ICUDATA_CHAR@
58ICUDATA_PLATFORM_NAME = $(ICUDATA_BASENAME_VERSION)$(ICUDATA_CHAR)
374ca955 59PKGDATA_LIBSTATICNAME = -L $(STATIC_PREFIX)$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)
b75a7d8f
A
60ifeq ($(strip $(PKGDATA_MODE)),)
61PKGDATA_MODE=@DATA_PACKAGING_MODE@
62endif
63ifeq ($(PKGDATA_MODE),common)
64ICUDATA_NAME = $(ICUDATA_PLATFORM_NAME)
65ICUPKGDATA_DIR = $(ICUDATA_DIR)
66else
67ifeq ($(PKGDATA_MODE),dll)
374ca955
A
68ICUDATA_NAME = $(ICUDATA_PLATFORM_NAME)
69PKGDATA_LIBNAME = -L $(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)
b75a7d8f
A
70ICUPKGDATA_DIR = $(libdir)
71else
729e4ab9
A
72ifeq ($(PKGDATA_MODE),static)
73ICUDATA_NAME = $(ICUDATA_PLATFORM_NAME)
74PKGDATA_LIBNAME = -L $(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)
75ICUPKGDATA_DIR = $(libdir)
76else
374ca955 77ICUDATA_NAME = $(ICUDATA_PLATFORM_NAME)
b75a7d8f
A
78ICUPKGDATA_DIR = $(ICUDATA_DIR)
79endif
80endif
729e4ab9 81endif
b75a7d8f 82
374ca955
A
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
b75a7d8f
A
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
374ca955
A
111ENABLE_DEBUG = @ENABLE_DEBUG@
112ENABLE_RELEASE = @ENABLE_RELEASE@
b75a7d8f
A
113EXEEXT = @EXEEXT@
114CC = @CC@
115CXX = @CXX@
b75a7d8f 116AR = @AR@
46f4442e 117ARFLAGS = @ARFLAGS@ r
b75a7d8f
A
118RANLIB = @RANLIB@
119COMPILE_LINK_ENVVAR = @COMPILE_LINK_ENVVAR@
729e4ab9 120UCLN_NO_AUTO_CLEANUP = @UCLN_NO_AUTO_CLEANUP@
f3c0d7a5 121SED = @SED@
b75a7d8f
A
122
123# Various flags for the tools
124
374ca955
A
125# DEFS is for common macro definitions.
126# configure prevents user defined DEFS, and configure's DEFS is not needed
127# So we ignore the DEFS that comes from configure
4388f060
A
128# U_ATTRIBUTE_DEPRECATED is defined to hide warnings about deprecated API warnings.
129DEFS = -DU_ATTRIBUTE_DEPRECATED=
b75a7d8f
A
130# CFLAGS is for C only flags
131CFLAGS = @CFLAGS@
132# CXXFLAGS is for C++ only flags
133CXXFLAGS = @CXXFLAGS@
134# CPPFLAGS is for C Pre-Processor flags
135CPPFLAGS = @CPPFLAGS@
46f4442e
A
136# LIBCFLAGS are the flags for static and shared libraries.
137LIBCFLAGS = @LIBCFLAGS@
138# LIBCXXFLAGS are the flags for static and shared libraries.
139LIBCXXFLAGS = @LIBCXXFLAGS@
b75a7d8f
A
140# DEFAULT_LIBS are the default libraries to link against
141DEFAULT_LIBS = @LIBS@
142# LIB_M is for linking against the math library
143LIB_M = @LIB_M@
46f4442e
A
144# LIB_THREAD is for linking against the threading library
145LIB_THREAD = @LIB_THREAD@
b75a7d8f 146# OUTOPT is for creating a specific output name
46f4442e
A
147OUTOPT = -o # The extra space after the argument is needed.
148# AR_OUTOPT is for creating a specific output name for static libraries.
149AR_OUTOPT =
b75a7d8f
A
150
151ENABLE_RPATH = @ENABLE_RPATH@
152ifeq ($(ENABLE_RPATH),YES)
153RPATHLDFLAGS = $(LD_RPATH)$(LD_RPATH_PRE)$(libdir)
154endif
155LDFLAGS = @LDFLAGS@ $(RPATHLDFLAGS)
156
157# What kind of libraries are we building and linking against?
158ENABLE_STATIC = @ENABLE_STATIC@
159ENABLE_SHARED = @ENABLE_SHARED@
160
161# Echo w/o newline
162
729e4ab9
A
163#ECHO_N = @ICU_ECHO_N@
164#ECHO_C = @ICU_ECHO_C@
b75a7d8f
A
165
166# Commands to compile
167COMPILE.c= $(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) -c
168COMPILE.cc= $(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) -c
169
170# Commands to link
2ca993e8
A
171LINK.c= $(CC) $(CFLAGS) $(LDFLAGS) $(LINKFLAGS)
172LINK.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) $(LINKFLAGS)
b75a7d8f
A
173
174# Commands to make a shared library
729e4ab9
A
175SHLIB.c= $(CC) $(CFLAGS) $(LDFLAGS) -shared $(LD_SOOPTIONS)
176SHLIB.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(LD_SOOPTIONS)
b75a7d8f 177
51004dcb
A
178# ICU_MSG
179ICU_MSG=@echo " $(1) "
180
181# Do not show the large compiling arguments by default.
182# To use:
183# change
184# $(CC) -o foo
185# to
186# $(call SILENT_COMPILE,$(CC) -o foo)
187ifndef VERBOSE
188 SILENT_COMPILE=$(call ICU_MSG,$(notdir $(firstword $(1)))) "... " $< && $(1) || \
189 ( echo "*** Failed compilation command follows: ----------------------------------------------------------" ; \
190 echo "$(1)" ; \
191 echo "--- ( rebuild with \"$(MAKE) VERBOSE=1 $(MAKECMDGOALS)\" to show all parameters ) --------" ; \
192 false )
193else
194 SILENT_COMPILE=$(1)
195endif
196
b75a7d8f
A
197# Environment variable to set a runtime search path
198LDLIBRARYPATH_ENVVAR = LD_LIBRARY_PATH
199
200# Versioned target for a shared library.
201FINAL_SO_TARGET = $(SO_TARGET).$(SO_TARGET_VERSION)
202MIDDLE_SO_TARGET = $(SO_TARGET).$(SO_TARGET_VERSION_MAJOR)
73c04bcf 203SHARED_OBJECT = $(FINAL_SO_TARGET)
b75a7d8f
A
204
205## How ICU libraries are named... ex. $(LIBICU)uc$(SO)
206# Prefix for the ICU library names
207ICUPREFIX = icu
374ca955
A
208LIBPREFIX = lib
209LIBICU = $(LIBPREFIX)$(ICUPREFIX)
210
211## If we can't use the shared libraries, use the static libraries
212ifneq ($(ENABLE_SHARED),YES)
213STATIC_PREFIX_WHEN_USED = s
214else
215STATIC_PREFIX_WHEN_USED =
216endif
217
218# Static library prefix and file extension
219STATIC_PREFIX = s
220LIBSICU = $(LIBPREFIX)$(STATIC_PREFIX)$(ICUPREFIX)
221A = a
73c04bcf 222SOBJ = $(SO)
b75a7d8f
A
223
224# Force removal [for make clean]
225RMV = rm -rf
374ca955 226
b75a7d8f 227# Platform commands to remove or move executable and library targets
374ca955
A
228# INSTALL-L installs libraries. Override in mh-* file to INSTALL_PROGRAM
229# when the library needs to have executable permissions
b75a7d8f 230INSTALL-S = $(INSTALL_PROGRAM)
46f4442e
A
231INSTALL-L = $(INSTALL_PROGRAM)
232#INSTALL-L = $(INSTALL_DATA)
b75a7d8f 233
374ca955
A
234# Location of the libraries before "make install" is used
235LIBDIR=$(top_builddir)/lib
236
237# Location of the executables before "make install" is used
238BINDIR=$(top_builddir)/bin
239
729e4ab9
A
240# overridden by icucross.mk
241TOOLBINDIR=$(BINDIR)
242TOOLLIBDIR=$(LIBDIR)
243
374ca955
A
244# Name flexibility for the library naming scheme. Any modifications should
245# be made in the mh- file for the specific platform.
246DATA_STUBNAME = data
247COMMON_STUBNAME = uc
248I18N_STUBNAME = i18n
374ca955
A
249LAYOUTEX_STUBNAME = lx
250IO_STUBNAME = io
251TOOLUTIL_STUBNAME = tu
252CTESTFW_STUBNAME = test
253
b331163b
A
254# get these from pkg-config, if available
255ICULEHB_CFLAGS=@ICULEHB_CFLAGS@
256ICULEHB_LIBS=@ICULEHB_LIBS@
257ifneq ($(ICULEHB_CFLAGS),)
258USING_ICULEHB=yes
259ICULEHB_TRUE=
260ICULEHB_FALSE=#
261ICULIBS_LE=$(ICULEHB_LIBS)
262ICULE_CFLAGS=$(ICULEHB_CFLAGS) -DUSING_ICULEHB
263else
264USING_ICULEHB=no
265ICULEHB_TRUE=#
266ICULEHB_FALSE=
b331163b
A
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