]>
Commit | Line | Data |
---|---|---|
b75a7d8f | 1 | ## -*-makefile-*- |
73c04bcf | 2 | ## os/390, z/OS specific setup |
57a6839d | 3 | ## Copyright (c) 1999-2014, 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)' -DIEEE_754=0#M# |
57a6839d A |
46 | else |
47 | ICU_IEEE =#M# | |
b75a7d8f A |
48 | endif |
49 | ||
46f4442e | 50 | ## Additional flags when building libraries and with threads |
57a6839d | 51 | THREADSCPPFLAGS = -D_OPEN_THREADS=3 |
46f4442e | 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. |
57a6839d A |
69 | CFLAGS += -Wc,DLL,ROS,RENT,'ARCH(7)','LOC(POSIX)',NOANSIALIAS,'LANGLVL(EXTENDED)' $(ICU_IEEE) |
70 | CXXFLAGS += -Wc,DLL,ROS,RTTI,'ARCH(7)','LOC(POSIX)',NOANSIALIAS,'LANGLVL(EXTENDED)' $(ICU_IEEE) -+ | |
b75a7d8f A |
71 | ARFLAGS = -cr |
72 | ||
46f4442e A |
73 | # _MSE_PROTOS usually interacts with _XOPEN_SOURCE. It affects some standard |
74 | # C functions that use wchar_t, and it selects behavior for | |
75 | # multibyte extension support (MSE) functions. | |
76 | #DEFS += -D_MSE_PROTOS | |
77 | ||
b75a7d8f | 78 | ifeq (${OS390_XPLINK}, 1) |
73c04bcf | 79 | #SH# if [ "x$OS390_XPLINK" = "x1" ]; then |
b75a7d8f | 80 | # These lines must be the last options specified. |
46f4442e A |
81 | # GOFF is is the strategic object module format for S/390. It is required for XPLINK. |
82 | # NOTEMPINC could be used if ICU starts using templates. | |
83 | ICU_XPLINK_C = -Wc,'xplink(backchain,storeargs),goff' | |
51004dcb | 84 | ICU_XPLINK_CXX = -Wc,'xplink(backchain,storeargs),goff' -Wc,'NOTEMPINC' |
46f4442e | 85 | ICU_XPLINK_L = -Wl,xplink |
73c04bcf | 86 | #SH# fi |
b75a7d8f A |
87 | endif |
88 | ||
89 | ## OS390BATCH | |
90 | ifeq (${OS390BATCH},1) | |
73c04bcf | 91 | DEFS += -DOS390BATCH#M# |
b75a7d8f A |
92 | endif |
93 | ||
b75a7d8f A |
94 | ## Commands to generate dependency files |
95 | GEN_DEPS.c= makedep | |
96 | GEN_DEPS.cc= makedep | |
97 | ||
98 | ## Commands to compile | |
99 | # _CXX_STEPS="-1" is a prelink step when compiling C and C++, and | |
100 | # it's only needed for long function names | |
46f4442e A |
101 | COMPILE.c = $(COMPILE_LINK_ENVVAR) $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) $(ICU_XPLINK_C) -c |
102 | COMPILE.cc = $(COMPILE_LINK_ENVVAR) $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) $(ICU_XPLINK_CXX) -c | |
b75a7d8f A |
103 | |
104 | # Commands to link | |
105 | LINK.c= $(COMPILE_LINK_ENVVAR) $(CC) $(CFLAGS) -Wl,dll $(LDFLAGS) $(ICU_XPLINK_L) | |
106 | LINK.cc= $(COMPILE_LINK_ENVVAR) $(CXX) $(CXXFLAGS) -Wl,dll $(LDFLAGS) $(ICU_XPLINK_L) | |
107 | ||
108 | ## Commands for shared library (dll) | |
109 | SHLIB.c= $(LINK.c) | |
110 | SHLIB.cc= $(LINK.cc) | |
111 | ||
112 | ## Compiler switch to embed a runtime search path | |
113 | LD_RPATH= -I | |
114 | ||
115 | ## Environment variable to set a runtime search path | |
116 | LDLIBRARYPATH_ENVVAR = LIBPATH | |
117 | ||
118 | ## An import library (a.k.a. sidedeck) is needed for z/OS and MSVC | |
119 | IMPORT_LIB_EXT = .x | |
120 | ||
121 | ## Versioned target for a shared library. | |
122 | FINAL_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION).$(SO) | |
123 | MIDDLE_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO) | |
124 | ||
125 | ## Versioned import library names. | |
73c04bcf A |
126 | IMPORT_LIB = $(basename $(notdir $(SO_TARGET)))$(IMPORT_LIB_EXT)#M# |
127 | MIDDLE_IMPORT_LIB = $(basename $(notdir $(MIDDLE_SO_TARGET)))$(IMPORT_LIB_EXT)#M# | |
128 | FINAL_IMPORT_LIB = $(basename $(notdir $(FINAL_SO_TARGET)))$(IMPORT_LIB_EXT)#M# | |
b75a7d8f | 129 | |
b75a7d8f A |
130 | ## Non-shared intermediate object suffix |
131 | STATIC_O = o | |
132 | ||
133 | ifeq ($(OS390_STUBDATA),1) | |
134 | ## Suffix of the subset data library for dual common library support | |
73c04bcf A |
135 | STUB_SUFFIX=_stub#M# |
136 | DEFS += -DOS390_STUBDATA -DU_LIBICUDATA_NAME=\"$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)\"#M# | |
b75a7d8f A |
137 | endif |
138 | ||
139 | ifeq ($(OS390BATCH),1) | |
57a6839d A |
140 | ## PDS_NAME_PREFIX sets the prefix of the PDS dataset name while keeping the ICU version number. |
141 | ## To use custom names set ICU_PDS_NAME and ICU_PDS_NAME_SUFFIX | |
51004dcb A |
142 | ## IXM is used as a name prefix for XML Toolkit, default value |
143 | ifeq ($(PDS_NAME_PREFIX),) | |
144 | PDS_NAME_PREFIX= IXMI | |
145 | endif | |
57a6839d A |
146 | ifeq ($(ICU_PDS_NAME),) |
147 | PDS_FULL_NAME=${PDS_NAME_PREFIX}${SO_TARGET_VERSION_MAJOR} | |
148 | else | |
149 | PDS_FULL_NAME=${ICU_PDS_NAME} | |
150 | endif | |
b75a7d8f | 151 | ifeq ($(OS390_STUBDATA),1) |
57a6839d A |
152 | BATCH_STUB_TARGET= "//'${LOADMOD}(${PDS_FULL_NAME}D1${ICU_PDS_NAME_SUFFIX})'" |
153 | BATCH_LIBICUDT= "//'${LOADEXP}(${PDS_FULL_NAME}D1${ICU_PDS_NAME_SUFFIX})'" | |
b75a7d8f | 154 | else |
57a6839d A |
155 | BATCH_STUB_TARGET= "//'${LOADMOD}(${PDS_FULL_NAME}DA${ICU_PDS_NAME_SUFFIX})'" |
156 | BATCH_LIBICUDT= "//'${LOADEXP}(${PDS_FULL_NAME}DA${ICU_PDS_NAME_SUFFIX})'" | |
73c04bcf | 157 | PKGDATA_DEFS += -DU_LIBICUDATA_NAME=\"$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)\" |
b75a7d8f A |
158 | endif |
159 | ||
57a6839d A |
160 | BATCH_COMMON_TARGET="//'${LOADMOD}(${PDS_FULL_NAME}UC${ICU_PDS_NAME_SUFFIX})'" |
161 | BATCH_I18N_TARGET="//'${LOADMOD}(${PDS_FULL_NAME}IN${ICU_PDS_NAME_SUFFIX})'" | |
162 | BATCH_IO_TARGET="//'${LOADMOD}(${PDS_FULL_NAME}IO${ICU_PDS_NAME_SUFFIX})'" | |
163 | BATCH_LAYOUT_TARGET="//'${LOADMOD}(${PDS_FULL_NAME}LE${ICU_PDS_NAME_SUFFIX})'" | |
164 | BATCH_LAYOUTEX_TARGET="//'${LOADMOD}(${PDS_FULL_NAME}LX${ICU_PDS_NAME_SUFFIX})'" | |
165 | ||
166 | BATCH_LIBICUUC= "//'${LOADEXP}(${PDS_FULL_NAME}UC${ICU_PDS_NAME_SUFFIX})'" | |
167 | BATCH_LIBICUI18N= "//'${LOADEXP}(${PDS_FULL_NAME}IN${ICU_PDS_NAME_SUFFIX})'" | |
168 | BATCH_LIBICUIO= "//'${LOADEXP}(${PDS_FULL_NAME}IO${ICU_PDS_NAME_SUFFIX})'" | |
169 | BATCH_LIBICULE= "//'${LOADEXP}(${PDS_FULL_NAME}LE${ICU_PDS_NAME_SUFFIX})'" | |
170 | BATCH_LIBICULX= "//'${LOADEXP}(${PDS_FULL_NAME}LX${ICU_PDS_NAME_SUFFIX})'" | |
b75a7d8f A |
171 | endif |
172 | ||
51004dcb | 173 | |
b75a7d8f | 174 | ## Link commands to link to ICU libs |
374ca955 A |
175 | LIBICUDT= $(top_builddir)/stubdata/$(LIBICU)data$(ICULIBSUFFIX)$(STUB_SUFFIX)$(SO_TARGET_VERSION).x |
176 | LIBICUUC= $(top_builddir)/common/$(LIBICU)uc$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x | |
177 | LIBICUI18N= $(top_builddir)/i18n/$(LIBICU)i18n$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x | |
178 | LIBICULE= $(top_builddir)/layout/$(LIBICU)le$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x | |
179 | LIBICULX= $(top_builddir)/layoutex/$(LIBICU)lx$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x | |
180 | LIBICUIO= $(top_builddir)/io/$(LIBICU)io$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x | |
181 | LIBCTESTFW= $(top_builddir)/tools/ctestfw/$(LIBICU)test$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x | |
182 | LIBICUTOOLUTIL= $(top_builddir)/tools/toolutil/$(LIBICU)tu$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x | |
b75a7d8f | 183 | |
73c04bcf A |
184 | ifneq (${ICUDATA_CHAR},e) |
185 | #SH# if [ "$ICUDATA_CHAR" != "e" ]; then | |
186 | ## We're in ASCII mode. | |
187 | CFLAGS += -Wc,'ascii' | |
188 | CXXFLAGS += -Wc,'ascii' | |
189 | SO = so | |
190 | else | |
191 | #SH# else | |
192 | ## We're in EBCDIC mode. | |
193 | ## Shared object suffix | |
194 | SO = dll | |
195 | endif | |
196 | #SH# fi | |
197 | ||
b75a7d8f A |
198 | ## Special 390 rules |
199 | ||
200 | ## Build archive from object | |
201 | %.a : $(OBJECTS) | |
202 | $(AR) $(ARFLAGS) $@ $(OBJECTS) | |
203 | ||
204 | ## Compilation rules | |
205 | %.$(STATIC_O): $(srcdir)/%.c | |
206 | $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $< | |
207 | %.o: $(srcdir)/%.c | |
208 | $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $< | |
209 | ||
210 | %.$(STATIC_O): $(srcdir)/%.cpp | |
211 | $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $< | |
212 | %.o: $(srcdir)/%.cpp | |
213 | $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $< | |
214 | ||
215 | ## Dependency rules | |
216 | %.d : %.u | |
217 | @$(SHELL) -ec 'cat $< \ | |
218 | | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \ | |
219 | [ -s $@ ] || rm -f $@ ; rm -f $<' | |
220 | ||
221 | %.u : $(srcdir)/%.c | |
222 | @echo "generating dependency information for $<" | |
223 | @$(SHELL) -ec 'touch $*.u > /dev/null 2>&1' | |
224 | @$(SHELL) -ec '$(GEN_DEPS.c) -f $*.u $< > /dev/null 2>&1' | |
225 | ||
226 | %.u : $(srcdir)/%.cpp | |
227 | @echo "generating dependency information for $<" | |
228 | @$(SHELL) -ec 'touch $*.u > /dev/null 2>&1' | |
229 | @$(SHELL) -ec '$(GEN_DEPS.cc) -f $*.u $< > /dev/null 2>&1' | |
230 | ||
231 | ## Versioned libraries rules | |
232 | %$(SO_TARGET_VERSION_MAJOR).$(SO): %$(SO_TARGET_VERSION).$(SO) | |
374ca955 | 233 | $(RM) $@ && ln -s ${*F}$(SO_TARGET_VERSION).$(SO) $@ |
b75a7d8f | 234 | %.$(SO): %$(SO_TARGET_VERSION).$(SO) |
374ca955 | 235 | $(RM) $@ && ln -s ${*F}$(SO_TARGET_VERSION).$(SO) $@ |
b75a7d8f | 236 | |
374ca955 A |
237 | ## Install libraries as executable |
238 | INSTALL-L=$(INSTALL_PROGRAM) | |
239 | ||
240 | ## End 390-specific setup |