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