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