]> git.saurik.com Git - apple/icu.git/blob - icuSources/config/mh-os390
ICU-3.13.tar.gz
[apple/icu.git] / icuSources / config / mh-os390
1 ## -*-makefile-*-
2 ## 390-specific setup
3 ## Copyright (c) 1999-2003, International Business Machines Corporation and
4 ## others. All Rights Reserved.
5 ##
6 ## $Id: mh-os390,v 1.1.1.2 2003/07/03 18:13:33 avery Exp $
7
8 ###################################################################
9 # IMPORTANT NOTE #
10 ###################################################################
11 # Before you try to run the Makefile, make sure you have the #
12 # environment variables set. #
13 # #
14 # If you are going to do the OS390BATCH build, make sure you have #
15 # the OS390BATCH environment variable set. #
16 # #
17 # export OS390BATCH=1 #
18 # #
19 # To build a version of ICU which uses IEEE Floating point #
20 # #
21 # export IEEE390=1 #
22 # #
23 # To build a version of ICU which uses a two common libraries #
24 # where the smaller one is loaded first. #
25 # #
26 # export OS390_STUBDATA=1 #
27 # #
28 # To build a version of ICU which exploits the C/C++ compiler #
29 # and runtime Extra Performance Linkage (XPLINK), specify #
30 # #
31 # export OS390_XPLINK=1 #
32 # #
33 ###################################################################
34
35 ifeq (${IEEE390},)
36 IEEE390=1
37 endif
38
39 ifeq (${IEEE390}, 1)
40 ICU_IEEE = -Wc,"float(ieee)" -DIEEE_754=1
41 else
42 ICU_IEEE = -DIEEE_754=0
43 endif
44
45 # TODO: Consider using -Wc,roc,ros for making the data and strings readonly
46 # -Wc,"ros" seems to work, but not the "roc"
47 CFLAGS += -Wc,"langlvl(extended),spill(2000)" -Wc,"ros" $(ICU_BUILD_OPTIONS) $(ICU_IEEE) -Wc,dll,expo
48 CXXFLAGS += -Wc,"langlvl(extended),spill(2000)" -Wc,"ros" $(ICU_BUILD_OPTIONS) $(ICU_IEEE) -Wc,dll,expo
49 DEFS += -D_OPEN_THREADS -D_XOPEN_SOURCE_EXTENDED -D_MSE_PROTOS -D_SHR_TZNAME -D_SHR_TIMEZONE -DU_LIBICUDATA_NAME=\"$(ICUDATA_NAME)\"
50 ARFLAGS = -cr
51
52 # TODO: Fix this configuration so that icu-config will work!
53 # This means we shouldn't be using so many of these special case defines.
54 ifeq (${OS390_XPLINK}, 1)
55 # Note: The following options require the PTF for PQ69418 on z/OS 1.2
56 # and later.
57 # These lines must be the last options specified.
58 ICU_XPLINK_C = -Wc,"xplink(backchain,storeargs)" -Wc,"GOFF,NOCSECT,RENT,SSCOMM" -Wc,"inline(auto,noreport,500,2500)"
59 ICU_XPLINK_CPP = -Wc,"xplink(backchain,storeargs)" -Wc,"GOFF,NOCSECT,NOTEMPINC" -Wc,"inline(auto,noreport,300,2500)"
60 ICU_XPLINK_L = -Wl,dll,xplink -Wl,EDIT=NO
61 endif
62
63 ## OS390BATCH
64 ifeq (${OS390BATCH},1)
65 DEFS += -DOS390BATCH
66 endif
67
68 # Uncomment this line or do "gmake OS390_STUBDATA=1" to enable dual common library support
69 #OS390_STUBDATA=1
70
71
72 ## Commands to generate dependency files
73 GEN_DEPS.c= makedep
74 GEN_DEPS.cc= makedep
75
76 ## Commands to compile
77 # _CXX_STEPS="-1" is a prelink step when compiling C and C++, and
78 # it's only needed for long function names
79 COMPILE.c = $(COMPILE_LINK_ENVVAR) $(CXX) $(DEFS) $(CPPFLAGS) $(CFLAGS) $(ICU_XPLINK_C) -c
80 COMPILE.cc = _CXX_CXXSUFFIX="cpp" $(COMPILE_LINK_ENVVAR) $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) $(ICU_XPLINK_CPP) -c
81
82 # Commands to link
83 LINK.c= $(COMPILE_LINK_ENVVAR) $(CC) $(CFLAGS) -Wl,dll $(LDFLAGS) $(ICU_XPLINK_L)
84 LINK.cc= $(COMPILE_LINK_ENVVAR) $(CXX) $(CXXFLAGS) -Wl,dll $(LDFLAGS) $(ICU_XPLINK_L)
85
86 ## Commands for shared library (dll)
87 SHLIB.c= $(LINK.c)
88 SHLIB.cc= $(LINK.cc)
89
90 ## Compiler switch to embed a runtime search path
91 LD_RPATH= -I
92
93 ## Environment variable to set a runtime search path
94 LDLIBRARYPATH_ENVVAR = LIBPATH
95
96 ## An import library (a.k.a. sidedeck) is needed for z/OS and MSVC
97 IMPORT_LIB_EXT = .x
98
99 ## Versioned target for a shared library.
100 FINAL_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION).$(SO)
101 MIDDLE_SO_TARGET= $(basename $(SO_TARGET))$(SO_TARGET_VERSION_MAJOR).$(SO)
102
103 ## Versioned import library names.
104 IMPORT_LIB = $(basename $(SO_TARGET))$(IMPORT_LIB_EXT)
105 MIDDLE_IMPORT_LIB = $(basename $(MIDDLE_SO_TARGET))$(IMPORT_LIB_EXT)
106 FINAL_IMPORT_LIB = $(basename $(FINAL_SO_TARGET))$(IMPORT_LIB_EXT)
107
108 ## Shared object suffix (switch to dll for shared library build)
109 SO = dll
110 ## Non-shared intermediate object suffix
111 STATIC_O = o
112
113 ifeq ($(OS390_STUBDATA),1)
114 ## Suffix of the subset data library for dual common library support
115 STUB_SUFFIX=_stub
116 DEFS += -DOS390_STUBDATA
117 endif
118
119 ifeq ($(OS390BATCH),1)
120 ifeq ($(OS390_STUBDATA),1)
121 BATCH_STUB_TARGET= "//'${LOADMOD}(IXMI${SO_TARGET_VERSION_MAJOR}D1)'"
122 BATCH_LIBICUDT= "//'${LOADEXP}(IXMI${SO_TARGET_VERSION_MAJOR}D1)'"
123 else
124 BATCH_STUB_TARGET= "//'${LOADMOD}(IXMI${SO_TARGET_VERSION_MAJOR}DA)'"
125 BATCH_LIBICUDT= "//'${LOADEXP}(IXMI${SO_TARGET_VERSION_MAJOR}DA)'"
126 endif
127
128 BATCH_COMMON_TARGET="//'${LOADMOD}(IXMI${SO_TARGET_VERSION_MAJOR}UC)'"
129 BATCH_I18N_TARGET= "//'${LOADMOD}(IXMI${SO_TARGET_VERSION_MAJOR}IN)'"
130 BATCH_USTDIO_TARGET="//'${LOADMOD}(IXMI${SO_TARGET_VERSION_MAJOR}IO)'"
131
132 BATCH_LIBICUUC= "//'${LOADEXP}(IXMI${SO_TARGET_VERSION_MAJOR}UC)'"
133 BATCH_LIBICUI18N= "//'${LOADEXP}(IXMI${SO_TARGET_VERSION_MAJOR}IN)'"
134 BATCH_LIBICUSTDIO= "//'${LOADEXP}(IXMI${SO_TARGET_VERSION_MAJOR}IO)'"
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
140 LIBICUDT= $(top_builddir)/stubdata/lib$(ICUPREFIX)data$(ICULIBSUFFIX)$(STUB_SUFFIX)$(SO_TARGET_VERSION).x
141 LIBICUUC= $(top_builddir)/common/lib$(ICUPREFIX)uc$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
142 LIBICUI18N= $(top_builddir)/i18n/lib$(ICUPREFIX)i18n$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
143 LIBICULE= $(top_builddir)/layout/lib$(ICUPREFIX)le$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
144 LIBICULX= $(top_builddir)/layoutex/lib$(ICUPREFIX)lx$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
145 LIBCTESTFW= $(top_builddir)/tools/ctestfw/lib$(ICUPREFIX)ctestfw$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
146 LIBICUTOOLUTIL= $(top_builddir)/tools/toolutil/lib$(ICUPREFIX)toolutil$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
147 LIBUSTDIO= $(top_builddir)/extra/ustdio/libicuio$(ICULIBSUFFIX)$(SO_TARGET_VERSION).x
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)
184 $(RM) $@ && ln -s $*$(SO_TARGET_VERSION).$(SO) $@
185 %.$(SO): %$(SO_TARGET_VERSION).$(SO)
186 $(RM) $@ && ln -s $*$(SO_TARGET_VERSION).$(SO) $@
187
188 ## End 390-specific setup