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-2010, 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 # This is needed so that make -j2 doesn't complain when invoking pkgdata's make
     81 PKGDATA_INVOKE_OPTS = MAKEFLAGS=
     82 
     83 # These are defined here because mh-cygwin-msvc needs to override these values.
     84 ICUPKGDATA_INSTALL_DIR = $(DESTDIR)$(ICUPKGDATA_DIR)
     85 ICUPKGDATA_INSTALL_LIBDIR = $(DESTDIR)$(libdir)
     86 
     87 # If defined to a valid value, pkgdata will generate a data library more quickly
     88 GENCCODE_ASSEMBLY = @GENCCODE_ASSEMBLY@
     89 
     90 # ICU specific directories
     91 
     92 pkgdatadir = $(datadir)/$(PACKAGE)$(ICULIBSUFFIX)/$(VERSION)
     93 pkglibdir = $(libdir)/$(PACKAGE)$(ICULIBSUFFIX)/$(VERSION)
     94 pkgsysconfdir = $(sysconfdir)/$(PACKAGE)$(ICULIBSUFFIX)
     95 
     96 # Installation programs
     97 
     98 MKINSTALLDIRS = $(SHELL) $(top_srcdir)/mkinstalldirs
     99 
    100 INSTALL = @INSTALL@
    101 INSTALL_PROGRAM = @INSTALL_PROGRAM@
    102 INSTALL_DATA = @INSTALL_DATA@
    103 INSTALL_SCRIPT = @INSTALL_SCRIPT@
    104 
    105 # Library suffix (to support different C++ compilers)
    106 
    107 ICULIBSUFFIX=@ICULIBSUFFIX@
    108 
    109 # Compiler and tools
    110 
    111 ENABLE_DEBUG = @ENABLE_DEBUG@
    112 ENABLE_RELEASE = @ENABLE_RELEASE@
    113 EXEEXT = @EXEEXT@
    114 CC = @CC@
    115 CXX = @CXX@
    116 AR = @AR@
    117 ARFLAGS = @ARFLAGS@ r
    118 RANLIB = @RANLIB@
    119 COMPILE_LINK_ENVVAR = @COMPILE_LINK_ENVVAR@
    120 UCLN_NO_AUTO_CLEANUP = @UCLN_NO_AUTO_CLEANUP@
    121 
    122 # Various flags for the tools
    123 
    124 # DEFS is for common macro definitions.
    125 # configure prevents user defined DEFS, and configure's DEFS is not needed
    126 # So we ignore the DEFS that comes from configure
    127 DEFS =
    128 # CFLAGS is for C only flags
    129 CFLAGS = @CFLAGS@
    130 # CXXFLAGS is for C++ only flags
    131 CXXFLAGS = @CXXFLAGS@
    132 # CPPFLAGS is for C Pre-Processor flags
    133 CPPFLAGS = @CPPFLAGS@
    134 # LIBCFLAGS are the flags for static and shared libraries.
    135 LIBCFLAGS = @LIBCFLAGS@
    136 # LIBCXXFLAGS are the flags for static and shared libraries.
    137 LIBCXXFLAGS = @LIBCXXFLAGS@
    138 # DEFAULT_LIBS are the default libraries to link against
    139 DEFAULT_LIBS = @LIBS@
    140 # LIB_M is for linking against the math library
    141 LIB_M = @LIB_M@
    142 # LIB_THREAD is for linking against the threading library
    143 LIB_THREAD = @LIB_THREAD@
    144 # OUTOPT is for creating a specific output name
    145 OUTOPT = -o # The extra space after the argument is needed.
    146 # AR_OUTOPT is for creating a specific output name for static libraries.
    147 AR_OUTOPT =
    148 
    149 ENABLE_RPATH = @ENABLE_RPATH@
    150 ifeq ($(ENABLE_RPATH),YES)
    151 RPATHLDFLAGS = $(LD_RPATH)$(LD_RPATH_PRE)$(libdir)
    152 endif
    153 LDFLAGS = @LDFLAGS@ $(RPATHLDFLAGS)
    154 
    155 # What kind of libraries are we building and linking against?
    156 ENABLE_STATIC = @ENABLE_STATIC@
    157 ENABLE_SHARED = @ENABLE_SHARED@
    158 
    159 # Echo w/o newline
    160 
    161 #ECHO_N = @ICU_ECHO_N@
    162 #ECHO_C = @ICU_ECHO_C@
    163 
    164 # Commands to compile
    165 COMPILE.c=    $(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) -c
    166 COMPILE.cc=   $(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) -c
    167 
    168 # Commands to link
    169 LINK.c=       $(CC) $(CFLAGS) $(LDFLAGS)
    170 LINK.cc=      $(CXX) $(CXXFLAGS) $(LDFLAGS)
    171 
    172 # Commands to make a shared library
    173 SHLIB.c=      $(CC) $(CFLAGS) $(LDFLAGS) -shared $(LD_SOOPTIONS)
    174 SHLIB.cc=     $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(LD_SOOPTIONS)
    175 
    176 # Environment variable to set a runtime search path
    177 LDLIBRARYPATH_ENVVAR = LD_LIBRARY_PATH
    178 
    179 # Versioned target for a shared library.
    180 FINAL_SO_TARGET = $(SO_TARGET).$(SO_TARGET_VERSION)
    181 MIDDLE_SO_TARGET = $(SO_TARGET).$(SO_TARGET_VERSION_MAJOR)
    182 SHARED_OBJECT = $(FINAL_SO_TARGET)
    183 
    184 ##  How ICU libraries are named...  ex. $(LIBICU)uc$(SO)
    185 # Prefix for the ICU library names
    186 ICUPREFIX = icu
    187 LIBPREFIX = lib
    188 LIBICU = $(LIBPREFIX)$(ICUPREFIX)
    189 
    190 ## If we can't use the shared libraries, use the static libraries
    191 ifneq ($(ENABLE_SHARED),YES)
    192 STATIC_PREFIX_WHEN_USED = s
    193 else
    194 STATIC_PREFIX_WHEN_USED = 
    195 endif
    196 
    197 # Static library prefix and file extension
    198 STATIC_PREFIX = s
    199 LIBSICU = $(LIBPREFIX)$(STATIC_PREFIX)$(ICUPREFIX)
    200 A = a
    201 SOBJ = $(SO)
    202 
    203 # Force removal [for make clean]
    204 RMV = rm -rf
    205 
    206 # Platform commands to remove or move executable and library targets
    207 # INSTALL-L installs libraries. Override in mh-* file to INSTALL_PROGRAM
    208 #           when the library needs to have executable permissions
    209 INSTALL-S = $(INSTALL_PROGRAM)
    210 INSTALL-L = $(INSTALL_PROGRAM)
    211 #INSTALL-L = $(INSTALL_DATA)
    212 
    213 # Location of the libraries before "make install" is used
    214 LIBDIR=$(top_builddir)/lib
    215 
    216 # Location of the executables before "make install" is used
    217 BINDIR=$(top_builddir)/bin
    218 
    219 # overridden by icucross.mk
    220 TOOLBINDIR=$(BINDIR)
    221 TOOLLIBDIR=$(LIBDIR)
    222 
    223 # Current full path directory.
    224 CURR_FULL_DIR=$(shell pwd | sed 's/ /\\ /g')
    225 # Current full path directory for use in source code in a -D compiler option.
    226 CURR_SRCCODE_FULL_DIR=$(shell pwd | sed 's/ /\\ /')
    227 
    228 # Name flexibility for the library naming scheme.  Any modifications should
    229 # be made in the mh- file for the specific platform.
    230 DATA_STUBNAME = data
    231 COMMON_STUBNAME = uc
    232 I18N_STUBNAME = i18n
    233 LAYOUT_STUBNAME = le
    234 LAYOUTEX_STUBNAME = lx
    235 IO_STUBNAME = io
    236 TOOLUTIL_STUBNAME = tu
    237 CTESTFW_STUBNAME = test
    238 
    239 # Just the libs.
    240 ICULIBS_DT	= -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
    241 ICULIBS_UC	= -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(COMMON_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
    242 ICULIBS_I18N	= -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(I18N_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
    243 ICULIBS_LE	= -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(LAYOUT_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
    244 ICULIBS_LX	= -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(LAYOUTEX_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
    245 ICULIBS_IO	= -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(IO_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
    246 ICULIBS_CTESTFW	= -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(CTESTFW_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
    247 ICULIBS_TOOLUTIL = -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(TOOLUTIL_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX)
    248 # Link commands to link to ICU libs
    249 LLIBDIR		= -L$(LIBDIR)
    250 LSTUBDIR	= -L$(top_builddir)/stubdata
    251 LCTESTFW	= -L$(top_builddir)/tools/ctestfw
    252 
    253 LIBICUDT	= $(LLIBDIR) $(LSTUBDIR) $(ICULIBS_DT)
    254 LIBICUUC	= $(LLIBDIR) $(ICULIBS_UC) $(LSTUBDIR) $(ICULIBS_DT)
    255 LIBICUI18N	= $(LLIBDIR) $(ICULIBS_I18N)
    256 LIBICULE	= $(LLIBDIR) $(ICULIBS_LE)
    257 LIBICULX	= $(LLIBDIR) $(ICULIBS_LX)
    258 LIBCTESTFW	= $(LCTESTFW) $(ICULIBS_CTESTFW)
    259 LIBICUTOOLUTIL	= $(LLIBDIR) $(ICULIBS_TOOLUTIL)
    260 LIBICUIO	= $(LLIBDIR) $(ICULIBS_IO)
    261 
    262 # Invoke, set library path for all ICU libraries.
    263 # overridden by icucross.mk
    264 INVOKE = $(LDLIBRARYPATH_ENVVAR)=$(LIBRARY_PATH_PREFIX)$(LIBDIR):$(top_builddir)/stubdata:$(top_builddir)/tools/ctestfw:$$$(LDLIBRARYPATH_ENVVAR) $(LEAK_CHECKER)
    265 # prefer stubdata
    266 PKGDATA_INVOKE = $(LDLIBRARYPATH_ENVVAR)=$(top_builddir)/stubdata:$(top_builddir)/tools/ctestfw:$(LIBRARY_PATH_PREFIX)$(LIBDIR):$$$(LDLIBRARYPATH_ENVVAR) $(LEAK_CHECKER) $(PKGDATA_INVOKE_OPTS)
    267 
    268 # Platform-specific setup
    269 include @platform_make_fragment@
    270 
    271 # When shared libraries are disabled and static libraries are enabled,
    272 # the C++ compiler must be used to link in the libraries for the tools.
    273 ifneq ($(ENABLE_SHARED),YES)
    274 LINK.c = $(LINK.cc)
    275 endif
    276 
    277 # some imported things from the cross env
    278 TOOLEXEEXT = $(EXEEXT)
    279 ifneq ($(strip $(cross_buildroot)),)
    280 include $(cross_buildroot)/config/icucross.mk
    281 else
    282 cross_buildroot = $(top_builddir)
    283 endif
    284 
    285 # optional include at top
    286 -include $(top_builddir)/icudefs.local
    287