3 ## Copyright (c) 1999-2004, International Business Machines Corporation and
4 ## others. All Rights Reserved.
6 ###################################################################
8 ###################################################################
9 # Before you try to run the Makefile, make sure you have the #
10 # environment variables set. #
12 # If you are going to do the OS390BATCH build, make sure you have #
13 # the OS390BATCH environment variable set. #
15 # export OS390BATCH=1 #
17 # To build a version of ICU which uses IEEE Floating point #
21 # To build a version of ICU which uses a two common libraries #
22 # where the smaller one is loaded first. #
24 # export OS390_STUBDATA=1 #
26 # To build a version of ICU which exploits the C/C++ compiler #
27 # and runtime Extra Performance Linkage (XPLINK), specify #
29 # export OS390_XPLINK=1 #
31 ###################################################################
38 ICU_IEEE = -Wc,"float(ieee)" -DIEEE_754=1
40 ICU_IEEE = -DIEEE_754=0
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
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)\"
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
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
62 ifeq (${OS390BATCH},1)
66 # Uncomment this line or do "gmake OS390_STUBDATA=1" to enable dual common library support
70 ## Commands to generate dependency files
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
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)
84 ## Commands for shared library (dll)
88 ## Compiler switch to embed a runtime search path
91 ## Environment variable to set a runtime search path
92 LDLIBRARYPATH_ENVVAR = LIBPATH
94 ## An import library (a.k.a. sidedeck) is needed for z/OS and MSVC
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)
101 ## Versioned import library names.
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)
106 ## Shared object suffix (switch to dll for shared library build)
108 ## Non-shared intermediate object suffix
111 ifeq ($(OS390_STUBDATA),1)
112 ## Suffix of the subset data library for dual common library support
114 DEFS += -DOS390_STUBDATA
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)'"
122 BATCH_STUB_TARGET= "//'${LOADMOD}(IXMI${SO_TARGET_VERSION_MAJOR}DA)'"
123 BATCH_LIBICUDT= "//'${LOADEXP}(IXMI${SO_TARGET_VERSION_MAJOR}DA)'"
126 BATCH_COMMON_TARGET="//'${LOADMOD}(IXMI${SO_TARGET_VERSION_MAJOR}UC)'"
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)'"
132 BATCH_LIBICUUC= "//'${LOADEXP}(IXMI${SO_TARGET_VERSION_MAJOR}UC)'"
133 BATCH_LIBICUI18N= "//'${LOADEXP}(IXMI${SO_TARGET_VERSION_MAJOR}IN)'"
134 BATCH_LIBICUIO= "//'${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)'"
139 ## Link commands to link to ICU libs
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
151 ## Build archive from object
153 $(AR) $(ARFLAGS) $@ $(OBJECTS)
156 %.$(STATIC_O): $(srcdir)/%.c
157 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
159 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
161 %.$(STATIC_O): $(srcdir)/%.cpp
162 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
164 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
168 @$(SHELL) -ec 'cat $< \
169 | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
170 [ -s $@ ] || rm -f $@ ; rm -f $<'
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'
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'
182 ## Versioned libraries rules
183 %$(SO_TARGET_VERSION_MAJOR).$(SO): %$(SO_TARGET_VERSION).$(SO)
184 $(RM) $@ && ln -s ${*F}$(SO_TARGET_VERSION).$(SO) $@
185 %.$(SO): %$(SO_TARGET_VERSION).$(SO)
186 $(RM) $@ && ln -s ${*F}$(SO_TARGET_VERSION).$(SO) $@
188 ## Install libraries as executable
189 INSTALL-L=$(INSTALL_PROGRAM)
191 ## End 390-specific setup