]>
Commit | Line | Data |
---|---|---|
b75a7d8f A |
1 | ## -*-makefile-*- |
2 | ## 390-specific setup | |
374ca955 | 3 | ## Copyright (c) 1999-2004, 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 | # # | |
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 | ifeq (${IEEE390},) | |
34 | IEEE390=1 | |
35 | endif | |
36 | ||
37 | ifeq (${IEEE390}, 1) | |
38 | ICU_IEEE = -Wc,"float(ieee)" -DIEEE_754=1 | |
39 | else | |
40 | ICU_IEEE = -DIEEE_754=0 | |
41 | endif | |
42 | ||
43 | # TODO: Consider using -Wc,roc,ros for making the data and strings readonly | |
44 | # -Wc,"ros" seems to work, but not the "roc" | |
45 | CFLAGS += -Wc,"langlvl(extended),spill(2000)" -Wc,"ros" $(ICU_BUILD_OPTIONS) $(ICU_IEEE) -Wc,dll,expo | |
46 | CXXFLAGS += -Wc,"langlvl(extended),spill(2000)" -Wc,"ros" $(ICU_BUILD_OPTIONS) $(ICU_IEEE) -Wc,dll,expo | |
374ca955 | 47 | DEFS += -D_OPEN_THREADS -D_XOPEN_SOURCE_EXTENDED -D_MSE_PROTOS -D_SHR_TZNAME -D_SHR_TIMEZONE -DU_LIBICUDATA_NAME=\"$(ICUPREFIX)$(DATA_STUBNAME)$(ICULIBSUFFIX)\" |
b75a7d8f A |
48 | ARFLAGS = -cr |
49 | ||
50 | # TODO: Fix this configuration so that icu-config will work! | |
51 | # This means we shouldn't be using so many of these special case defines. | |
52 | ifeq (${OS390_XPLINK}, 1) | |
53 | # Note: The following options require the PTF for PQ69418 on z/OS 1.2 | |
54 | # and later. | |
55 | # These lines must be the last options specified. | |
56 | ICU_XPLINK_C = -Wc,"xplink(backchain,storeargs)" -Wc,"GOFF,NOCSECT,RENT,SSCOMM" -Wc,"inline(auto,noreport,500,2500)" | |
57 | ICU_XPLINK_CPP = -Wc,"xplink(backchain,storeargs)" -Wc,"GOFF,NOCSECT,NOTEMPINC" -Wc,"inline(auto,noreport,300,2500)" | |
58 | ICU_XPLINK_L = -Wl,dll,xplink -Wl,EDIT=NO | |
59 | endif | |
60 | ||
61 | ## OS390BATCH | |
62 | ifeq (${OS390BATCH},1) | |
63 | DEFS += -DOS390BATCH | |
64 | endif | |
65 | ||
66 | # Uncomment this line or do "gmake OS390_STUBDATA=1" to enable dual common library support | |
67 | #OS390_STUBDATA=1 | |
68 | ||
69 | ||
70 | ## Commands to generate dependency files | |
71 | GEN_DEPS.c= makedep | |
72 | GEN_DEPS.cc= makedep | |
73 | ||
74 | ## Commands to compile | |
75 | # _CXX_STEPS="-1" is a prelink step when compiling C and C++, and | |
76 | # it's only needed for long function names | |
77 | COMPILE.c = $(COMPILE_LINK_ENVVAR) $(CXX) $(DEFS) $(CPPFLAGS) $(CFLAGS) $(ICU_XPLINK_C) -c | |
78 | COMPILE.cc = _CXX_CXXSUFFIX="cpp" $(COMPILE_LINK_ENVVAR) $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) $(ICU_XPLINK_CPP) -c | |
79 | ||
80 | # Commands to link | |
81 | LINK.c= $(COMPILE_LINK_ENVVAR) $(CC) $(CFLAGS) -Wl,dll $(LDFLAGS) $(ICU_XPLINK_L) | |
82 | LINK.cc= $(COMPILE_LINK_ENVVAR) $(CXX) $(CXXFLAGS) -Wl,dll $(LDFLAGS) $(ICU_XPLINK_L) | |
83 | ||
84 | ## Commands for shared library (dll) | |
85 | SHLIB.c= $(LINK.c) | |
86 | SHLIB.cc= $(LINK.cc) | |
87 | ||
88 | ## Compiler switch to embed a runtime search path | |
89 | LD_RPATH= -I | |
90 | ||
91 | ## Environment variable to set a runtime search path | |
92 | LDLIBRARYPATH_ENVVAR = LIBPATH | |
93 | ||
94 | ## An import library (a.k.a. sidedeck) is needed for z/OS and MSVC | |
95 | IMPORT_LIB_EXT = .x | |
96 | ||
97 | ## Versioned target for a shared library. | |
98 | FINAL_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION).$(SO) | |
99 | MIDDLE_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO) | |
100 | ||
101 | ## Versioned import library names. | |
374ca955 A |
102 | IMPORT_LIB = $(basename $(notdir $(SO_TARGET)))$(IMPORT_LIB_EXT) |
103 | MIDDLE_IMPORT_LIB = $(basename $(notdir $(MIDDLE_SO_TARGET)))$(IMPORT_LIB_EXT) | |
104 | FINAL_IMPORT_LIB = $(basename $(notdir $(FINAL_SO_TARGET)))$(IMPORT_LIB_EXT) | |
b75a7d8f A |
105 | |
106 | ## Shared object suffix (switch to dll for shared library build) | |
107 | SO = dll | |
108 | ## Non-shared intermediate object suffix | |
109 | STATIC_O = o | |
110 | ||
111 | ifeq ($(OS390_STUBDATA),1) | |
112 | ## Suffix of the subset data library for dual common library support | |
113 | STUB_SUFFIX=_stub | |
114 | DEFS += -DOS390_STUBDATA | |
115 | endif | |
116 | ||
117 | ifeq ($(OS390BATCH),1) | |
118 | ifeq ($(OS390_STUBDATA),1) | |
119 | BATCH_STUB_TARGET= "//'${LOADMOD}(IXMI${SO_TARGET_VERSION_MAJOR}D1)'" | |
120 | BATCH_LIBICUDT= "//'${LOADEXP}(IXMI${SO_TARGET_VERSION_MAJOR}D1)'" | |
121 | else | |
122 | BATCH_STUB_TARGET= "//'${LOADMOD}(IXMI${SO_TARGET_VERSION_MAJOR}DA)'" | |
123 | BATCH_LIBICUDT= "//'${LOADEXP}(IXMI${SO_TARGET_VERSION_MAJOR}DA)'" | |
124 | endif | |
125 | ||
126 | BATCH_COMMON_TARGET="//'${LOADMOD}(IXMI${SO_TARGET_VERSION_MAJOR}UC)'" | |
374ca955 A |
127 | BATCH_I18N_TARGET="//'${LOADMOD}(IXMI${SO_TARGET_VERSION_MAJOR}IN)'" |
128 | BATCH_IO_TARGET="//'${LOADMOD}(IXMI${SO_TARGET_VERSION_MAJOR}IO)'" | |
129 | BATCH_LAYOUT_TARGET="//'${LOADMOD}(IXMI${SO_TARGET_VERSION_MAJOR}LE)'" | |
130 | BATCH_LAYOUTEX_TARGET="//'${LOADMOD}(IXMI${SO_TARGET_VERSION_MAJOR}LX)'" | |
b75a7d8f A |
131 | |
132 | BATCH_LIBICUUC= "//'${LOADEXP}(IXMI${SO_TARGET_VERSION_MAJOR}UC)'" | |
133 | BATCH_LIBICUI18N= "//'${LOADEXP}(IXMI${SO_TARGET_VERSION_MAJOR}IN)'" | |
374ca955 | 134 | BATCH_LIBICUIO= "//'${LOADEXP}(IXMI${SO_TARGET_VERSION_MAJOR}IO)'" |
b75a7d8f A |
135 | BATCH_LIBICULE= "//'${LOADEXP}(IXMI${SO_TARGET_VERSION_MAJOR}LE)'" |
136 | BATCH_LIBICULX= "//'${LOADEXP}(IXMI${SO_TARGET_VERSION_MAJOR}LX)'" | |
137 | endif | |
138 | ||
139 | ## Link commands to link to ICU libs | |
374ca955 A |
140 | LIBICUDT= $(top_builddir)/stubdata/$(LIBICU)data$(ICULIBSUFFIX)$(STUB_SUFFIX)$(SO_TARGET_VERSION).x |
141 | LIBICUUC= $(top_builddir)/common/$(LIBICU)uc$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x | |
142 | LIBICUI18N= $(top_builddir)/i18n/$(LIBICU)i18n$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x | |
143 | LIBICULE= $(top_builddir)/layout/$(LIBICU)le$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x | |
144 | LIBICULX= $(top_builddir)/layoutex/$(LIBICU)lx$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x | |
145 | LIBICUIO= $(top_builddir)/io/$(LIBICU)io$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x | |
146 | LIBCTESTFW= $(top_builddir)/tools/ctestfw/$(LIBICU)test$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x | |
147 | LIBICUTOOLUTIL= $(top_builddir)/tools/toolutil/$(LIBICU)tu$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x | |
b75a7d8f A |
148 | |
149 | ## Special 390 rules | |
150 | ||
151 | ## Build archive from object | |
152 | %.a : $(OBJECTS) | |
153 | $(AR) $(ARFLAGS) $@ $(OBJECTS) | |
154 | ||
155 | ## Compilation rules | |
156 | %.$(STATIC_O): $(srcdir)/%.c | |
157 | $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $< | |
158 | %.o: $(srcdir)/%.c | |
159 | $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $< | |
160 | ||
161 | %.$(STATIC_O): $(srcdir)/%.cpp | |
162 | $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $< | |
163 | %.o: $(srcdir)/%.cpp | |
164 | $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $< | |
165 | ||
166 | ## Dependency rules | |
167 | %.d : %.u | |
168 | @$(SHELL) -ec 'cat $< \ | |
169 | | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \ | |
170 | [ -s $@ ] || rm -f $@ ; rm -f $<' | |
171 | ||
172 | %.u : $(srcdir)/%.c | |
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' | |
176 | ||
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' | |
181 | ||
182 | ## Versioned libraries rules | |
183 | %$(SO_TARGET_VERSION_MAJOR).$(SO): %$(SO_TARGET_VERSION).$(SO) | |
374ca955 | 184 | $(RM) $@ && ln -s ${*F}$(SO_TARGET_VERSION).$(SO) $@ |
b75a7d8f | 185 | %.$(SO): %$(SO_TARGET_VERSION).$(SO) |
374ca955 | 186 | $(RM) $@ && ln -s ${*F}$(SO_TARGET_VERSION).$(SO) $@ |
b75a7d8f | 187 | |
374ca955 A |
188 | ## Install libraries as executable |
189 | INSTALL-L=$(INSTALL_PROGRAM) | |
190 | ||
191 | ## End 390-specific setup |