3 ## Copyright (c) 1999-2003, International Business Machines Corporation and
4 ## others. All Rights Reserved.
6 ## $Id: mh-os390,v 1.1.1.2 2003/07/03 18:13:33 avery Exp $
8 ###################################################################
10 ###################################################################
11 # Before you try to run the Makefile, make sure you have the #
12 # environment variables set. #
14 # If you are going to do the OS390BATCH build, make sure you have #
15 # the OS390BATCH environment variable set. #
17 # export OS390BATCH=1 #
19 # To build a version of ICU which uses IEEE Floating point #
23 # To build a version of ICU which uses a two common libraries #
24 # where the smaller one is loaded first. #
26 # export OS390_STUBDATA=1 #
28 # To build a version of ICU which exploits the C/C++ compiler #
29 # and runtime Extra Performance Linkage (XPLINK), specify #
31 # export OS390_XPLINK=1 #
33 ###################################################################
40 ICU_IEEE = -Wc,"float(ieee)" -DIEEE_754=1
42 ICU_IEEE = -DIEEE_754=0
45 # TODO: Consider using -Wc,roc,ros for making the data and strings readonly
46 # -Wc,"ros" seems to work, but not the "roc"
47 CFLAGS += -Wc,"langlvl(extended),spill(2000)" -Wc,"ros" $(ICU_BUILD_OPTIONS) $(ICU_IEEE) -Wc,dll,expo
48 CXXFLAGS += -Wc,"langlvl(extended),spill(2000)" -Wc,"ros" $(ICU_BUILD_OPTIONS) $(ICU_IEEE) -Wc,dll,expo
49 DEFS += -D_OPEN_THREADS -D_XOPEN_SOURCE_EXTENDED -D_MSE_PROTOS -D_SHR_TZNAME -D_SHR_TIMEZONE -DU_LIBICUDATA_NAME=\"$(ICUDATA_NAME)\"
52 # TODO: Fix this configuration so that icu-config will work!
53 # This means we shouldn't be using so many of these special case defines.
54 ifeq (${OS390_XPLINK}, 1)
55 # Note: The following options require the PTF for PQ69418 on z/OS 1.2
57 # These lines must be the last options specified.
58 ICU_XPLINK_C = -Wc,"xplink(backchain,storeargs)" -Wc,"GOFF,NOCSECT,RENT,SSCOMM" -Wc,"inline(auto,noreport,500,2500)"
59 ICU_XPLINK_CPP = -Wc,"xplink(backchain,storeargs)" -Wc,"GOFF,NOCSECT,NOTEMPINC" -Wc,"inline(auto,noreport,300,2500)"
60 ICU_XPLINK_L = -Wl,dll,xplink -Wl,EDIT=NO
64 ifeq (${OS390BATCH},1)
68 # Uncomment this line or do "gmake OS390_STUBDATA=1" to enable dual common library support
72 ## Commands to generate dependency files
76 ## Commands to compile
77 # _CXX_STEPS="-1" is a prelink step when compiling C and C++, and
78 # it's only needed for long function names
79 COMPILE.c = $(COMPILE_LINK_ENVVAR) $(CXX) $(DEFS) $(CPPFLAGS) $(CFLAGS) $(ICU_XPLINK_C) -c
80 COMPILE.cc = _CXX_CXXSUFFIX="cpp" $(COMPILE_LINK_ENVVAR) $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) $(ICU_XPLINK_CPP) -c
83 LINK.c= $(COMPILE_LINK_ENVVAR) $(CC) $(CFLAGS) -Wl,dll $(LDFLAGS) $(ICU_XPLINK_L)
84 LINK.cc= $(COMPILE_LINK_ENVVAR) $(CXX) $(CXXFLAGS) -Wl,dll $(LDFLAGS) $(ICU_XPLINK_L)
86 ## Commands for shared library (dll)
90 ## Compiler switch to embed a runtime search path
93 ## Environment variable to set a runtime search path
94 LDLIBRARYPATH_ENVVAR = LIBPATH
96 ## An import library (a.k.a. sidedeck) is needed for z/OS and MSVC
99 ## Versioned target for a shared library.
100 FINAL_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION).$(SO)
101 MIDDLE_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO)
103 ## Versioned import library names.
104 IMPORT_LIB = $(basename $(SO_TARGET))$(IMPORT_LIB_EXT)
105 MIDDLE_IMPORT_LIB = $(basename $(MIDDLE_SO_TARGET))$(IMPORT_LIB_EXT)
106 FINAL_IMPORT_LIB = $(basename $(FINAL_SO_TARGET))$(IMPORT_LIB_EXT)
108 ## Shared object suffix (switch to dll for shared library build)
110 ## Non-shared intermediate object suffix
113 ifeq ($(OS390_STUBDATA),1)
114 ## Suffix of the subset data library for dual common library support
116 DEFS += -DOS390_STUBDATA
119 ifeq ($(OS390BATCH),1)
120 ifeq ($(OS390_STUBDATA),1)
121 BATCH_STUB_TARGET= "//'${LOADMOD}(IXMI${SO_TARGET_VERSION_MAJOR}D1)'"
122 BATCH_LIBICUDT= "//'${LOADEXP}(IXMI${SO_TARGET_VERSION_MAJOR}D1)'"
124 BATCH_STUB_TARGET= "//'${LOADMOD}(IXMI${SO_TARGET_VERSION_MAJOR}DA)'"
125 BATCH_LIBICUDT= "//'${LOADEXP}(IXMI${SO_TARGET_VERSION_MAJOR}DA)'"
128 BATCH_COMMON_TARGET="//'${LOADMOD}(IXMI${SO_TARGET_VERSION_MAJOR}UC)'"
129 BATCH_I18N_TARGET= "//'${LOADMOD}(IXMI${SO_TARGET_VERSION_MAJOR}IN)'"
130 BATCH_USTDIO_TARGET="//'${LOADMOD}(IXMI${SO_TARGET_VERSION_MAJOR}IO)'"
132 BATCH_LIBICUUC= "//'${LOADEXP}(IXMI${SO_TARGET_VERSION_MAJOR}UC)'"
133 BATCH_LIBICUI18N= "//'${LOADEXP}(IXMI${SO_TARGET_VERSION_MAJOR}IN)'"
134 BATCH_LIBICUSTDIO= "//'${LOADEXP}(IXMI${SO_TARGET_VERSION_MAJOR}IO)'"
135 BATCH_LIBICULE= "//'${LOADEXP}(IXMI${SO_TARGET_VERSION_MAJOR}LE)'"
136 BATCH_LIBICULX= "//'${LOADEXP}(IXMI${SO_TARGET_VERSION_MAJOR}LX)'"
139 ## Link commands to link to ICU libs
140 LIBICUDT= $(top_builddir)/stubdata/lib$(ICUPREFIX)data$(ICULIBSUFFIX)$(STUB_SUFFIX)$(SO_TARGET_VERSION).x
141 LIBICUUC= $(top_builddir)/common/lib$(ICUPREFIX)uc$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
142 LIBICUI18N= $(top_builddir)/i18n/lib$(ICUPREFIX)i18n$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
143 LIBICULE= $(top_builddir)/layout/lib$(ICUPREFIX)le$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
144 LIBICULX= $(top_builddir)/layoutex/lib$(ICUPREFIX)lx$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
145 LIBCTESTFW= $(top_builddir)/tools/ctestfw/lib$(ICUPREFIX)ctestfw$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
146 LIBICUTOOLUTIL= $(top_builddir)/tools/toolutil/lib$(ICUPREFIX)toolutil$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
147 LIBUSTDIO= $(top_builddir)/extra/ustdio/libicuio$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
151 ## Build archive from object
153 $(AR) $(ARFLAGS) $@ $(OBJECTS)
156 %.$(STATIC_O): $(srcdir)/%.c
157 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
159 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
161 %.$(STATIC_O): $(srcdir)/%.cpp
162 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
164 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
168 @$(SHELL) -ec 'cat $< \
169 | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
170 [ -s $@ ] || rm -f $@ ; rm -f $<'
173 @echo "generating dependency information for $<"
174 @$(SHELL) -ec 'touch $*.u > /dev/null 2>&1'
175 @$(SHELL) -ec '$(GEN_DEPS.c) -f $*.u $< > /dev/null 2>&1'
177 %.u : $(srcdir)/%.cpp
178 @echo "generating dependency information for $<"
179 @$(SHELL) -ec 'touch $*.u > /dev/null 2>&1'
180 @$(SHELL) -ec '$(GEN_DEPS.cc) -f $*.u $< > /dev/null 2>&1'
182 ## Versioned libraries rules
183 %$(SO_TARGET_VERSION_MAJOR).$(SO): %$(SO_TARGET_VERSION).$(SO)
184 $(RM) $@ && ln -s $*$(SO_TARGET_VERSION).$(SO) $@
185 %.$(SO): %$(SO_TARGET_VERSION).$(SO)
186 $(RM) $@ && ln -s $*$(SO_TARGET_VERSION).$(SO) $@
188 ## End 390-specific setup