]>
Commit | Line | Data |
---|---|---|
1 | ## -*-makefile-*- | |
2 | ## os/390, z/OS specific setup | |
3 | ## Copyright (c) 1999-2006, International Business Machines Corporation and | |
4 | ## others. All Rights Reserved. | |
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 | # # | |
17 | # To build a version of ICU which uses IEEE Floating point # | |
18 | # # | |
19 | # export IEEE390=1 # | |
20 | # # | |
21 | # To build a version of ICU which uses a two common libraries # | |
22 | # where the smaller one is loaded first. # | |
23 | # # | |
24 | # export OS390_STUBDATA=1 # | |
25 | # # | |
26 | # To build a version of ICU which exploits the C/C++ compiler # | |
27 | # and runtime Extra Performance Linkage (XPLINK), specify # | |
28 | # # | |
29 | # export OS390_XPLINK=1 # | |
30 | # # | |
31 | ################################################################### | |
32 | ||
33 | # TODO: Fix this configuration so that icu-config will work! | |
34 | # If statements don't work well when icu-config is generated. | |
35 | ifeq (${IEEE390},) | |
36 | IEEE390=1#M# | |
37 | endif | |
38 | ||
39 | ifeq (${IEEE390}, 1) | |
40 | ICU_IEEE = -Wc,'float(ieee)' | |
41 | else | |
42 | ICU_IEEE = -DIEEE_754=0#M# | |
43 | endif | |
44 | ||
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 | |
48 | ||
49 | ## Additional flags when building libraries and with threads | |
50 | THREADSCPPFLAGS = -D_OPEN_THREADS | |
51 | ||
52 | # -Wc,expo is used to export all functions | |
53 | SHAREDLIBCFLAGS = -Wc,expo | |
54 | SHAREDLIBCXXFLAGS = -Wc,expo | |
55 | ||
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 | |
62 | ARFLAGS = -cr | |
63 | ||
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 | |
67 | # and later. | |
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 | |
72 | #SH# fi | |
73 | endif | |
74 | ||
75 | ## OS390BATCH | |
76 | ifeq (${OS390BATCH},1) | |
77 | DEFS += -DOS390BATCH#M# | |
78 | endif | |
79 | ||
80 | ## Commands to generate dependency files | |
81 | GEN_DEPS.c= makedep | |
82 | GEN_DEPS.cc= makedep | |
83 | ||
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 | |
89 | ||
90 | # Commands to link | |
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) | |
93 | ||
94 | ## Commands for shared library (dll) | |
95 | SHLIB.c= $(LINK.c) | |
96 | SHLIB.cc= $(LINK.cc) | |
97 | ||
98 | ## Compiler switch to embed a runtime search path | |
99 | LD_RPATH= -I | |
100 | ||
101 | ## Environment variable to set a runtime search path | |
102 | LDLIBRARYPATH_ENVVAR = LIBPATH | |
103 | ||
104 | ## An import library (a.k.a. sidedeck) is needed for z/OS and MSVC | |
105 | IMPORT_LIB_EXT = .x | |
106 | ||
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) | |
110 | ||
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# | |
115 | ||
116 | ## Non-shared intermediate object suffix | |
117 | STATIC_O = o | |
118 | ||
119 | ifeq ($(OS390_STUBDATA),1) | |
120 | ## Suffix of the subset data library for dual common library support | |
121 | STUB_SUFFIX=_stub#M# | |
122 | DEFS += -DOS390_STUBDATA -DU_LIBICUDATA_NAME=\"$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)\"#M# | |
123 | endif | |
124 | ||
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)'" | |
129 | else | |
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)\" | |
133 | endif | |
134 | ||
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)'" | |
140 | ||
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)'" | |
146 | endif | |
147 | ||
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 | |
157 | ||
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' | |
163 | SO = so | |
164 | else | |
165 | #SH# else | |
166 | ## We're in EBCDIC mode. | |
167 | ## Shared object suffix | |
168 | SO = dll | |
169 | endif | |
170 | #SH# fi | |
171 | ||
172 | ## Special 390 rules | |
173 | ||
174 | ## Build archive from object | |
175 | %.a : $(OBJECTS) | |
176 | $(AR) $(ARFLAGS) $@ $(OBJECTS) | |
177 | ||
178 | ## Compilation rules | |
179 | %.$(STATIC_O): $(srcdir)/%.c | |
180 | $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $< | |
181 | %.o: $(srcdir)/%.c | |
182 | $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $< | |
183 | ||
184 | %.$(STATIC_O): $(srcdir)/%.cpp | |
185 | $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $< | |
186 | %.o: $(srcdir)/%.cpp | |
187 | $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $< | |
188 | ||
189 | ## Dependency rules | |
190 | %.d : %.u | |
191 | @$(SHELL) -ec 'cat $< \ | |
192 | | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \ | |
193 | [ -s $@ ] || rm -f $@ ; rm -f $<' | |
194 | ||
195 | %.u : $(srcdir)/%.c | |
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' | |
199 | ||
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' | |
204 | ||
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) $@ | |
210 | ||
211 | ## Install libraries as executable | |
212 | INSTALL-L=$(INSTALL_PROGRAM) | |
213 | ||
214 | ## End 390-specific setup |