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