michael@0: ## -*-makefile-*- michael@0: #****************************************************************************** michael@0: # Copyright (C) 1999-2012, International Business Machines michael@0: # Corporation and others. All Rights Reserved. michael@0: #****************************************************************************** michael@0: # This Makefile.inc is designed to be included into projects which make use michael@0: # of the ICU. michael@0: michael@0: # CONTENTS OF THIS FILE michael@0: # 1). Base configuration information and linkage michael@0: # 2). Variables giving access to ICU tools michael@0: # 3). Host information michael@0: # 4). Compiler flags and settings michael@0: # 5). Data Packaging directives michael@0: # 6). Include of platform make fragment (mh-* file) michael@0: michael@0: ################################################################## michael@0: ################################################################## michael@0: # michael@0: # *1* base configuration information and linkage michael@0: # michael@0: ################################################################## michael@0: # The PREFIX is the base of where ICU is installed. michael@0: # Inside this directory you should find bin, lib, include/unicode, michael@0: # etc. If ICU is not installed in this directory, you must change the michael@0: # following line. There should exist $(prefix)/include/unicode/utypes.h michael@0: # for example. michael@0: prefix = @prefix@ michael@0: exec_prefix = @exec_prefix@ michael@0: libdir = @libdir@ michael@0: libexecdir = @libexecdir@ michael@0: bindir = @bindir@ michael@0: datarootdir = @datarootdir@ michael@0: datadir = @datadir@ michael@0: sbindir = @sbindir@ michael@0: michael@0: # about the ICU version michael@0: VERSION = @VERSION@ michael@0: UNICODE_VERSION = @UNICODE_VERSION@ michael@0: michael@0: # The prefix for ICU libraries, normally 'icu' michael@0: ICUPREFIX = icu michael@0: PACKAGE = @PACKAGE@ michael@0: LIBICU = lib$(ICUPREFIX) michael@0: michael@0: # Static library prefix and file extension michael@0: STATIC_PREFIX = s michael@0: LIBSICU = lib$(STATIC_PREFIX)$(ICUPREFIX) michael@0: A = a michael@0: michael@0: # Suffix at the end of libraries. Usually empty. michael@0: ICULIBSUFFIX = @ICULIBSUFFIX@ michael@0: # ICULIBSUFFIX_VERSION is non-empty if it is to contain a library michael@0: # version. For example, if it is 21, it means libraries are named michael@0: # libicuuc21.so for example. michael@0: michael@0: # rpath links a library search path right into the binaries. michael@0: ## mh-files MUST NOT override RPATHLDFLAGS unless they provide michael@0: ## equivalent '#SH#' lines for icu-config fixup 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: michael@0: #SH## icu-config version of above 'if': michael@0: #SH#case "x$ENABLE_RPATH" in michael@0: #SH# x[yY]*) michael@0: #SH# ENABLE_RPATH=YES michael@0: #SH# RPATHLDFLAGS="${LD_RPATH}${LD_RPATH_PRE}${libdir}" michael@0: #SH# ;; michael@0: #SH# michael@0: #SH# x[nN]*) michael@0: #SH# ENABLE_RPATH=NO michael@0: #SH# RPATHLDFLAGS="" michael@0: #SH# ;; michael@0: #SH# michael@0: #SH# x) michael@0: #SH# ENABLE_RPATH=NO michael@0: #SH# RPATHLDFLAGS="" michael@0: #SH# ;; michael@0: #SH# michael@0: #SH# *) michael@0: #SH# echo $0: Unknown --enable-rpath value ${ENABLE_RPATH} 1>&2 michael@0: #SH# exit 3 michael@0: #SH# ;; michael@0: #SH#esac 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: michael@0: michael@0: ### To link your application with ICU: michael@0: # 1. use LDFLAGS, CFLAGS, etc from above michael@0: # 2. link with $(ICULIBS) michael@0: # 3. optionally, add one or more of: michael@0: # - $(ICULIBS_I18N) - i18n library, formatting, etc. michael@0: # - $(ICULIBS_LAYOUT) - ICU layout library. michael@0: # - $(ICULIBS_ICUIO) - ICU stdio equivalent library michael@0: michael@0: ICULIBS_COMMON = -l$(ICUPREFIX)uc$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION) michael@0: ICULIBS_DATA = -l$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION) michael@0: ICULIBS_I18N = -l$(ICUPREFIX)$(I18N_STUBNAME)$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION) michael@0: ICULIBS_TOOLUTIL = -l$(ICUPREFIX)tu$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION) michael@0: ICULIBS_CTESTFW = -l$(ICUPREFIX)ctestfw$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION) michael@0: ICULIBS_ICUIO = -l$(ICUPREFIX)io$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION) michael@0: ICULIBS_OBSOLETE = -l$(ICUPREFIX)obsolete$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION) michael@0: ICULIBS_LAYOUT = -l$(ICUPREFIX)le$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION) michael@0: ICULIBS_LAYOUTEX = -l$(ICUPREFIX)lx$(ICULIBSUFFIX)$(ICULIBSUFFIX_VERSION) michael@0: ICULIBS_BASE = $(LIBS) -L$(libdir) michael@0: michael@0: # for icu-config to test with michael@0: ICULIBS_COMMON_LIB_NAME = ${LIBICU}${COMMON_STUBNAME}${ICULIBSUFFIX}${ICULIBSUFFIX_VERSION}.${SO} michael@0: ICULIBS_COMMON_LIB_NAME_A = ${LIBICU}${COMMON_STUBNAME}${ICULIBSUFFIX}.${A} michael@0: michael@0: # ICULIBS is the set of libraries your application should link michael@0: # with usually. Many applications will want to add $(ICULIBS_I18N) as well. michael@0: ICULIBS = $(ICULIBS_BASE) $(ICULIBS_I18N) $(ICULIBS_COMMON) $(ICULIBS_DATA) michael@0: michael@0: # Proper echo newline handling is needed in icu-config michael@0: ECHO_N=@ICU_ECHO_N@ michael@0: ECHO_C=@ICU_ECHO_C@ michael@0: # Not currently being used but good to have for proper tab handling michael@0: ECHO_T=@ICU_ECHO_T@ michael@0: michael@0: ################################################################## michael@0: ################################################################## michael@0: # michael@0: # *2* access to ICU tools michael@0: # michael@0: ################################################################## michael@0: # Environment variable to set a runtime search path michael@0: # (Overridden when necessary in -mh files) 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: michael@0: # Access to important ICU tools. michael@0: # Use as follows: $(INVOKE) $(GENRB) arguments .. michael@0: INVOKE = $(LDLIBRARYPATH_ENVVAR)=$(libdir):$$$(LDLIBRARYPATH_ENVVAR) $(LEAK_CHECKER) michael@0: GENCCODE = $(sbindir)/genccode michael@0: ICUPKG = $(sbindir)/icupkg michael@0: GENCMN = $(sbindir)/gencmn michael@0: GENRB = $(bindir)/genrb michael@0: PKGDATA = $(bindir)/pkgdata michael@0: michael@0: # moved here because of dependencies michael@0: pkgdatadir = $(datadir)/$(PACKAGE)$(ICULIBSUFFIX)/$(VERSION) michael@0: pkglibdir = $(libdir)/$(PACKAGE)$(ICULIBSUFFIX)/$(VERSION) michael@0: michael@0: ################################################################## michael@0: ################################################################## michael@0: # michael@0: # *3* Information about the host michael@0: # michael@0: ################################################################## michael@0: michael@0: # Information about the host that 'configure' was run on. michael@0: host = @host@ michael@0: host_alias = @host_alias@ michael@0: host_cpu = @host_cpu@ michael@0: host_vendor = @host_vendor@ michael@0: host_os = @host_os@ michael@0: # Our platform canonical name (as determined by configure) michael@0: # this is a #define value (i.e. U_XXXX or XXXX) michael@0: platform = @platform@ michael@0: michael@0: ################################################################## michael@0: ################################################################## michael@0: # michael@0: # *4* compiler flags and misc. options michael@0: # michael@0: ################################################################## michael@0: AR = @AR@ michael@0: # initial tab keeps it out of the shell version. michael@0: ARFLAGS := @ARFLAGS@ $(ARFLAGS) michael@0: #SH#ARFLAGS="@ARFLAGS@ ${ARFLAGS}" michael@0: CC = @CC@ michael@0: CFLAGS = @CFLAGS@ michael@0: CPP = @CPP@ michael@0: CPPFLAGS = @CPPFLAGS@ $(LIBCPPFLAGS) -I$(prefix)/include michael@0: CXX = @CXX@ michael@0: CXXFLAGS = @CXXFLAGS@ michael@0: DEFAULT_MODE = @DATA_PACKAGING_MODE@ michael@0: DEFS = @DEFS@ michael@0: FFLAGS = @FFLAGS@ michael@0: # use a consistent INSTALL michael@0: INSTALL = $(SHELL) $(pkgdatadir)/install-sh -c michael@0: INSTALL_DATA = @INSTALL_DATA@ michael@0: INSTALL_DATA = @INSTALL_DATA@ michael@0: INSTALL_PROGRAM = @INSTALL_PROGRAM@ michael@0: INSTALL_PROGRAM = @INSTALL_PROGRAM@ michael@0: INSTALL_SCRIPT = @INSTALL_SCRIPT@ michael@0: LDFLAGS = @LDFLAGS@ $(RPATHLDFLAGS) michael@0: LIBS = @LIBS@ michael@0: LIB_M = @LIB_M@ michael@0: LIB_VERSION = @LIB_VERSION@ michael@0: LIB_VERSION_MAJOR = @LIB_VERSION_MAJOR@ michael@0: MKINSTALLDIRS = $(SHELL) $(pkgdatadir)/mkinstalldirs michael@0: RANLIB = @RANLIB@ michael@0: RMV = rm -rf michael@0: SHELL = @SHELL@ michael@0: SHLIB.c= $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -shared michael@0: SHLIB.cc= $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -shared michael@0: U_IS_BIG_ENDIAN = @U_IS_BIG_ENDIAN@ michael@0: includedir = @includedir@ michael@0: infodir = @infodir@ michael@0: localstatedir = @localstatedir@ michael@0: mandir = @mandir@ michael@0: oldincludedir = @oldincludedir@ michael@0: program_transform_name = @program_transform_name@ michael@0: sharedstatedir = @sharedstatedir@ michael@0: sysconfdir = @sysconfdir@ michael@0: INSTALL-L = ${INSTALL_DATA} michael@0: michael@0: # for derivative builds - don't bother with VERBOSE/NONVERBOSE SILENT_COMPILE michael@0: SILENT_COMPILE=$(1) #M# michael@0: ICU_MSG=@echo " $(1) " #M# michael@0: michael@0: ################################################################## michael@0: ################################################################## michael@0: # michael@0: # *5* packaging options and directories michael@0: # michael@0: ################################################################## michael@0: michael@0: michael@0: # The basename of the ICU data file (i.e. icudt21b ) michael@0: ICUDATA_CHAR = @ICUDATA_CHAR@ michael@0: ICUDATA_NAME = icudt@LIB_VERSION_MAJOR@@ICUDATA_CHAR@ michael@0: michael@0: # Defaults for pkgdata's mode and directories michael@0: # The default data dir changes depending on what packaging mode michael@0: # is being used michael@0: ifeq ($(strip $(PKGDATA_MODE)),) michael@0: #SH# if [ "x$PKGDATA_MODE" = "x" ]; michael@0: #SH# then michael@0: PKGDATA_MODE=@DATA_PACKAGING_MODE@ michael@0: #SH# fi michael@0: endif michael@0: michael@0: #SH# case "$PKGDATA_MODE" in michael@0: ifeq ($(PKGDATA_MODE),common) michael@0: #SH# common) michael@0: ICUDATA_DIR = $(pkgdatadir) michael@0: ICUPKGDATA_DIR = $(ICUDATA_DIR) michael@0: #SH# ;; michael@0: else michael@0: ifeq ($(PKGDATA_MODE),dll) michael@0: #SH# dll) michael@0: ICUDATA_DIR = $(pkgdatadir) michael@0: ICUPKGDATA_DIR = $(libdir) michael@0: #SH# ;; michael@0: else michael@0: #SH# *) michael@0: ICUDATA_DIR = $(pkgdatadir) michael@0: ICUPKGDATA_DIR = $(ICUDATA_DIR) michael@0: #SH# ;; michael@0: endif michael@0: endif michael@0: michael@0: #SH# esac michael@0: michael@0: GENCCODE_ASSEMBLY = @GENCCODE_ASSEMBLY@ michael@0: michael@0: ################################################################## michael@0: ################################################################## michael@0: # michael@0: # *6* Inclusion of platform make fragment (mh-* file) michael@0: # michael@0: ################################################################## michael@0: # The mh- file ("make fragment") for the platform is included here. michael@0: # It may override the above settings. michael@0: # It is put last so that the mh-file can override anything. michael@0: # The selfcheck is just a sanity check that this makefile is michael@0: # parseable. The mh fragment is only included if this does not occur. michael@0: michael@0: ifeq (selfcheck,$(MAKECMDGOALS)) #M# michael@0: selfcheck: #M# michael@0: @echo passed #M# michael@0: else #M# michael@0: include $(pkgdatadir)/config/@platform_make_fragment_name@ michael@0: endif #M# michael@0: