summaryrefslogtreecommitdiffstats
path: root/intl/icu/source/icudefs.mk.in
blob: 2c358167a837cb671d5a2d87aae30595a81b17d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
# Make definitions that are shared by the different subprojects of ICU.
#
# Yves Arrouye.
#
# Copyright (C) 2016 and later: Unicode, Inc. and others.
# License & terms of use: http://www.unicode.org/copyright.html
# Copyright (C) 2000-2016, International Business Machines Corporation and others.
# All Rights Reserved.

#
# Some of these variables are overridden in the config/mh-* files.
#
# Please be sure to update config/Makefile.inc.in  if you add something here.
#

# Shell to use

SHELL = @SHELL@

# Instruct Python to never write any byte code to the ICU source tree.
export PYTHONDONTWRITEBYTECODE = 1

# Standard directories

prefix = @prefix@
exec_prefix = @exec_prefix@

bindir = @bindir@
sbindir = @sbindir@
datarootdir = @datarootdir@
datadir = @datadir@
libdir = @libdir@
includedir = @includedir@
mandir = @mandir@
sysconfdir = @sysconfdir@
# controls the include of $(top_builddir)/icucross.mk at bottom of file
cross_compiling = @cross_compiling@
cross_buildroot = @cross_buildroot@

# Package information

PACKAGE_ICU_DESCRIPTION = "International Components for Unicode"
PACKAGE_ICU_URL = "http://icu-project.org"
PACKAGE = @PACKAGE@
VERSION = @VERSION@
UNICODE_VERSION = @UNICODE_VERSION@
SO_TARGET_VERSION = @LIB_VERSION@
SO_TARGET_VERSION_MAJOR = @LIB_VERSION_MAJOR@

# The ICU data external name is usually icudata; the entry point name is
# the version-dependent name (for no particular reason except it was easier
# to change the build this way). When building in common mode, the data
# name is the versioned platform-dependent one. 

ICUDATA_DIR = @pkgicudatadir@/$(PACKAGE)$(ICULIBSUFFIX)/$(VERSION)

ICUDATA_BASENAME_VERSION = $(ICUPREFIX)dt@LIB_VERSION_MAJOR@
# the entry point is almost like the basename, but has the lib suffix.  
ICUDATA_ENTRY_POINT = $(ICUPREFIX)dt@ICULIBSUFFIXCNAME@@LIB_VERSION_MAJOR@ 
ICUDATA_CHAR = @ICUDATA_CHAR@
ICUDATA_PLATFORM_NAME = $(ICUDATA_BASENAME_VERSION)$(ICUDATA_CHAR)
PKGDATA_LIBSTATICNAME = -L $(STATIC_PREFIX)$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)
ifeq ($(strip $(PKGDATA_MODE)),)
PKGDATA_MODE=@DATA_PACKAGING_MODE@
endif
ifeq ($(PKGDATA_MODE),common)
ICUDATA_NAME = $(ICUDATA_PLATFORM_NAME)
ICUPKGDATA_DIR = $(ICUDATA_DIR)
else
ifeq ($(PKGDATA_MODE),dll)
ICUDATA_NAME = $(ICUDATA_PLATFORM_NAME)
PKGDATA_LIBNAME = -L $(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)
ICUPKGDATA_DIR = $(libdir)
else
ifeq ($(PKGDATA_MODE),static)
ICUDATA_NAME = $(ICUDATA_PLATFORM_NAME)
PKGDATA_LIBNAME = -L $(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)
ICUPKGDATA_DIR = $(libdir)
else
ICUDATA_NAME = $(ICUDATA_PLATFORM_NAME)
ICUPKGDATA_DIR = $(ICUDATA_DIR)
endif
endif
endif

# These are defined here because mh-cygwin-msvc needs to override these values.
ICUPKGDATA_INSTALL_DIR = $(DESTDIR)$(ICUPKGDATA_DIR)
ICUPKGDATA_INSTALL_LIBDIR = $(DESTDIR)$(libdir)

# If defined to a valid value, pkgdata will generate a data library more quickly
GENCCODE_ASSEMBLY = @GENCCODE_ASSEMBLY@

# ICU specific directories

pkgdatadir = $(datadir)/$(PACKAGE)$(ICULIBSUFFIX)/$(VERSION)
pkglibdir = $(libdir)/$(PACKAGE)$(ICULIBSUFFIX)/$(VERSION)
pkgsysconfdir = $(sysconfdir)/$(PACKAGE)$(ICULIBSUFFIX)

# Installation programs

MKINSTALLDIRS = $(SHELL) $(top_srcdir)/mkinstalldirs

INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@

# Library suffix (to support different C++ compilers)

ICULIBSUFFIX=@ICULIBSUFFIX@

# Compiler and tools

ENABLE_DEBUG = @ENABLE_DEBUG@
ENABLE_RELEASE = @ENABLE_RELEASE@
EXEEXT = @EXEEXT@
CC = @CC@
CXX = @CXX@
AR = @AR@
ARFLAGS = @ARFLAGS@ r
RANLIB = @RANLIB@
COMPILE_LINK_ENVVAR = @COMPILE_LINK_ENVVAR@
UCLN_NO_AUTO_CLEANUP = @UCLN_NO_AUTO_CLEANUP@
SED = @SED@

