]>
Commit | Line | Data |
---|---|---|
b75a7d8f | 1 | ## -*-makefile-*- |
73c04bcf | 2 | ## os/390, z/OS specific setup |
51004dcb | 3 | ## Copyright (c) 1999-2012, International Business Machines Corporation and |
b75a7d8f | 4 | ## others. All Rights Reserved. |
b75a7d8f A |
5 | |
6 | ################################################################### | |
7 | # IMPORTANT NOTE # | |
8 | ################################################################### | |
9 | # Before you try to run the Makefile, make sure you have the # | |
10 | # environment variables set. # | |
11 | # # | |
12 | # If you are going to do the OS390BATCH build, make sure you have # | |
13 | # the OS390BATCH environment variable set. # | |
14 | # # | |
15 | # export OS390BATCH=1 # | |
16 | # # | |
46f4442e | 17 | # To build a version of ICU that does not use IEEE Floating point # |
b75a7d8f | 18 | # # |
46f4442e | 19 | # export IEEE390=0 # |
b75a7d8f | 20 | # # |
46f4442e A |
21 | # To build a version of ICU which uses a two data libraries # |
22 | # where the smaller one is loaded first, use OS390_STUBDATA. # | |
23 | # USAGE OF THIS OPTION IS DEPRECATED. You should look into using # | |
24 | # Link Pack Area (LPA), library lookaside facility (LLA) or other # | |
25 | # z/OS options that enable page fault based loading of read-only # | |
26 | # code/data instead of this option. # | |
27 | # This option will be removed in a future version of ICU. # | |
b75a7d8f A |
28 | # # |
29 | # export OS390_STUBDATA=1 # | |
30 | # # | |
31 | # To build a version of ICU which exploits the C/C++ compiler # | |
32 | # and runtime Extra Performance Linkage (XPLINK), specify # | |
33 | # # | |
34 | # export OS390_XPLINK=1 # | |
35 | # # | |
36 | ################################################################### | |
37 | ||
73c04bcf A |
38 | # TODO: Fix this configuration so that icu-config will work! |
39 | # If statements don't work well when icu-config is generated. | |
b75a7d8f | 40 | ifeq (${IEEE390},) |
73c04bcf | 41 | IEEE390=1#M# |
b75a7d8f A |
42 | endif |
43 | ||
44 | ifeq (${IEEE390}, 1) | |
51004dcb | 45 | ICU_IEEE = -Wc,'FLOAT(IEEE)' |
b75a7d8f | 46 | else |
51004dcb | 47 | ICU_IEEE = -Wc,'FLOAT(IEEE)' -DIEEE_754=0#M# |
b75a7d8f A |
48 | endif |
49 | ||
46f4442e A |
50 | ## Additional flags when building libraries and with threads |
51 | THREADSCPPFLAGS = -D_OPEN_THREADS | |
52 | ||
73c04bcf A |
53 | # For a dynamically called DLL module to share access to the POSIX external |
54 | # variables, with its caller, the DLL module must define these _SHR_* macros. | |
55 | SHAREDLIBCPPFLAGS = -D_SHR_TZNAME -D_SHR_TIMEZONE | |
56 | ||
73c04bcf A |
57 | # -Wc,expo is used to export all functions |
58 | SHAREDLIBCFLAGS = -Wc,expo | |
59 | SHAREDLIBCXXFLAGS = -Wc,expo | |
60 | ||
b75a7d8f A |
61 | # TODO: Consider using -Wc,roc,ros for making the data and strings readonly |
62 | # -Wc,"ros" seems to work, but not the "roc" | |
46f4442e A |
63 | # The RENT option makes the program reentrant. This may not really have the same |
64 | # meaning as normal reentrancy on other platforms. See the z/OS documentation | |
65 | # for details. This is the default for C++, but not C. | |
66 | # The DLL option must be used by the callee and caller code when using shared libraries. | |
67 | # NOCSECT might be used as an optimization option. | |
73c04bcf | 68 | # -+ means accept any file extension as a C++ file. By default only .C is accepted. |
51004dcb A |
69 | CFLAGS += -Wc,DLL,ROS,RENT,'ARCH(7)','LOC(POSIX)',NOANSIALIAS,'CHARS(SIGNED)','LANGLVL(EXTENDED)' $(ICU_IEEE) |
70 | CXXFLAGS += -Wc,DLL,ROS,RTTI,'ARCH(7)','LOC(POSIX)',NOANSIALIAS,'CHARS(SIGNED)','LANGLVL(EXTENDED)' $(ICU_IEEE) -+ | |
71 | DEFS += -D_XOPEN_SOURCE=600 | |
b75a7d8f A |
72 | ARFLAGS = -cr |
73 | ||
46f4442e A |
74 | # _MSE_PROTOS usually interacts with _XOPEN_SOURCE. It affects some standard |
75 | # C functions that use wchar_t, and it selects behavior for | |
76 | # multibyte extension support (MSE) functions. | |
77 | #DEFS += -D_MSE_PROTOS | |
78 | ||
b75a7d8f | 79 | ifeq (${OS390_XPLINK}, 1) |
73c04bcf | 80 | #SH# if [ "x$OS390_XPLINK" = "x1" ]; then |
b75a7d8f | 81 | # These lines must be the last options specified. |
46f4442e A |
82 | # GOFF is is the strategic object module format for S/390. It is required for XPLINK. |
83 | # NOTEMPINC could be used if ICU starts using templates. | |
84 | ICU_XPLINK_C = -Wc,'xplink(backchain,storeargs),goff' | |
51004dcb | 85 | ICU_XPLINK_CXX = -Wc,'xplink(backchain,storeargs),goff' -Wc,'NOTEMPINC' |
46f4442e | 86 | ICU_XPLINK_L = -Wl,xplink |
73c04bcf | 87 | #SH# fi |
b75a7d8f A |
88 | endif |
89 | ||
90 | ## OS390BATCH | |
91 | ifeq (${OS390BATCH},1) | |
73c04bcf | 92 | DEFS += -DOS390BATCH#M# |
b75a7d8f A |
93 | endif |
94 | ||
b75a7d8f A |
95 | ## Commands to generate dependency files |
96 | GEN_DEPS.c= makedep | |
97 | GEN_DEPS.cc= makedep | |
98 | ||
99 | ## Commands to compile | |
100 | # _CXX_STEPS="-1" is a prelink step when compiling C and C++, and | |
101 | # it's only needed for long function names | |
46f4442e A |
102 | COMPILE.c = $(COMPILE_LINK_ENVVAR) $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) $(ICU_XPLINK_C) -c |
103 | COMPILE.cc = $(COMPILE_LINK_ENVVAR) $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) $(ICU_XPLINK_CXX) -c | |
b75a7d8f A |
104 | |
105 | # Commands to link | |
106 | LINK.c= $(COMPILE_LINK_ENVVAR) $(CC) $(CFLAGS) -Wl,dll $(LDFLAGS) $(ICU_XPLINK_L) | |
107 | LINK.cc= $(COMPILE_LINK_ENVVAR) $(CXX) $(CXXFLAGS) -Wl,dll $(LDFLAGS) $(ICU_XPLINK_L) | |
108 | ||
109 | ## Commands for shared library (dll) | |
110 | SHLIB.c= $(LINK.c) | |
111 | SHLIB.cc= $(LINK.cc) | |
112 | ||
113 | ## Compiler switch to embed a runtime search path | |
114 | LD_RPATH= -I | |
115 | ||
116 | ## Environment variable to set a runtime search path | |
117 | LDLIBRARYPATH_ENVVAR = LIBPATH | |
118 | ||
119 | ## An import library (a.k.a. sidedeck) is needed for z/OS and MSVC | |
120 | IMPORT_LIB_EXT = .x | |
121 | ||
122 | ## Versioned target for a shared library. | |
123 | FINAL_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION).$(SO) | |
124 | MIDDLE_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO) | |
125 | ||
126 | ## Versioned import library names. | |
73c04bcf A |
127 | IMPORT_LIB = $(basename $(notdir $(SO_TARGET)))$(IMPORT_LIB_EXT)#M# |
128 | MIDDLE_IMPORT_LIB = $(basename $(notdir $(MIDDLE_SO_TARGET)))$(IMPORT_LIB_EXT)#M# | |
129 | FINAL_IMPORT_LIB = $(basename $(notdir $(FINAL_SO_TARGET)))$(IMPORT_LIB_EXT)#M# | |
b75a7d8f | 130 | |
b75a7d8f A |
131 | ## Non-shared intermediate object suffix |
132 | STATIC_O = o | |
133 | ||
134 | ifeq ($(OS390_STUBDATA),1) | |
135 | ## Suffix of the subset data library for dual common library support | |
73c04bcf A |
136 | STUB_SUFFIX=_stub#M# |
137 | DEFS += -DOS390_STUBDATA -DU_LIBICUDATA_NAME=\"$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)\"#M# | |
b75a7d8f A |
138 | endif |
139 | ||
140 | ifeq ($(OS390BATCH),1) | |
51004dcb A |
141 | ## IXM is used as a name prefix for XML Toolkit, default value |
142 | ifeq ($(PDS_NAME_PREFIX),) | |
143 | PDS_NAME_PREFIX= IXMI | |
144 | endif | |
b75a7d8f | 145 | ifeq ($(OS390_STUBDATA),1) |
51004dcb A |
146 | BATCH_STUB_TARGET= "//'${LOADMOD}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}D1)'" |
147 | BATCH_LIBICUDT= "//'${LOADEXP}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}D1)'" | |
b75a7d8f | 148 | else |
51004dcb A |
149 | BATCH_STUB_TARGET= "//'${LOADMOD}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}DA)'" |
150 | BATCH_LIBICUDT= "//'${LOADEXP}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}DA)'" | |
73c04bcf | 151 | PKGDATA_DEFS += -DU_LIBICUDATA_NAME=\"$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)\" |
b75a7d8f A |
152 | endif |
153 | ||
51004dcb A |
154 | BATCH_COMMON_TARGET="//'${LOADMOD}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}UC)'" |
155 | BATCH_I18N_TARGET="//'${LOADMOD}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}IN)'" | |
156 | BATCH_IO_TARGET="//'${LOADMOD}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}IO)'" | |
157 | BATCH_LAYOUT_TARGET="//'${LOADMOD}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}LE)'" | |
158 | BATCH_LAYOUTEX_TARGET="//'${LOADMOD}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}LX)'" | |
159 | ||
160 | BATCH_LIBICUUC= "//'${LOADEXP}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}UC)'" | |
161 | BATCH_LIBICUI18N= "//'${LOADEXP}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}IN)'" | |
162 | BATCH_LIBICUIO= "//'${LOADEXP}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}IO)'" | |
163 | BATCH_LIBICULE= "//'${LOADEXP}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}LE)'" | |
164 | BATCH_LIBICULX= "//'${LOADEXP}(${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR}LX)'" | |
b75a7d8f A |
165 | endif |
166 | ||
51004dcb | 167 | |
b75a7d8f | 168 | ## Link commands to link to ICU libs |
374ca955 A |
169 | LIBICUDT= $(top_builddir)/stubdata/$(LIBICU)data$(ICULIBSUFFIX)$(STUB_SUFFIX)$(SO_TARGET_VERSION).x |
170 | LIBICUUC= $(top_builddir)/common/$(LIBICU)uc$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x | |
171 | LIBICUI18N= $(top_builddir)/i18n/$(LIBICU)i18n$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x | |
172 | LIBICULE= $(top_builddir)/layout/$(LIBICU)le$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x | |
173 | LIBICULX= $(top_builddir)/layoutex/$(LIBICU)lx$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x | |
174 | LIBICUIO= $(top_builddir)/io/$(LIBICU)io$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x | |
175 | LIBCTESTFW= $(top_builddir)/tools/ctestfw/$(LIBICU)test$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x | |
176 | LIBICUTOOLUTIL= $(top_builddir)/tools/toolutil/$(LIBICU)tu$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x | |
b75a7d8f | 177 | |
73c04bcf A |
178 | ifneq (${ICUDATA_CHAR},e) |
179 | #SH# if [ "$ICUDATA_CHAR" != "e" ]; then | |
180 | ## We're in ASCII mode. | |
181 | CFLAGS += -Wc,'ascii' | |
182 | CXXFLAGS += -Wc,'ascii' | |
183 | SO = so | |
184 | else | |
185 | #SH# else | |
186 | ## We're in EBCDIC mode. | |
187 | ## Shared object suffix | |
188 | SO = dll | |
189 | endif | |
190 | #SH# fi | |
191 | ||
b75a7d8f A |
192 | ## Special 390 rules |
193 | ||
194 | ## Build archive from object | |
195 | %.a : $(OBJECTS) | |
196 | $(AR) $(ARFLAGS) $@ $(OBJECTS) | |
197 | ||
198 | ## Compilation rules | |
199 | %.$(STATIC_O): $(srcdir)/%.c | |
200 | $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $< | |
201 | %.o: $(srcdir)/%.c | |
202 | $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $< | |
203 | ||
204 | %.$(STATIC_O): $(srcdir)/%.cpp | |
205 | $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $< | |
206 | %.o: $(srcdir)/%.cpp | |
207 | $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $< | |
208 | ||
209 | ## Dependency rules | |
210 | %.d : %.u | |
211 | @$(SHELL) -ec 'cat $< \ | |
212 | | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \ | |
213 | [ -s $@ ] || rm -f $@ ; rm -f $<' | |
214 | ||
215 | %.u : $(srcdir)/%.c | |
216 | @echo "generating dependency information for $<" | |
217 | @$(SHELL) -ec 'touch $*.u > /dev/null 2>&1' | |
218 | @$(SHELL) -ec '$(GEN_DEPS.c) -f $*.u $< > /dev/null 2>&1' | |
219 | ||
220 | %.u : $(srcdir)/%.cpp | |
221 | @echo "generating dependency information for $<" | |
222 | @$(SHELL) -ec 'touch $*.u > /dev/null 2>&1' | |
223 | @$(SHELL) -ec '$(GEN_DEPS.cc) -f $*.u $< > /dev/null 2>&1' | |
224 | ||
225 | ## Versioned libraries rules | |
226 | %$(SO_TARGET_VERSION_MAJOR).$(SO): %$(SO_TARGET_VERSION).$(SO) | |
374ca955 | 227 | $(RM) $@ && ln -s ${*F}$(SO_TARGET_VERSION).$(SO) $@ |
b75a7d8f | 228 | %.$(SO): %$(SO_TARGET_VERSION).$(SO) |
374ca955 | 229 | $(RM) $@ && ln -s ${*F}$(SO_TARGET_VERSION).$(SO) $@ |
b75a7d8f | 230 | |
374ca955 A |
231 | ## Install libraries as executable |
232 | INSTALL-L=$(INSTALL_PROGRAM) | |
233 | ||
234 | ## End 390-specific setup |