michael@0: ## -*-makefile-*- michael@0: ## os/390, z/OS specific setup michael@0: ## Copyright (c) 1999-2013, International Business Machines Corporation and michael@0: ## others. All Rights Reserved. michael@0: michael@0: ################################################################### michael@0: # IMPORTANT NOTE # michael@0: ################################################################### michael@0: # Before you try to run the Makefile, make sure you have the # michael@0: # environment variables set. # michael@0: # # michael@0: # If you are going to do the OS390BATCH build, make sure you have # michael@0: # the OS390BATCH environment variable set. # michael@0: # # michael@0: # export OS390BATCH=1 # michael@0: # # michael@0: # To build a version of ICU that does not use IEEE Floating point # michael@0: # # michael@0: # export IEEE390=0 # michael@0: # # michael@0: # To build a version of ICU which uses a two data libraries # michael@0: # where the smaller one is loaded first, use OS390_STUBDATA. # michael@0: # USAGE OF THIS OPTION IS DEPRECATED. You should look into using # michael@0: # Link Pack Area (LPA), library lookaside facility (LLA) or other # michael@0: # z/OS options that enable page fault based loading of read-only # michael@0: # code/data instead of this option. # michael@0: # This option will be removed in a future version of ICU. # michael@0: # # michael@0: # export OS390_STUBDATA=1 # michael@0: # # michael@0: # To build a version of ICU which exploits the C/C++ compiler # michael@0: # and runtime Extra Performance Linkage (XPLINK), specify # michael@0: # # michael@0: # export OS390_XPLINK=1 # michael@0: # # michael@0: ################################################################### michael@0: michael@0: # TODO: Fix this configuration so that icu-config will work! michael@0: # If statements don't work well when icu-config is generated. michael@0: ifeq (${IEEE390},) michael@0: IEEE390=1#M# michael@0: endif michael@0: michael@0: ifeq (${IEEE390}, 1) michael@0: ICU_IEEE =#M# michael@0: else michael@0: ICU_IEEE = -Wc,'FLOAT(IEEE)' -DIEEE_754=0#M# michael@0: endif michael@0: michael@0: ## Additional flags when building libraries and with threads michael@0: THREADSCPPFLAGS = -D_OPEN_THREADS michael@0: michael@0: # For a dynamically called DLL module to share access to the POSIX external michael@0: # variables, with its caller, the DLL module must define these _SHR_* macros. michael@0: SHAREDLIBCPPFLAGS = -D_SHR_TZNAME -D_SHR_TIMEZONE michael@0: michael@0: # -Wc,expo is used to export all functions michael@0: SHAREDLIBCFLAGS = -Wc,expo michael@0: SHAREDLIBCXXFLAGS = -Wc,expo michael@0: michael@0: # TODO: Consider using -Wc,roc,ros for making the data and strings readonly michael@0: # -Wc,"ros" seems to work, but not the "roc" michael@0: # The RENT option makes the program reentrant. This may not really have the same michael@0: # meaning as normal reentrancy on other platforms. See the z/OS documentation michael@0: # for details. This is the default for C++, but not C. michael@0: # The DLL option must be used by the callee and caller code when using shared libraries. michael@0: # NOCSECT might be used as an optimization option. michael@0: # -+ means accept any file extension as a C++ file. By default only .C is accepted. michael@0: CFLAGS += -Wc,DLL,ROS,RENT,'ARCH(7)','LOC(POSIX)',NOANSIALIAS,'LANGLVL(EXTENDED)' $(ICU_IEEE) michael@0: CXXFLAGS += -Wc,DLL,ROS,RTTI,'ARCH(7)','LOC(POSIX)',NOANSIALIAS,'LANGLVL(EXTENDED)' $(ICU_IEEE) -+ michael@0: ARFLAGS = -cr michael@0: michael@0: # _MSE_PROTOS usually interacts with _XOPEN_SOURCE. It affects some standard michael@0: # C functions that use wchar_t, and it selects behavior for michael@0: # multibyte extension support (MSE) functions. michael@0: #DEFS += -D_MSE_PROTOS michael@0: michael@0: ifeq (${OS390_XPLINK}, 1) michael@0: #SH# if [ "x$OS390_XPLINK" = "x1" ]; then michael@0: # These lines must be the last options specified. michael@0: # GOFF is is the strategic object module format for S/390. It is required for XPLINK. michael@0: # NOTEMPINC could be used if ICU starts using templates. michael@0: ICU_XPLINK_C = -Wc,'xplink(backchain,storeargs),goff' michael@0: ICU_XPLINK_CXX = -Wc,'xplink(backchain,storeargs),goff' -Wc,'NOTEMPINC' michael@0: ICU_XPLINK_L = -Wl,xplink michael@0: #SH# fi michael@0: endif michael@0: michael@0: ## OS390BATCH michael@0: ifeq (${OS390BATCH},1) michael@0: DEFS += -DOS390BATCH#M# michael@0: endif michael@0: michael@0: ## Commands to generate dependency files michael@0: GEN_DEPS.c= makedep michael@0: GEN_DEPS.cc= makedep michael@0: michael@0: ## Commands to compile michael@0: # _CXX_STEPS="-1" is a prelink step when compiling C and C++, and michael@0: # it's only needed for long function names michael@0: COMPILE.c = $(COMPILE_LINK_ENVVAR) $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) $(ICU_XPLINK_C) -c michael@0: COMPILE.cc = $(COMPILE_LINK_ENVVAR) $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) $(ICU_XPLINK_CXX) -c michael@0: michael@0: # Commands to link michael@0: LINK.c= $(COMPILE_LINK_ENVVAR) $(CC) $(CFLAGS) -Wl,dll $(LDFLAGS) $(ICU_XPLINK_L) michael@0: LINK.cc= $(COMPILE_LINK_ENVVAR) $(CXX) $(CXXFLAGS) -Wl,dll $(LDFLAGS) $(ICU_XPLINK_L) michael@0: michael@0: ## Commands for shared library (dll) michael@0: SHLIB.c= $(LINK.c) michael@0: SHLIB.cc= $(LINK.cc) michael@0: michael@0: ## Compiler switch to embed a runtime search path michael@0: LD_RPATH= -I michael@0: michael@0: ## Environment variable to set a runtime search path michael@0: LDLIBRARYPATH_ENVVAR = LIBPATH michael@0: michael@0: ## An import library (a.k.a. sidedeck) is needed for z/OS and MSVC michael@0: IMPORT_LIB_EXT = .x michael@0: michael@0: ## Versioned target for a shared library. michael@0: FINAL_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION).$(SO) michael@0: MIDDLE_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO) michael@0: michael@0: ## Versioned import library names. michael@0: IMPORT_LIB = $(basename $(notdir $(SO_TARGET)))$(IMPORT_LIB_EXT)#M# michael@0: MIDDLE_IMPORT_LIB = $(basename $(notdir $(MIDDLE_SO_TARGET)))$(IMPORT_LIB_EXT)#M# michael@0: FINAL_IMPORT_LIB = $(basename $(notdir $(FINAL_SO_TARGET)))$(IMPORT_LIB_EXT)#M# michael@0: michael@0: ## Non-shared intermediate object suffix michael@0: STATIC_O = o michael@0: michael@0: ifeq ($(OS390_STUBDATA),1) michael@0: ## Suffix of the subset data library for dual common library support michael@0: STUB_SUFFIX=_stub#M# michael@0: DEFS += -DOS390_STUBDATA -DU_LIBICUDATA_NAME=\"$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)\"#M# michael@0: endif michael@0: michael@0: ifeq ($(OS390BATCH),1) michael@0: ## IXM is used as a name prefix for XML Toolkit, default value michael@0: ifeq ($(PDS_NAME_PREFIX),) michael@0: PDS_NAME_PREFIX= IXMI michael@0: endif michael@0: ifeq ($(OS390_STUBDATA),1) michael@0: BATCH_STUB_TARGET= "//'${LOADMOD}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}D1)'" michael@0: BATCH_LIBICUDT= "//'${LOADEXP}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}D1)'" michael@0: else michael@0: BATCH_STUB_TARGET= "//'${LOADMOD}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}DA)'" michael@0: BATCH_LIBICUDT= "//'${LOADEXP}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}DA)'" michael@0: PKGDATA_DEFS += -DU_LIBICUDATA_NAME=\"$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)\" michael@0: endif michael@0: michael@0: BATCH_COMMON_TARGET="//'${LOADMOD}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}UC)'" michael@0: BATCH_I18N_TARGET="//'${LOADMOD}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}IN)'" michael@0: BATCH_IO_TARGET="//'${LOADMOD}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}IO)'" michael@0: BATCH_LAYOUT_TARGET="//'${LOADMOD}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}LE)'" michael@0: BATCH_LAYOUTEX_TARGET="//'${LOADMOD}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}LX)'" michael@0: michael@0: BATCH_LIBICUUC= "//'${LOADEXP}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}UC)'" michael@0: BATCH_LIBICUI18N= "//'${LOADEXP}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}IN)'" michael@0: BATCH_LIBICUIO= "//'${LOADEXP}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}IO)'" michael@0: BATCH_LIBICULE= "//'${LOADEXP}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}LE)'" michael@0: BATCH_LIBICULX= "//'${LOADEXP}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}LX)'" michael@0: endif michael@0: michael@0: michael@0: ## Link commands to link to ICU libs michael@0: LIBICUDT= $(top_builddir)/stubdata/$(LIBICU)data$(ICULIBSUFFIX)$(STUB_SUFFIX)$(SO_TARGET_VERSION).x michael@0: LIBICUUC= $(top_builddir)/common/$(LIBICU)uc$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x michael@0: LIBICUI18N= $(top_builddir)/i18n/$(LIBICU)i18n$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x michael@0: LIBICULE= $(top_builddir)/layout/$(LIBICU)le$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x michael@0: LIBICULX= $(top_builddir)/layoutex/$(LIBICU)lx$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x michael@0: LIBICUIO= $(top_builddir)/io/$(LIBICU)io$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x michael@0: LIBCTESTFW= $(top_builddir)/tools/ctestfw/$(LIBICU)test$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x michael@0: LIBICUTOOLUTIL= $(top_builddir)/tools/toolutil/$(LIBICU)tu$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x michael@0: michael@0: ifneq (${ICUDATA_CHAR},e) michael@0: #SH# if [ "$ICUDATA_CHAR" != "e" ]; then michael@0: ## We're in ASCII mode. michael@0: CFLAGS += -Wc,'ascii' michael@0: CXXFLAGS += -Wc,'ascii' michael@0: SO = so michael@0: else michael@0: #SH# else michael@0: ## We're in EBCDIC mode. michael@0: ## Shared object suffix michael@0: SO = dll michael@0: endif michael@0: #SH# fi michael@0: michael@0: ## Special 390 rules michael@0: michael@0: ## Build archive from object michael@0: %.a : $(OBJECTS) michael@0: $(AR) $(ARFLAGS) $@ $(OBJECTS) michael@0: michael@0: ## Compilation rules michael@0: %.$(STATIC_O): $(srcdir)/%.c michael@0: $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $< michael@0: %.o: $(srcdir)/%.c michael@0: $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $< michael@0: michael@0: %.$(STATIC_O): $(srcdir)/%.cpp michael@0: $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $< michael@0: %.o: $(srcdir)/%.cpp michael@0: $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $< michael@0: michael@0: ## Dependency rules michael@0: %.d : %.u michael@0: @$(SHELL) -ec 'cat $< \ michael@0: | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \ michael@0: [ -s $@ ] || rm -f $@ ; rm -f $<' michael@0: michael@0: %.u : $(srcdir)/%.c michael@0: @echo "generating dependency information for $<" michael@0: @$(SHELL) -ec 'touch $*.u > /dev/null 2>&1' michael@0: @$(SHELL) -ec '$(GEN_DEPS.c) -f $*.u $< > /dev/null 2>&1' michael@0: michael@0: %.u : $(srcdir)/%.cpp michael@0: @echo "generating dependency information for $<" michael@0: @$(SHELL) -ec 'touch $*.u > /dev/null 2>&1' michael@0: @$(SHELL) -ec '$(GEN_DEPS.cc) -f $*.u $< > /dev/null 2>&1' michael@0: michael@0: ## Versioned libraries rules michael@0: %$(SO_TARGET_VERSION_MAJOR).$(SO): %$(SO_TARGET_VERSION).$(SO) michael@0: $(RM) $@ && ln -s ${*F}$(SO_TARGET_VERSION).$(SO) $@ michael@0: %.$(SO): %$(SO_TARGET_VERSION).$(SO) michael@0: $(RM) $@ && ln -s ${*F}$(SO_TARGET_VERSION).$(SO) $@ michael@0: michael@0: ## Install libraries as executable michael@0: INSTALL-L=$(INSTALL_PROGRAM) michael@0: michael@0: ## End 390-specific setup