# Various flags for the tools

# DEFS is for common macro definitions.
# configure prevents user defined DEFS, and configure's DEFS is not needed
# So we ignore the DEFS that comes from configure
# U_ATTRIBUTE_DEPRECATED is defined to hide warnings about deprecated API warnings.
DEFS = -DU_ATTRIBUTE_DEPRECATED=
# CFLAGS is for C only flags
CFLAGS = @CFLAGS@
# CXXFLAGS is for C++ only flags
CXXFLAGS = @CXXFLAGS@
# CPPFLAGS is for C Pre-Processor flags
CPPFLAGS = @CPPFLAGS@
# LIBCFLAGS are the flags for static and shared libraries.
LIBCFLAGS = @LIBCFLAGS@
# LIBCXXFLAGS are the flags for static and shared libraries.
LIBCXXFLAGS = @LIBCXXFLAGS@
# DEFAULT_LIBS are the default libraries to link against
DEFAULT_LIBS = @LIBS@
# LIB_M is for linking against the math library
LIB_M = @LIB_M@
# LIB_THREAD is for linking against the threading library
LIB_THREAD = @LIB_THREAD@
# OUTOPT is for creating a specific output name
OUTOPT = -o # The extra space after the argument is needed.
# AR_OUTOPT is for creating a specific output name for static libraries.
AR_OUTOPT =

ENABLE_RPATH = @ENABLE_RPATH@
ifeq ($(ENABLE_RPATH),YES)
RPATHLDFLAGS = $(LD_RPATH)$(LD_RPATH_PRE)$(libdir)
endif
LDFLAGS = @LDFLAGS@ $(RPATHLDFLAGS)

# What kind of libraries are we building and linking against?
ENABLE_STATIC = @ENABLE_STATIC@
ENABLE_SHARED = @ENABLE_SHARED@

# Echo w/o newline

#ECHO_N = @ICU_ECHO_N@
#ECHO_C = @ICU_ECHO_C@

# Commands to compile
COMPILE.c=    $(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) -c
COMPILE.cc=   $(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) -c

# Commands to link
LINK.c=       $(CC) $(CFLAGS) $(LDFLAGS) $(LINKFLAGS)
LINK.cc=      $(CXX) $(CXXFLAGS) $(LDFLAGS) $(LINKFLAGS)

# Commands to make a shared library
SHLIB.c=      $(CC) $(CFLAGS) $(LDFLAGS) -shared $(LD_SOOPTIONS)
SHLIB.cc=     $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(LD_SOOPTIONS)

# ICU_MSG
ICU_MSG=@echo "   $(1)	"

# Do not show the large compiling arguments by default.
# To use:
# change
#    $(CC) -o foo
# to
#    $(call SILENT_COMPILE,$(CC) -o foo)
ifndef VERBOSE
    SILENT_COMPILE=$(call ICU_MSG,$(notdir $(firstword $(1)))) "... " $< && $(1) || \
			( echo "*** Failed compilation command follows: ----------------------------------------------------------" ; \
			  echo "$(1)" ; \
		          echo "--- ( rebuild with \"$(MAKE) VERBOSE=1 $(MAKECMDGOALS)\" to show all parameters ) --------" ; \
			false )
else
    SILENT_COMPILE=$(1)
endif

# Environment variable to set a runtime search path
LDLIBRARYPATH_ENVVAR = LD_LIBRARY_PATH

# Versioned target for a shared library.
FINAL_SO_TARGET = $(SO_TARGET).$(SO_TARGET_VERSION)
MIDDLE_SO_TARGET = $(SO_TARGET).$(SO_TARGET_VERSION_MAJOR)
SHARED_OBJECT = $(FINAL_SO_TARGET)

##  How ICU libraries are named...  ex. $(LIBICU)uc$(SO)
# Prefix for the ICU library names
ICUPREFIX = icu
LIBPREFIX = lib
LIBICU = $(LIBPREFIX)$(ICUPREFIX)

## If we can't use the shared libraries, use the static libraries
ifneq ($(ENABLE_SHARED),YES)
STATIC_PREFIX_WHEN_USED = s
else
STATIC_PREFIX_WHEN_USED = 
endif

# Static library prefix and file extension
STATIC_PREFIX = s
LIBSICU = $(LIBPREFIX)$(STATIC_PREFIX)$(ICUPREFIX)
A = a
SOBJ = $(SO)

# Force removal [for make clean]
RMV = rm -rf

# Platform commands to remove or move executable and library targets
# INSTALL-L installs libraries. Override in mh-* file to INSTALL_PROGRAM
#           when the library needs to have executable permissions
INSTALL-S = $(INSTALL_PROGRAM)
INSTALL-L = $(INSTALL_PROGRAM)
#INSTALL-L = $(INSTALL_DATA)

