2 ## OS400-specific setup (for cross build)
3 ## Copyright (c) 1999-2012, International Business Machines Corporation and
4 ## others. All Rights Reserved.
6 # This otherwise breaks on OS400 - can't find "shell"
8 CURR_SRCCODE_FULL_DIR=.
10 GEN_DEPS.c= $(CC1) -E -M $(DEFS) $(CPPFLAGS)
11 GEN_DEPS.cc= $(CXX1) -E -M $(DEFS) $(CPPFLAGS)
13 THREADSCPPFLAGS = -D_MULTI_THREADED
15 ## Commands to compile
16 # -qTERASPACE: large pointers
17 # -qPFROPT=*STRDONLY: Strings are read-only
18 COMPILE.c= $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) -c -qTERASPACE=*YES -qSTGMDL=*INHERIT -qPFROPT=*STRDONLY
19 COMPILE.cc= $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) -c -qTERASPACE=*YES -qSTGMDL=*INHERIT -qPFROPT=*STRDONLY -qRTTIALL
21 ## ICULD program - run bldiculd.sh in icu/as_is/os400/ to build it
22 ICULD=/qsys.lib/$(OUTPUTDIR).lib/iculd.pgm
25 ## We need to use the C++ linker, even when linking C programs, since
26 ## our libraries contain C++ code (C++ static init not called)
27 LINK.c= $(ICULD) $(CXXFLAGS) $(LDFLAGS) -qOPTION='*DUPPROC *DUPVAR'
28 LINK.cc= $(ICULD) $(CXXFLAGS) $(LDFLAGS) -qOPTION='*DUPPROC *DUPVAR'
30 ## Commands to make a shared library
31 # -qALWLIBUPD: It allows the compiled service program to have dependencies on
32 # service programs in a different library than that specified originally
33 # by CRTSRVPGM after having used the UPDSRVPGM command.
34 # Similar to -fPIC and -install_name on other compilers, but different.
35 SHLIB.c= ld -v -qOPTION='*DUPPROC *DUPVAR' -qALWLIBUPD=*YES
36 SHLIB.cc= ld -v -qOPTION='*DUPPROC *DUPVAR' -qALWLIBUPD=*YES
40 ## Compiler switch to embed a runtime search path
44 ## Make target to rebind the common library
45 ## to the actual data versus the stub data
46 POST_DATA_BUILD = os400-data-rebind
48 # The stubdata directory is the same directory as the normal data library.
49 STUBDATA_LIBDIR = $(LIBDIR)/
51 ## Versioned target for a shared library.
52 FINAL_SO_TARGET = $(SO_TARGET)
55 # this one is for icudefs.mk's use
56 ifeq ($(ENABLE_SHARED),YES)
57 SO_TARGET_VERSION_SUFFIX = $(SO_TARGET_VERSION_MAJOR)
60 # this one is for the individual make files and linking
61 ICULIBSUFFIX = $(SO_TARGET_VERSION_SUFFIX)
66 ## Shared object suffix
68 ## Non-shared intermediate object suffix
71 ## Platform command to remove or move executable target
73 ## Platform commands to remove or move executable and library targets
75 INSTALL-L = $(INSTALL-S)
77 # Stub name overrides for iSeries
82 ## Link commands to link to ICU service programs
83 LIBICUDT = $(LIBDIR)/$(LIBICU)$(DATA_STUBNAME)$(ICULIBSUFFIX).$(SO)
84 LIBICUUC = $(LIBDIR)/$(LIBICU)$(COMMON_STUBNAME)$(ICULIBSUFFIX).$(SO)
85 LIBICUI18N = $(LIBDIR)/$(LIBICU)$(I18N_STUBNAME)$(ICULIBSUFFIX).$(SO)
86 LIBICULE = $(LIBDIR)/$(LIBICU)$(LAYOUT_STUBNAME)$(ICULIBSUFFIX).$(SO)
87 LIBICULX = $(LIBDIR)/$(LIBICU)$(LAYOUTEX_STUBNAME)$(ICULIBSUFFIX).$(SO)
88 LIBCTESTFW = $(top_builddir)/tools/ctestfw/$(LIBICU)$(CTESTFW_STUBNAME)$(ICULIBSUFFIX).$(SO)
89 LIBICUTOOLUTIL = $(LIBDIR)/$(LIBICU)$(TOOLUTIL_STUBNAME)$(ICULIBSUFFIX).$(SO)
90 LIBICUIO= $(LIBDIR)/$(LIBICU)$(IO_STUBNAME)$(ICULIBSUFFIX).$(SO)
92 ## Special OS400 rules
94 ## Build archive from shared object
96 $(AR) $(ARFLAGS) $@ $<
98 ## Build import list from export list
100 @echo "Building an import list for $<"
101 @$(SHELL) -ec "echo '#! $*.a($*.so)' | cat - $< > $@"
104 %.$(STATIC_O): $(srcdir)/%.c
105 $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $<
107 $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $<
109 %.$(STATIC_O): $(srcdir)/%.cpp
110 $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $<
112 $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $<
114 %.qwobj : $(srcdir)/%.c
115 $(COMPILE.c) -o $@ $<
117 %.qwobj : $(srcdir)/%.cpp
118 $(COMPILE.cc) -o $@ $<
122 # @$(SHELL) -ec 'cat $< \
123 # | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \
124 # [ -s $@ ] || rm -f $@ ; rm -f $<'
127 @echo "generating dependency information for $<"
128 # @$(SHELL) -ec 'touch $*.u > /dev/null 2>&1'
129 # @$(SHELL) -ec '$(GEN_DEPS.c) -f $*.u $< > /dev/null 2>&1'
131 %.u : $(srcdir)/%.cpp
132 @echo "generating dependency information for $<"
133 # @$(SHELL) -ec 'touch $*.u > /dev/null 2>&1'
134 # @$(SHELL) -ec '$(GEN_DEPS.cc) -f $*.u $< > /dev/null 2>&1'
136 ## End OS400-specific setup