michael@0: # Make definitions that are shared by the different subprojects of ICU. michael@0: # michael@0: # Yves Arrouye. michael@0: # michael@0: # Copyright (C) 2000-2013, International Business Machines Corporation and others. michael@0: # All Rights Reserved. michael@0: michael@0: # michael@0: # Some of these variables are overridden in the config/mh-* files. michael@0: # michael@0: # Please be sure to update config/Makefile.inc.in if you add something here. michael@0: # michael@0: michael@0: # Shell to use michael@0: michael@0: SHELL = @SHELL@ michael@0: michael@0: # Standard directories michael@0: michael@0: prefix = @prefix@ michael@0: exec_prefix = @exec_prefix@ michael@0: michael@0: bindir = @bindir@ michael@0: sbindir = @sbindir@ michael@0: datarootdir = @datarootdir@ michael@0: datadir = @datadir@ michael@0: libdir = @libdir@ michael@0: includedir = @includedir@ michael@0: mandir = @mandir@ michael@0: sysconfdir = @sysconfdir@ michael@0: # controls the include of $(top_builddir)/icucross.mk at bottom of file michael@0: cross_compiling = @cross_compiling@ michael@0: cross_buildroot = @cross_buildroot@ michael@0: michael@0: # Package information michael@0: michael@0: PACKAGE_ICU_DESCRIPTION = "International Components for Unicode" michael@0: PACKAGE_ICU_URL = "http://icu-project.org" michael@0: PACKAGE = @PACKAGE@ michael@0: VERSION = @VERSION@ michael@0: UNICODE_VERSION = @UNICODE_VERSION@ michael@0: SO_TARGET_VERSION = @LIB_VERSION@ michael@0: SO_TARGET_VERSION_MAJOR = @LIB_VERSION_MAJOR@ michael@0: michael@0: # The ICU data external name is usually icudata; the entry point name is michael@0: # the version-dependent name (for no particular reason except it was easier michael@0: # to change the build this way). When building in common mode, the data michael@0: # name is the versioned platform-dependent one. michael@0: michael@0: ICUDATA_DIR = @pkgicudatadir@/$(PACKAGE)$(ICULIBSUFFIX)/$(VERSION) michael@0: michael@0: ICUDATA_BASENAME_VERSION = $(ICUPREFIX)dt@LIB_VERSION_MAJOR@ michael@0: # the entry point is almost like the basename, but has the lib suffix. michael@0: ICUDATA_ENTRY_POINT = $(ICUPREFIX)dt@ICULIBSUFFIXCNAME@@LIB_VERSION_MAJOR@ michael@0: ICUDATA_CHAR = @ICUDATA_CHAR@ michael@0: ICUDATA_PLATFORM_NAME = $(ICUDATA_BASENAME_VERSION)$(ICUDATA_CHAR) michael@0: PKGDATA_LIBSTATICNAME = -L $(STATIC_PREFIX)$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX) michael@0: ifeq ($(strip $(PKGDATA_MODE)),) michael@0: PKGDATA_MODE=@DATA_PACKAGING_MODE@ michael@0: endif michael@0: ifeq ($(PKGDATA_MODE),common) michael@0: ICUDATA_NAME = $(ICUDATA_PLATFORM_NAME) michael@0: ICUPKGDATA_DIR = $(ICUDATA_DIR) michael@0: else michael@0: ifeq ($(PKGDATA_MODE),dll) michael@0: ICUDATA_NAME = $(ICUDATA_PLATFORM_NAME) michael@0: PKGDATA_LIBNAME = -L $(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX) michael@0: ICUPKGDATA_DIR = $(libdir) michael@0: else michael@0: ifeq ($(PKGDATA_MODE),static) michael@0: ICUDATA_NAME = $(ICUDATA_PLATFORM_NAME) michael@0: PKGDATA_LIBNAME = -L $(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX) michael@0: ICUPKGDATA_DIR = $(libdir) michael@0: else michael@0: ICUDATA_NAME = $(ICUDATA_PLATFORM_NAME) michael@0: ICUPKGDATA_DIR = $(ICUDATA_DIR) michael@0: endif michael@0: endif michael@0: endif michael@0: michael@0: # These are defined here because mh-cygwin-msvc needs to override these values. michael@0: ICUPKGDATA_INSTALL_DIR = $(DESTDIR)$(ICUPKGDATA_DIR) michael@0: ICUPKGDATA_INSTALL_LIBDIR = $(DESTDIR)$(libdir) michael@0: michael@0: # If defined to a valid value, pkgdata will generate a data library more quickly michael@0: GENCCODE_ASSEMBLY = @GENCCODE_ASSEMBLY@ michael@0: michael@0: # ICU specific directories michael@0: michael@0: pkgdatadir = $(datadir)/$(PACKAGE)$(ICULIBSUFFIX)/$(VERSION) michael@0: pkglibdir = $(libdir)/$(PACKAGE)$(ICULIBSUFFIX)/$(VERSION) michael@0: pkgsysconfdir = $(sysconfdir)/$(PACKAGE)$(ICULIBSUFFIX) michael@0: michael@0: # Installation programs michael@0: michael@0: MKINSTALLDIRS = $(SHELL) $(top_srcdir)/mkinstalldirs michael@0: michael@0: INSTALL = @INSTALL@ michael@0: INSTALL_PROGRAM = @INSTALL_PROGRAM@ michael@0: INSTALL_DATA = @INSTALL_DATA@ michael@0: INSTALL_SCRIPT = @INSTALL_SCRIPT@ michael@0: michael@0: # Library suffix (to support different C++ compilers) michael@0: michael@0: ICULIBSUFFIX=@ICULIBSUFFIX@ michael@0: michael@0: # Compiler and tools michael@0: michael@0: ENABLE_DEBUG = @ENABLE_DEBUG@ michael@0: ENABLE_RELEASE = @ENABLE_RELEASE@ michael@0: EXEEXT = @EXEEXT@ michael@0: CC = @CC@ michael@0: CXX = @CXX@ michael@0: AR = @AR@ michael@0: ARFLAGS = @ARFLAGS@ r michael@0: RANLIB = @RANLIB@ michael@0: COMPILE_LINK_ENVVAR = @COMPILE_LINK_ENVVAR@ michael@0: UCLN_NO_AUTO_CLEANUP = @UCLN_NO_AUTO_CLEANUP@ michael@0: michael@0: # Various flags for the tools michael@0: michael@0: # DEFS is for common macro definitions. michael@0: # configure prevents user defined DEFS, and configure's DEFS is not needed michael@0: # So we ignore the DEFS that comes from configure michael@0: # U_ATTRIBUTE_DEPRECATED is defined to hide warnings about deprecated API warnings. michael@0: DEFS = -DU_ATTRIBUTE_DEPRECATED= michael@0: # CFLAGS is for C only flags michael@0: CFLAGS = @CFLAGS@ michael@0: # CXXFLAGS is for C++ only flags michael@0: CXXFLAGS = @CXXFLAGS@ michael@0: # CPPFLAGS is for C Pre-Processor flags michael@0: CPPFLAGS = @CPPFLAGS@ michael@0: # LIBCFLAGS are the flags for static and shared libraries. michael@0: LIBCFLAGS = @LIBCFLAGS@ michael@0: # LIBCXXFLAGS are the flags for static and shared libraries. michael@0: LIBCXXFLAGS = @LIBCXXFLAGS@ michael@0: # DEFAULT_LIBS are the default libraries to link against michael@0: DEFAULT_LIBS = @LIBS@ michael@0: # LIB_M is for linking against the math library michael@0: LIB_M = @LIB_M@ michael@0: # LIB_THREAD is for linking against the threading library michael@0: LIB_THREAD = @LIB_THREAD@ michael@0: # OUTOPT is for creating a specific output name michael@0: OUTOPT = -o # The extra space after the argument is needed. michael@0: # AR_OUTOPT is for creating a specific output name for static libraries. michael@0: AR_OUTOPT = michael@0: michael@0: ENABLE_RPATH = @ENABLE_RPATH@ michael@0: ifeq ($(ENABLE_RPATH),YES) michael@0: RPATHLDFLAGS = $(LD_RPATH)$(LD_RPATH_PRE)$(libdir) michael@0: endif michael@0: LDFLAGS = @LDFLAGS@ $(RPATHLDFLAGS) michael@0: michael@0: # What kind of libraries are we building and linking against? michael@0: ENABLE_STATIC = @ENABLE_STATIC@ michael@0: ENABLE_SHARED = @ENABLE_SHARED@ michael@0: michael@0: # Echo w/o newline michael@0: michael@0: #ECHO_N = @ICU_ECHO_N@ michael@0: #ECHO_C = @ICU_ECHO_C@ michael@0: michael@0: # Commands to compile michael@0: COMPILE.c= $(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) -c michael@0: COMPILE.cc= $(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) -c michael@0: michael@0: # Commands to link michael@0: LINK.c= $(CC) $(CFLAGS) $(LDFLAGS) michael@0: LINK.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) michael@0: michael@0: # Commands to make a shared library michael@0: SHLIB.c= $(CC) $(CFLAGS) $(LDFLAGS) -shared $(LD_SOOPTIONS) michael@0: SHLIB.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(LD_SOOPTIONS) michael@0: michael@0: # ICU_MSG michael@0: ICU_MSG=@echo " $(1) " michael@0: michael@0: # Do not show the large compiling arguments by default. michael@0: # To use: michael@0: # change michael@0: # $(CC) -o foo michael@0: # to michael@0: # $(call SILENT_COMPILE,$(CC) -o foo) michael@0: ifndef VERBOSE michael@0: SILENT_COMPILE=$(call ICU_MSG,$(notdir $(firstword $(1)))) "... " $< && $(1) || \ michael@0: ( echo "*** Failed compilation command follows: ----------------------------------------------------------" ; \ michael@0: echo "$(1)" ; \ michael@0: echo "--- ( rebuild with \"$(MAKE) VERBOSE=1 $(MAKECMDGOALS)\" to show all parameters ) --------" ; \ michael@0: false ) michael@0: else michael@0: SILENT_COMPILE=$(1) michael@0: endif michael@0: michael@0: # Environment variable to set a runtime search path michael@0: LDLIBRARYPATH_ENVVAR = LD_LIBRARY_PATH michael@0: michael@0: # Versioned target for a shared library. michael@0: FINAL_SO_TARGET = $(SO_TARGET).$(SO_TARGET_VERSION) michael@0: MIDDLE_SO_TARGET = $(SO_TARGET).$(SO_TARGET_VERSION_MAJOR) michael@0: SHARED_OBJECT = $(FINAL_SO_TARGET) michael@0: michael@0: ## How ICU libraries are named... ex. $(LIBICU)uc$(SO) michael@0: # Prefix for the ICU library names michael@0: ICUPREFIX = icu michael@0: LIBPREFIX = lib michael@0: LIBICU = $(LIBPREFIX)$(ICUPREFIX) michael@0: michael@0: ## If we can't use the shared libraries, use the static libraries michael@0: ifneq ($(ENABLE_SHARED),YES) michael@0: STATIC_PREFIX_WHEN_USED = s michael@0: else michael@0: STATIC_PREFIX_WHEN_USED = michael@0: endif michael@0: michael@0: # Static library prefix and file extension michael@0: STATIC_PREFIX = s michael@0: LIBSICU = $(LIBPREFIX)$(STATIC_PREFIX)$(ICUPREFIX) michael@0: A = a michael@0: SOBJ = $(SO) michael@0: michael@0: # Force removal [for make clean] michael@0: RMV = rm -rf michael@0: michael@0: # Platform commands to remove or move executable and library targets michael@0: # INSTALL-L installs libraries. Override in mh-* file to INSTALL_PROGRAM michael@0: # when the library needs to have executable permissions michael@0: INSTALL-S = $(INSTALL_PROGRAM) michael@0: INSTALL-L = $(INSTALL_PROGRAM) michael@0: #INSTALL-L = $(INSTALL_DATA) michael@0: michael@0: # Location of the libraries before "make install" is used michael@0: LIBDIR=$(top_builddir)/lib michael@0: michael@0: # Location of the executables before "make install" is used michael@0: BINDIR=$(top_builddir)/bin michael@0: michael@0: # overridden by icucross.mk michael@0: TOOLBINDIR=$(BINDIR) michael@0: TOOLLIBDIR=$(LIBDIR) michael@0: michael@0: # Name flexibility for the library naming scheme. Any modifications should michael@0: # be made in the mh- file for the specific platform. michael@0: DATA_STUBNAME = data michael@0: COMMON_STUBNAME = uc michael@0: I18N_STUBNAME = i18n michael@0: LAYOUT_STUBNAME = le michael@0: LAYOUTEX_STUBNAME = lx michael@0: IO_STUBNAME = io michael@0: TOOLUTIL_STUBNAME = tu michael@0: CTESTFW_STUBNAME = test michael@0: michael@0: # Just the libs. michael@0: ICULIBS_DT = -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX) michael@0: ICULIBS_UC = -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(COMMON_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX) michael@0: ICULIBS_I18N = -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(I18N_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX) michael@0: ICULIBS_LE = -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(LAYOUT_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX) michael@0: ICULIBS_LX = -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(LAYOUTEX_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX) michael@0: ICULIBS_IO = -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(IO_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX) michael@0: ICULIBS_CTESTFW = -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(CTESTFW_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX) michael@0: ICULIBS_TOOLUTIL = -l$(STATIC_PREFIX_WHEN_USED)$(ICUPREFIX)$(TOOLUTIL_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_SUFFIX) michael@0: # Link commands to link to ICU libs michael@0: LLIBDIR = -L$(LIBDIR) michael@0: LSTUBDIR = -L$(top_builddir)/stubdata michael@0: LCTESTFW = -L$(top_builddir)/tools/ctestfw michael@0: michael@0: LIBICUDT = $(LLIBDIR) $(LSTUBDIR) $(ICULIBS_DT) michael@0: LIBICUUC = $(LLIBDIR) $(ICULIBS_UC) $(LSTUBDIR) $(ICULIBS_DT) michael@0: LIBICUI18N = $(LLIBDIR) $(ICULIBS_I18N) michael@0: LIBICULE = $(LLIBDIR) $(ICULIBS_LE) michael@0: LIBICULX = $(LLIBDIR) $(ICULIBS_LX) michael@0: LIBCTESTFW = $(LCTESTFW) $(ICULIBS_CTESTFW) michael@0: LIBICUTOOLUTIL = $(LLIBDIR) $(ICULIBS_TOOLUTIL) michael@0: LIBICUIO = $(LLIBDIR) $(ICULIBS_IO) michael@0: michael@0: # Invoke, set library path for all ICU libraries. michael@0: # overridden by icucross.mk michael@0: INVOKE = $(LDLIBRARYPATH_ENVVAR)=$(LIBRARY_PATH_PREFIX)$(LIBDIR):$(top_builddir)/stubdata:$(top_builddir)/tools/ctestfw:$$$(LDLIBRARYPATH_ENVVAR) $(LEAK_CHECKER) michael@0: # prefer stubdata michael@0: PKGDATA_INVOKE = $(LDLIBRARYPATH_ENVVAR)=$(top_builddir)/stubdata:$(top_builddir)/tools/ctestfw:$(LIBRARY_PATH_PREFIX)$(LIBDIR):$$$(LDLIBRARYPATH_ENVVAR) $(LEAK_CHECKER) michael@0: INSTALLED_INVOKE = $(LDLIBRARYPATH_ENVVAR)=$(libdir):$$$(LDLIBRARYPATH_ENVVAR) michael@0: michael@0: # Current full path directory for cross compilation michael@0: ifneq ($(strip $(cross_buildroot)),) michael@0: include $(cross_buildroot)/config/icucross.inc michael@0: endif michael@0: michael@0: # Platform-specific setup michael@0: include @platform_make_fragment@ michael@0: michael@0: # Current full path directory. michael@0: CURR_FULL_DIR?=$(shell pwd | sed 's/ /\\ /g') michael@0: # Current full path directory for use in source code in a -D compiler option. michael@0: CURR_SRCCODE_FULL_DIR?=$(shell pwd | sed 's/ /\\ /') michael@0: michael@0: # When shared libraries are disabled and static libraries are enabled, michael@0: # the C++ compiler must be used to link in the libraries for the tools. michael@0: ifneq ($(ENABLE_SHARED),YES) michael@0: LINK.c = $(LINK.cc) michael@0: endif michael@0: michael@0: # some imported things from the cross env michael@0: TOOLEXEEXT = $(EXEEXT) michael@0: ifneq ($(strip $(cross_buildroot)),) michael@0: include $(cross_buildroot)/config/icucross.mk michael@0: else michael@0: cross_buildroot = $(top_builddir) michael@0: endif michael@0: michael@0: # for tests michael@0: ifneq ($(TEST_STATUS_FILE),) michael@0: TEST_OUTPUT_OPTS="-E$(TEST_STATUS_FILE)" michael@0: endif michael@0: michael@0: # optional include at top michael@0: -include $(top_builddir)/icudefs.local