# Location of the libraries before "make install" is used
LIBDIR=$(top_builddir)/lib

# Location of the executables before "make install" is used
BINDIR=$(top_builddir)/bin

# Defined here so that it can be overridden by mh-mingw*.
# For MinGW/MSYS2 we want the DLLs to go into the bin location.
MINGW_MOVEDLLSTOBINDIR = NO

# overridden by icucross.mk
TOOLBINDIR=$(BINDIR)
TOOLLIBDIR=$(LIBDIR)

# Name flexibility for the library naming scheme.  Any modifications should
# be made in the mh- file for the specific platform.
DATA_STUBNAME = data
COMMON_STUBNAME = uc
I18N_STUBNAME = i18n
LAYOUTEX_STUBNAME = lx
IO_STUBNAME = io
TOOLUTIL_STUBNAME = tu
CTESTFW_STUBNAME = test

# get these from pkg-config, if available
ICULEHB_CFLAGS=@ICULEHB_CFLAGS@
ICULEHB_LIBS=@ICULEHB_LIBS@
ifneq ($(ICULEHB_CFLAGS),)
USING_ICULEHB=yes
ICULEHB_TRUE=
ICULEHB_FALSE=#
ICULIBS_LE=$(ICULEHB_LIBS)
ICULE_CFLAGS=$(ICULEHB_CFLAGS) -DUSING_ICULEHB
else
USING_ICULEHB=no
ICULEHB_TRUE=#
ICULEHB_FALSE=
endif

# Just the libs.
ICULIBS_DT	= -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
ICULIBS_UC	= -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(COMMON_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
ICULIBS_I18N	= -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(I18N_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
ICULIBS_LX	= -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(LAYOUTEX_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
ICULIBS_IO	= -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(IO_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
ICULIBS_CTESTFW	= -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(CTESTFW_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
ICULIBS_TOOLUTIL = -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(TOOLUTIL_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
# Link commands to link to ICU libs
LLIBDIR		= -L$(LIBDIR)
LSTUBDIR	= -L$(top_builddir)/stubdata
LCTESTFW	= -L$(top_builddir)/tools/ctestfw

LIBICUDT	= $(LLIBDIR) $(LSTUBDIR) $(ICULIBS_DT)
LIBICUUC	= $(LLIBDIR) $(ICULIBS_UC) $(LSTUBDIR) $(ICULIBS_DT)
LIBICUI18N	= $(LLIBDIR) $(ICULIBS_I18N)
LIBICULE	= $(ICULEHB_CFLAGS) $(LLIBDIR) $(ICULIBS_LE)
LIBICULX	= $(LLIBDIR) $(ICULIBS_LX)
LIBCTESTFW	= $(LCTESTFW) $(ICULIBS_CTESTFW)
LIBICUTOOLUTIL	= $(LLIBDIR) $(ICULIBS_TOOLUTIL)
LIBICUIO	= $(LLIBDIR) $(ICULIBS_IO)

# Invoke, set library path for all ICU libraries.
# overridden by icucross.mk
INVOKE = $(LDLIBRARYPATH_ENVVAR)=$(LIBRARY_PATH_PREFIX)$(LIBDIR):$(top_builddir)/stubdata:$(top_builddir)/tools/ctestfw:$$$(LDLIBRARYPATH_ENVVAR) $(LEAK_CHECKER)
# prefer stubdata
PKGDATA_INVOKE = $(LDLIBRARYPATH_ENVVAR)=$(top_builddir)/stubdata:$(top_builddir)/tools/ctestfw:$(LIBRARY_PATH_PREFIX)$(LIBDIR):$$$(LDLIBRARYPATH_ENVVAR) $(LEAK_CHECKER)
INSTALLED_INVOKE = $(LDLIBRARYPATH_ENVVAR)=$(libdir):$$$(LDLIBRARYPATH_ENVVAR)

# Current full path directory for cross compilation
ifneq ($(strip $(cross_buildroot)),)
include $(cross_buildroot)/config/icucross.inc
endif

# Platform-specific setup
include @platform_make_fragment@

# Current full path directory.
CURR_FULL_DIR?=$(shell pwd | sed 's/ /\\ /g')
# Current full path directory for use in source code in a -D compiler option.
CURR_SRCCODE_FULL_DIR?=$(shell pwd | sed 's/ /\\ /')

# When shared libraries are disabled and static libraries are enabled,
# the C++ compiler must be used to link in the libraries for the tools.
ifneq ($(ENABLE_SHARED),YES)
LINK.c = $(LINK.cc)
endif

# some imported things from the cross env
TOOLEXEEXT = $(EXEEXT)
ifneq ($(strip $(cross_buildroot)),)
include $(cross_buildroot)/config/icucross.mk
else
cross_buildroot = $(top_builddir)
endif

# for tests
ifneq ($(TEST_STATUS_FILE),)
TEST_OUTPUT_OPTS="-E$(TEST_STATUS_FILE)"
endif

# optional include at top
-include $(top_builddir)/icudefs.local