2 ## os/390, z/OS specific setup
3 ## Copyright (c) 1999-2006, International Business Machines Corporation and
4 ## others. All Rights Reserved.
6 ###################################################################
8 ###################################################################
9 # Before you try to run the Makefile, make sure you have the #
10 # environment variables set. #
12 # If you are going to do the OS390BATCH build, make sure you have #
13 # the OS390BATCH environment variable set. #
15 # export OS390BATCH=1 #
17 # To build a version of ICU which uses IEEE Floating point #
21 # To build a version of ICU which uses a two common libraries #
22 # where the smaller one is loaded first. #
24 # export OS390_STUBDATA=1 #
26 # To build a version of ICU which exploits the C/C++ compiler #
27 # and runtime Extra Performance Linkage (XPLINK), specify #
29 # export OS390_XPLINK=1 #
31 ###################################################################
33 # TODO: Fix this configuration so that icu-config will work!
34 # If statements don't work well when icu-config is generated.
40 ICU_IEEE = -Wc,'float(ieee)'
42 ICU_IEEE = -DIEEE_754=0#M#
45 # For a dynamically called DLL module to share access to the POSIX external
46 # variables, with its caller, the DLL module must define these _SHR_* macros.
47 SHAREDLIBCPPFLAGS = -D_SHR_TZNAME -D_SHR_TIMEZONE
49 ## Additional flags when building libraries and with threads
50 THREADSCPPFLAGS = -D_OPEN_THREADS
52 # -Wc,expo is used to export all functions
53 SHAREDLIBCFLAGS = -Wc,expo
54 SHAREDLIBCXXFLAGS = -Wc,expo
56 # TODO: Consider using -Wc,roc,ros for making the data and strings readonly
57 # -Wc,"ros" seems to work, but not the "roc"
58 # -+ means accept any file extension as a C++ file. By default only .C is accepted.
59 CFLAGS += -Wc,'langlvl(extended),spill(2000),ros,dll' $(ICU_IEEE)
60 CXXFLAGS += -Wc,'langlvl(extended),spill(2000),ros,dll' $(ICU_IEEE) -+
61 DEFS += -D_XOPEN_SOURCE_EXTENDED -D_MSE_PROTOS
64 ifeq (${OS390_XPLINK}, 1)
65 #SH# if [ "x$OS390_XPLINK" = "x1" ]; then
66 # Note: The following options require the PTF for PQ69418 on z/OS 1.2
68 # These lines must be the last options specified.
69 ICU_XPLINK_C = -Wc,'xplink(backchain,storeargs)' -Wc,'GOFF,NOCSECT,RENT'
70 ICU_XPLINK_CPP = -Wc,'xplink(backchain,storeargs)' -Wc,'GOFF,NOCSECT,NOTEMPINC'
71 ICU_XPLINK_L = -Wl,dll,xplink -Wl,EDIT=NO
76 ifeq (${OS390BATCH},1)
77 DEFS += -DOS390BATCH#M#
80 ## Commands to generate dependency files
84 ## Commands to compile
85 # _CXX_STEPS="-1" is a prelink step when compiling C and C++, and
86 # it's only needed for long function names
87 COMPILE.c = $(COMPILE_LINK_ENVVAR) $(CXX) $(DEFS) $(CPPFLAGS) $(CFLAGS) $(ICU_XPLINK_C) -c
88 COMPILE.cc = $(COMPILE_LINK_ENVVAR) $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) $(ICU_XPLINK_CPP) -c
91 LINK.c= $(COMPILE_LINK_ENVVAR) $(CC) $(CFLAGS) -Wl,dll $(LDFLAGS) $(ICU_XPLINK_L)
92 LINK.cc= $(COMPILE_LINK_ENVVAR) $(CXX) $(CXXFLAGS) -Wl,dll $(LDFLAGS) $(ICU_XPLINK_L)
94 ## Commands for shared library (dll)
98 ## Compiler switch to embed a runtime search path
101 ## Environment variable to set a runtime search path
102 LDLIBRARYPATH_ENVVAR = LIBPATH
104 ## An import library (a.k.a. sidedeck) is needed for z/OS and MSVC
107 ## Versioned target for a shared library.
108 FINAL_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION).$(SO)
109 MIDDLE_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO)
111 ## Versioned import library names.
112 IMPORT_LIB = $(basename $(notdir $(SO_TARGET)))$(IMPORT_LIB_EXT)#M#
113 MIDDLE_IMPORT_LIB = $(basename $(notdir $(MIDDLE_SO_TARGET)))$(IMPORT_LIB_EXT)#M#
114 FINAL_IMPORT_LIB = $(basename $(notdir $(FINAL_SO_TARGET)))$(IMPORT_LIB_EXT)#M#
116 ## Non-shared intermediate object suffix
119 ifeq ($(OS390_STUBDATA),1)
120 ## Suffix of the subset data library for dual common library support
122 DEFS += -DOS390_STUBDATA -DU_LIBICUDATA_NAME=\"$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)\"#M#
125 ifeq ($(OS390BATCH),1)
126 ifeq ($(OS390_STUBDATA),1)
127 BATCH_STUB_TARGET= "//'${LOADMOD}(IXMI${SO_TARGET_VERSION_MAJOR}D1)'"
128 BATCH_LIBICUDT= "//'${LOADEXP}(IXMI${SO_TARGET_VERSION_MAJOR}D1)'"
130 BATCH_STUB_TARGET= "//'${LOADMOD}(IXMI${SO_TARGET_VERSION_MAJOR}DA)'"
131 BATCH_LIBICUDT= "//'${LOADEXP}(IXMI${SO_TARGET_VERSION_MAJOR}DA)'"
132 PKGDATA_DEFS += -DU_LIBICUDATA_NAME=\"$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)\"
135 BATCH_COMMON_TARGET="//'${LOADMOD}(IXMI${SO_TARGET_VERSION_MAJOR}UC)'"
136 BATCH_I18N_TARGET="//'${LOADMOD}(IXMI${SO_TARGET_VERSION_MAJOR}IN)'"
137 BATCH_IO_TARGET="//'${LOADMOD}(IXMI${SO_TARGET_VERSION_MAJOR}IO)'"
138 BATCH_LAYOUT_TARGET="//'${LOADMOD}(IXMI${SO_TARGET_VERSION_MAJOR}LE)'"
139 BATCH_LAYOUTEX_TARGET="//'${LOADMOD}(IXMI${SO_TARGET_VERSION_MAJOR}LX)'"
141 BATCH_LIBICUUC= "//'${LOADEXP}(IXMI${SO_TARGET_VERSION_MAJOR}UC)'"
142 BATCH_LIBICUI18N= "//'${LOADEXP}(IXMI${SO_TARGET_VERSION_MAJOR}IN)'"
143 BATCH_LIBICUIO= "//'${LOADEXP}(IXMI${SO_TARGET_VERSION_MAJOR}IO)'"
144 BATCH_LIBICULE= "//'${LOADEXP}(IXMI${SO_TARGET_VERSION_MAJOR}LE)'"
145 BATCH_LIBICULX= "//'${LOADEXP}(IXMI${SO_TARGET_VERSION_MAJOR}LX)'"
148 ## Link commands to link to ICU libs
149 LIBICUDT= $(top_builddir)/stubdata/$(LIBICU)data$(ICULIBSUFFIX)$(STUB_SUFFIX)$(SO_TARGET_VERSION).x
150 LIBICUUC= $(top_builddir)/common/$(LIBICU)uc$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
151 LIBICUI18N= $(top_builddir)/i18n/$(LIBICU)i18n$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
152 LIBICULE= $(top_builddir)/layout/$(LIBICU)le$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
153 LIBICULX= $(top_builddir)/layoutex/$(LIBICU)lx$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
154 LIBICUIO= $(top_builddir)/io/$(LIBICU)io$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
155 LIBCTESTFW= $(top_builddir)/tools/ctestfw/$(LIBICU)test$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
156 LIBICUTOOLUTIL= $(top_builddir)/tools/toolutil/$(LIBICU)tu$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
158 ifneq (${ICUDATA_CHAR},e)
159 #SH# if [ "$ICUDATA_CHAR" != "e" ]; then
160 ## We're in ASCII mode.
161 CFLAGS += -Wc,'ascii'
162 CXXFLAGS += -Wc,'ascii'
166 ## We're in EBCDIC mode.
167 ## Shared object suffix
174 ## Build archive from object
176 $(AR) $(ARFLAGS) $@ $(OBJECTS)
179 %.$(STATIC_O): $(srcdir)/%.c
180 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
182 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
184 %.$(STATIC_O): $(srcdir)/%.cpp
185 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
187 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
191 @$(SHELL) -ec 'cat $< \
192 | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
193 [ -s $@ ] || rm -f $@ ; rm -f $<'
196 @echo "generating dependency information for $<"
197 @$(SHELL) -ec 'touch $*.u > /dev/null 2>&1'
198 @$(SHELL) -ec '$(GEN_DEPS.c) -f $*.u $< > /dev/null 2>&1'
200 %.u : $(srcdir)/%.cpp
201 @echo "generating dependency information for $<"
202 @$(SHELL) -ec 'touch $*.u > /dev/null 2>&1'
203 @$(SHELL) -ec '$(GEN_DEPS.cc) -f $*.u $< > /dev/null 2>&1'
205 ## Versioned libraries rules
206 %$(SO_TARGET_VERSION_MAJOR).$(SO): %$(SO_TARGET_VERSION).$(SO)
207 $(RM) $@ && ln -s ${*F}$(SO_TARGET_VERSION).$(SO) $@
208 %.$(SO): %$(SO_TARGET_VERSION).$(SO)
209 $(RM) $@ && ln -s ${*F}$(SO_TARGET_VERSION).$(SO) $@
211 ## Install libraries as executable
212 INSTALL-L=$(INSTALL_PROGRAM)
214 ## End 390-specific setup