]>
Commit | Line | Data |
---|---|---|
1 | ## -*-makefile-*- | |
2 | ## OS400-specific setup (for cross build) | |
3 | ## Copyright (c) 1999-2004, International Business Machines Corporation and | |
4 | ## others. All Rights Reserved. | |
5 | ||
6 | GEN_DEPS.c= $(CC1) -E -M $(DEFS) $(CPPFLAGS) | |
7 | GEN_DEPS.cc= $(CXX1) -E -M $(DEFS) $(CPPFLAGS) | |
8 | ||
9 | DEFS+=-DOS400 | |
10 | THREADSCPPFLAGS = -D_MULTI_THREADED | |
11 | ||
12 | ## Commands to compile | |
13 | # -qTERASPACE: large pointers | |
14 | # -qPFROPT=*STRDONLY: Strings are read-only | |
15 | COMPILE.c= $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) -c -qTERASPACE=*YES -qSTGMDL=*INHERIT -qPFROPT=*STRDONLY | |
16 | COMPILE.cc= $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) -c -qTERASPACE=*YES -qSTGMDL=*INHERIT -qPFROPT=*STRDONLY | |
17 | ||
18 | ## Commands to link | |
19 | ## We need to use the C++ linker, even when linking C programs, since | |
20 | ## our libraries contain C++ code (C++ static init not called) | |
21 | LINK.c= $(CXX) $(CXXFLAGS) $(LDFLAGS) -qOPTION='*DUPPROC *DUPVAR' | |
22 | LINK.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) -qOPTION='*DUPPROC *DUPVAR' | |
23 | ||
24 | ## Commands to make a shared library | |
25 | # -qALWLIBUPD: It allows the compiled service program to have dependencies on | |
26 | # service programs in a different library than that specified originally | |
27 | # by CRTSRVPGM after having used the UPDSRVPGM command. | |
28 | # Similar to -fPIC and -install_name on other compilers, but different. | |
29 | SHLIB.c= ld -v -qOPTION='*DUPPROC *DUPVAR' -qALWLIBUPD=*YES | |
30 | SHLIB.cc= ld -v -qOPTION='*DUPPROC *DUPVAR' -qALWLIBUPD=*YES | |
31 | AR = qar | |
32 | ARFLAGS = -cuv | |
33 | ||
34 | ## Compiler switch to embed a runtime search path | |
35 | LD_RPATH= -I | |
36 | LD_RPATH_PRE= -I | |
37 | ||
38 | ## Make target to rebind the common library | |
39 | ## to the actual data versus the stub data | |
40 | POST_DATA_BUILD = os400-data-rebind | |
41 | ||
42 | # The stubdata directory is the same directory as the normal data library. | |
43 | STUBDATA_LIBDIR = $(LIBDIR)/ | |
44 | ||
45 | ## Versioned target for a shared library. | |
46 | FINAL_SO_TARGET = $(SO_TARGET) | |
47 | MIDDLE_SO_TARGET = | |
48 | ||
49 | # this one is for icudefs.mk's use | |
50 | ifeq ($(ENABLE_SHARED),YES) | |
51 | SO_TARGET_VERSION_SUFFIX = $(SO_TARGET_VERSION_MAJOR) | |
52 | endif | |
53 | ||
54 | # this one is for the individual make files and linking | |
55 | ICULIBSUFFIX = $(SO_TARGET_VERSION_SUFFIX) | |
56 | ||
57 | ## object suffix | |
58 | TO= o | |
59 | ||
60 | ## Shared object suffix | |
61 | SO= so | |
62 | ## Non-shared intermediate object suffix | |
63 | STATIC_O = o | |
64 | ||
65 | ## Platform command to remove or move executable target | |
66 | RMV = del | |
67 | ## Platform commands to remove or move executable and library targets | |
68 | INSTALL-S = cp -fph | |
69 | INSTALL-L = $(INSTALL-S) | |
70 | ||
71 | # Stub name overrides for iSeries | |
72 | DATA_STUBNAME = dt | |
73 | I18N_STUBNAME = in | |
74 | CTESTFW_STUBNAME = tf | |
75 | ||
76 | ## Link commands to link to ICU service programs | |
77 | LIBICUDT = $(LIBDIR)/$(LIBICU)$(DATA_STUBNAME)$(ICULIBSUFFIX).$(SO) | |
78 | LIBICUUC = $(LIBDIR)/$(LIBICU)$(COMMON_STUBNAME)$(ICULIBSUFFIX).$(SO) | |
79 | LIBICUI18N = $(LIBDIR)/$(LIBICU)$(I18N_STUBNAME)$(ICULIBSUFFIX).$(SO) | |
80 | LIBICULE = $(LIBDIR)/$(LIBICU)$(LAYOUT_STUBNAME)$(ICULIBSUFFIX).$(SO) | |
81 | LIBICULX = $(LIBDIR)/$(LIBICU)$(LAYOUTEX_STUBNAME)$(ICULIBSUFFIX).$(SO) | |
82 | LIBCTESTFW = $(top_builddir)/tools/ctestfw/$(LIBICU)$(CTESTFW_STUBNAME)$(ICULIBSUFFIX).$(SO) | |
83 | LIBICUTOOLUTIL = $(LIBDIR)/$(LIBICU)$(TOOLUTIL_STUBNAME)$(ICULIBSUFFIX).$(SO) | |
84 | LIBICUIO= $(LIBDIR)/$(LIBICU)$(IO_STUBNAME)$(ICULIBSUFFIX).$(SO) | |
85 | ||
86 | ## Special OS400 rules | |
87 | ||
88 | ## Build archive from shared object | |
89 | %.a : %.o | |
90 | $(AR) $(ARFLAGS) $@ $< | |
91 | ||
92 | ## Build import list from export list | |
93 | %.e : %.exp | |
94 | @echo "Building an import list for $<" | |
95 | @$(SHELL) -ec "echo '#! $*.a($*.so)' | cat - $< > $@" | |
96 | ||
97 | ## Compilation rules | |
98 | %.$(STATIC_O): $(srcdir)/%.c | |
99 | $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $< | |
100 | %.o: $(srcdir)/%.c | |
101 | $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $< | |
102 | ||
103 | %.$(STATIC_O): $(srcdir)/%.cpp | |
104 | $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $< | |
105 | %.o: $(srcdir)/%.cpp | |
106 | $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $< | |
107 | ||
108 | %.qwobj : $(srcdir)/%.c | |
109 | $(COMPILE.c) -o $@ $< | |
110 | ||
111 | %.qwobj : $(srcdir)/%.cpp | |
112 | $(COMPILE.cc) -o $@ $< | |
113 | ||
114 | ## Dependency rules | |
115 | %.d : %.u | |
116 | # @$(SHELL) -ec 'cat $< \ | |
117 | # | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \ | |
118 | # [ -s $@ ] || rm -f $@ ; rm -f $<' | |
119 | ||
120 | %.u : $(srcdir)/%.c | |
121 | @echo "generating dependency information for $<" | |
122 | # @$(SHELL) -ec 'touch $*.u > /dev/null 2>&1' | |
123 | # @$(SHELL) -ec '$(GEN_DEPS.c) -f $*.u $< > /dev/null 2>&1' | |
124 | ||
125 | %.u : $(srcdir)/%.cpp | |
126 | @echo "generating dependency information for $<" | |
127 | # @$(SHELL) -ec 'touch $*.u > /dev/null 2>&1' | |
128 | # @$(SHELL) -ec '$(GEN_DEPS.cc) -f $*.u $< > /dev/null 2>&1' | |
129 | ||
130 | ## End OS400-specific setup |