]>
Commit | Line | Data |
---|---|---|
b75a7d8f A |
1 | ## -*-makefile-*- |
2 | ## OS400-specific setup (for cross build) | |
3 | ## Copyright (c) 1999-2003, International Business Machines Corporation and | |
4 | ## others. All Rights Reserved. | |
5 | ## | |
6 | ## $Id: mh-os400,v 1.1.1.2 2003/07/03 18:13:33 avery Exp $ | |
7 | ||
8 | GEN_DEPS.c= $(CC1) -E -M $(DEFS) $(CPPFLAGS) | |
9 | GEN_DEPS.cc= $(CXX1) -E -M $(DEFS) $(CPPFLAGS) | |
10 | ||
11 | DEFS+=-DOS400 -D_MULTI_THREADED | |
12 | ||
13 | ## Commands to compile | |
14 | COMPILE.c= $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) -c -qTERASPACE=*YES -qSTGMDL=*INHERIT -qPFROPT=*STRDONLY | |
15 | COMPILE.cc= $(CXX) $(DEFS) $(CPPFLAGS) $(CXXFLAGS) -c -qTERASPACE=*YES -qSTGMDL=*INHERIT -qPFROPT=*STRDONLY | |
16 | ||
17 | ## Commands to link | |
18 | ## We need to use the C++ linker, even when linking C programs, since | |
19 | ## our libraries contain C++ code (C++ static init not called) | |
20 | LINK.c= $(CXX) $(CXXFLAGS) $(LDFLAGS) -qOPTION='*DUPPROC *DUPVAR' | |
21 | LINK.cc= $(CXX) $(CXXFLAGS) $(LDFLAGS) -qOPTION='*DUPPROC *DUPVAR' | |
22 | ||
23 | ## Commands to make a shared library | |
24 | SHLIB.c= ld -v -qOPTION='*DUPPROC *DUPVAR' | |
25 | SHLIB.cc= ld -v -qOPTION='*DUPPROC *DUPVAR' | |
26 | AR = qar | |
27 | ARFLAGS = -cuv | |
28 | ||
29 | ## Compiler switch to embed a runtime search path | |
30 | LD_RPATH= -I | |
31 | LD_RPATH_PRE= -I | |
32 | ||
33 | ## Versioned target for a shared library. | |
34 | FINAL_SO_TARGET = $(SO_TARGET) | |
35 | MIDDLE_SO_TARGET = | |
36 | ||
37 | ## object suffix | |
38 | TO= o | |
39 | ||
40 | ## Shared object suffix | |
41 | SO= so | |
42 | ## Non-shared intermediate object suffix | |
43 | STATIC_O = o | |
44 | ||
45 | ## Platform command to remove or move executable target | |
46 | RMV = del | |
47 | ## Platform commands to remove or move executable and library targets | |
48 | INSTALL-S = cp -fph | |
49 | INSTALL-L = $(INSTALL-S) | |
50 | ||
51 | ## Link commands to link to ICU service programs | |
52 | LIBICUDT = $(top_builddir)/stubdata/$(LIBICU)data$(ICULIBSUFFIX).$(SO) | |
53 | LIBICUUC = $(top_builddir)/common/$(LIBICU)uc$(ICULIBSUFFIX).$(SO) | |
54 | LIBICUI18N = $(top_builddir)/i18n/$(LIBICU)i18n$(ICULIBSUFFIX).$(SO) | |
55 | LIBICULE = $(top_builddir)/layout/$(LIBICU)le$(ICULIBSUFFIX).$(SO) | |
56 | LIBICULX = $(top_builddir)/layoutex/$(LIBICU)lx$(ICULIBSUFFIX).$(SO) | |
57 | LIBCTESTFW = $(top_builddir)/tools/ctestfw/$(LIBICU)ctestfw$(ICULIBSUFFIX).$(SO) | |
58 | LIBICUTOOLUTIL = $(top_builddir)/tools/toolutil/$(LIBICU)toolutil$(ICULIBSUFFIX).$(SO) | |
59 | LIBUSTDIO= $(top_builddir)/extra/ustdio/$(LIBICU)io$(ICULIBSUFFIX).$(SO) | |
60 | ||
61 | ## Special OS400 rules | |
62 | ||
63 | ## Build archive from shared object | |
64 | %.a : %.o | |
65 | $(AR) $(ARFLAGS) $@ $< | |
66 | ||
67 | ## Build import list from export list | |
68 | %.e : %.exp | |
69 | @echo "Building an import list for $<" | |
70 | @$(SHELL) -ec "echo '#! $*.a($*.so)' | cat - $< > $@" | |
71 | ||
72 | ## Compilation rules | |
73 | %.$(STATIC_O): $(srcdir)/%.c | |
74 | $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS) -o $@ $< | |
75 | %.o: $(srcdir)/%.c | |
76 | $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS) -o $@ $< | |
77 | ||
78 | %.$(STATIC_O): $(srcdir)/%.cpp | |
79 | $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS) -o $@ $< | |
80 | %.o: $(srcdir)/%.cpp | |
81 | $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS) -o $@ $< | |
82 | ||
83 | %.qwobj : $(srcdir)/%.c | |
84 | $(COMPILE.c) -o $@ $< | |
85 | ||
86 | %.qwobj : $(srcdir)/%.cpp | |
87 | $(COMPILE.cc) -o $@ $< | |
88 | ||
89 | ## Dependency rules | |
90 | %.d : %.u | |
91 | # @$(SHELL) -ec 'cat $< \ | |
92 | # | sed '\''s/\($*\)\.o[ :]*/\1.o $@ : /g'\'' > $@; \ | |
93 | # [ -s $@ ] || rm -f $@ ; rm -f $<' | |
94 | ||
95 | %.u : $(srcdir)/%.c | |
96 | @echo "generating dependency information for $<" | |
97 | # @$(SHELL) -ec 'touch $*.u > /dev/null 2>&1' | |
98 | # @$(SHELL) -ec '$(GEN_DEPS.c) -f $*.u $< > /dev/null 2>&1' | |
99 | ||
100 | %.u : $(srcdir)/%.cpp | |
101 | @echo "generating dependency information for $<" | |
102 | # @$(SHELL) -ec 'touch $*.u > /dev/null 2>&1' | |
103 | # @$(SHELL) -ec '$(GEN_DEPS.cc) -f $*.u $< > /dev/null 2>&1' | |
104 | ||
105 | ## End OS400-specific setup |