]>
Commit | Line | Data |
---|---|---|
b75a7d8f | 1 | ## -*-makefile-*- |
f3c0d7a5 A |
2 | ## Copyright (C) 2016 and later: Unicode, Inc. and others. |
3 | ## License & terms of use: http://www.unicode.org/copyright.html | |
b75a7d8f | 4 | ## OS400-specific setup (for cross build) |
57a6839d | 5 | ## Copyright (c) 1999-2013, International Business Machines Corporation and |
b75a7d8f | 6 | ## others. All Rights Reserved. |
b75a7d8f | 7 | |
51004dcb A |
8 | # This otherwise breaks on OS400 - can't find "shell" |
9 | CURR_FULL_DIR=. | |
10 | CURR_SRCCODE_FULL_DIR=. | |
11 | ||
b75a7d8f A |
12 | GEN_DEPS.c= $(CC1) -E -M $(DEFS) $(CPPFLAGS) |
13 | GEN_DEPS.cc= $(CXX1) -E -M $(DEFS) $(CPPFLAGS) | |
14 | ||
374ca955 | 15 | THREADSCPPFLAGS = -D_MULTI_THREADED |
b75a7d8f | 16 | |
57a6839d A |
17 | # put this in the environment to get threading |
18 | THREADSENVFLAGS = QIBM_MULTI_THREADED=Y ; | |
19 | ||
b75a7d8f | 20 | ## Commands to compile |
374ca955 A |
21 | # -qTERASPACE: large pointers |
22 | # -qPFROPT=*STRDONLY: Strings are read-only | |
b75a7d8f | 23 | COMPILE.c= $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) -c -qTERASPACE=*YES -qSTGMDL=*INHERIT -qPFROPT=*STRDONLY |
4388f060 A |
24 | COMPILE.cc= $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) -c -qTERASPACE=*YES -qSTGMDL=*INHERIT -qPFROPT=*STRDONLY -qRTTIALL |
25 | ||
26 | ## ICULD program - run bldiculd.sh in icu/as_is/os400/ to build it | |
27 | ICULD=/qsys.lib/$(OUTPUTDIR).lib/iculd.pgm | |
b75a7d8f A |
28 | |
29 | ## Commands to link | |
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) | |
4388f060 A |
32 | LINK.c= $(ICULD) $(CXXFLAGS) $(LDFLAGS) -qOPTION='*DUPPROC *DUPVAR' |
33 | LINK.cc= $(ICULD) $(CXXFLAGS) $(LDFLAGS) -qOPTION='*DUPPROC *DUPVAR' | |
b75a7d8f A |
34 | |
35 | ## Commands to make a shared library | |
374ca955 A |
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 | |
b75a7d8f A |
42 | AR = qar |
43 | ARFLAGS = -cuv | |
44 | ||
45 | ## Compiler switch to embed a runtime search path | |
46 | LD_RPATH= -I | |
47 | LD_RPATH_PRE= -I | |
48 | ||
374ca955 A |
49 | ## Make target to rebind the common library |
50 | ## to the actual data versus the stub data | |
51 | POST_DATA_BUILD = os400-data-rebind | |
52 | ||
53 | # The stubdata directory is the same directory as the normal data library. | |
54 | STUBDATA_LIBDIR = $(LIBDIR)/ | |
55 | ||
b75a7d8f A |
56 | ## Versioned target for a shared library. |
57 | FINAL_SO_TARGET = $(SO_TARGET) | |
58 | MIDDLE_SO_TARGET = | |
59 | ||
374ca955 A |
60 | # this one is for icudefs.mk's use |
61 | ifeq ($(ENABLE_SHARED),YES) | |
62 | SO_TARGET_VERSION_SUFFIX = $(SO_TARGET_VERSION_MAJOR) | |
63 | endif | |
64 | ||
65 | # this one is for the individual make files and linking | |
66 | ICULIBSUFFIX = $(SO_TARGET_VERSION_SUFFIX) | |
67 | ||
b75a7d8f A |
68 | ## object suffix |
69 | TO= o | |
70 | ||
71 | ## Shared object suffix | |
72 | SO= so | |
73 | ## Non-shared intermediate object suffix | |
74 | STATIC_O = o | |
75 | ||
76 | ## Platform command to remove or move executable target | |
77 | RMV = del | |
78 | ## Platform commands to remove or move executable and library targets | |
79 | INSTALL-S = cp -fph | |
80 | INSTALL-L = $(INSTALL-S) | |
81 | ||
374ca955 A |
82 | # Stub name overrides for iSeries |
83 | DATA_STUBNAME = dt | |
84 | I18N_STUBNAME = in | |
85 | CTESTFW_STUBNAME = tf | |
86 | ||
b75a7d8f | 87 | ## Link commands to link to ICU service programs |
374ca955 A |
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) | |
b75a7d8f A |
96 | |
97 | ## Special OS400 rules | |
98 | ||
99 | ## Build archive from shared object | |
100 | %.a : %.o | |
101 | $(AR) $(ARFLAGS) $@ $< | |
102 | ||
103 | ## Build import list from export list | |
104 | %.e : %.exp | |
105 | @echo "Building an import list for $<" | |
106 | @$(SHELL) -ec "echo '#! $*.a($*.so)' | cat - $< > $@" | |
107 | ||
108 | ## Compilation rules | |
109 | %.$(STATIC_O): $(srcdir)/%.c | |
110 | $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $< | |
111 | %.o: $(srcdir)/%.c | |
112 | $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $< | |
113 | ||
114 | %.$(STATIC_O): $(srcdir)/%.cpp | |
115 | $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $< | |
116 | %.o: $(srcdir)/%.cpp | |
117 | $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $< | |
118 | ||
119 | %.qwobj : $(srcdir)/%.c | |
120 | $(COMPILE.c) -o $@ $< | |
121 | ||
122 | %.qwobj : $(srcdir)/%.cpp | |
123 | $(COMPILE.cc) -o $@ $< | |
124 | ||
125 | ## Dependency rules | |
126 | %.d : %.u | |
127 | # @$(SHELL) -ec 'cat $< \ | |
128 | # | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \ | |
129 | # [ -s $@ ] || rm -f $@ ; rm -f $<' | |
130 | ||
131 | %.u : $(srcdir)/%.c | |
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' | |
135 | ||
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' | |
140 | ||
141 | ## End OS400-specific setup |