|
|
1.1 root 1: # Top level makefile fragment for GNU C++.
2: # Copyright (C) 1994 Free Software Foundation, Inc.
3:
4: #This file is part of GNU CC.
5:
6: #GNU CC is free software; you can redistribute it and/or modify
7: #it under the terms of the GNU General Public License as published by
8: #the Free Software Foundation; either version 2, or (at your option)
9: #any later version.
10:
11: #GNU CC is distributed in the hope that it will be useful,
12: #but WITHOUT ANY WARRANTY; without even the implied warranty of
13: #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14: #GNU General Public License for more details.
15:
16: #You should have received a copy of the GNU General Public License
17: #along with GNU CC; see the file COPYING. If not, write to
18: #the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
19:
20: # This file provides the language dependent support in the main Makefile.
21: # Each language makefile fragment must provide the following targets:
22: #
23: # foo.all.build, foo.all.cross, foo.start.encap, foo.rest.encap,
24: # foo.info, foo.dvi,
25: # foo.install-normal, foo.install-common, foo.install-info, foo.install-man,
26: # foo.uninstall, foo.distdir,
27: # foo.mostlyclean, foo.clean, foo.distclean, foo.extraclean, foo.realclean,
28: # foo.stage1, foo.stage2, foo.stage3, foo.stage4
29: #
30: # where `foo' is the name of the language.
31: #
32: # It should also provide rules for:
33: #
34: # - making any compiler driver (eg: g++)
35: # - the compiler proper (eg: cc1plus)
36: # - define the names for selecting the language in LANGUAGES.
37:
38: # Extra flags to pass to recursive makes.
39: CXX_FLAGS_TO_PASS = \
40: "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
41: "CXXFLAGS=$(CXXFLAGS)" \
42: "CXX_FOR_TARGET=$(CXX_FOR_TARGET)"
43:
44: # Actual names to use when installing a native compiler.
45: CXX_INSTALL_NAME = c++
46: GXX_INSTALL_NAME = g++
47:
48: # Actual names to use when installing a cross-compiler.
49: CXX_CROSS_NAME = $(target)-c++
50: GXX_CROSS_NAME = $(target)-g++
51:
52:
53: # Define the names for selecting c++ in LANGUAGES.
54: # Note that it would be nice to move the dependency on g++
55: # into the C++ rule, but that needs a little bit of work
56: # to do the right thing within all.cross.
57: C++ c++: cc1plus
58:
59: # Create the compiler driver for g++.
60: g++: $(srcdir)/cp/g++.c $(CONFIG_H) $(LIBDEPS)
61: $(CC) $(ALL_CFLAGS) $(INCLUDES) $(LDFLAGS) -o g++ $(srcdir)/cp/g++.c $(LIBS)
62:
63: # Create a version of the g++ driver which calls the cross-compiler.
64: g++-cross: $(srcdir)/cp/g++.c
65: $(CC) $(ALL_CFLAGS) $(INCLUDES) $(LDFLAGS) -o g++-cross \
66: -DGCC_NAME=\"$(GCC_CROSS_NAME)\" $(srcdir)/cp/g++.c version.o $(LIBS)
67:
68: CXX_SRCS = $(srcdir)/cp/call.c $(srcdir)/cp/decl2.c \
69: $(srcdir)/cp/except.c $(srcdir)/cp/input.c $(srcdir)/cp/pt.c \
70: $(srcdir)/cp/spew.c $(srcdir)/cp/xref.c $(srcdir)/cp/class.c \
71: $(srcdir)/cp/edsel.c $(srcdir)/cp/expr.c $(srcdir)/cp/lex.c \
72: $(srcdir)/cp/ptree.c $(srcdir)/cp/tree.c $(srcdir)/cp/cvt.c \
73: $(srcdir)/cp/errfn.c $(srcdir)/cp/gc.c $(srcdir)/cp/method.c \
74: $(srcdir)/cp/search.c $(srcdir)/cp/typeck.c $(srcdir)/cp/decl.c \
75: $(srcdir)/cp/error.c $(srcdir)/cp/init.c $(srcdir)/cp/parse.y \
76: $(srcdir)/cp/sig.c $(srcdir)/cp/typeck2.c
77:
78: cc1plus: $(P) $(CXX_SRCS) $(LIBDEPS) stamp-objlist c-common.o
79: cd cp; $(MAKE) $(FLAGS_TO_PASS) $(CXX_FLAGS_TO_PASS) ../cc1plus
80:
81: # Build hooks:
82:
83: c++.all.build: g++
84: c++.all.cross: g++-cross
85: c++.start.encap: g++
86: c++.rest.encap:
87:
88: c++.info:
89: c++.dvi:
90:
91: # Install hooks:
92: # cc1plus is installed elsewhere as part of $(COMPILERS).
93:
94: # Nothing to do here.
95: c++.install-normal:
96:
97: # Install the driver program as $(target)-g++
98: # and also as either g++ (if native) or $(tooldir)/bin/g++.
99: c++.install-common:
100: -if [ -f cc1plus ] ; then \
101: if [ -f g++-cross ] ; then \
102: rm -f $(bindir)/$(GXX_CROSS_NAME); \
103: $(INSTALL_PROGRAM) g++-cross $(bindir)/$(GXX_CROSS_NAME); \
104: chmod a+x $(bindir)/$(GXX_CROSS_NAME); \
105: rm -f $(bindir)/$(CXX_CROSS_NAME); \
106: ln $(bindir)/$(GXX_CROSS_NAME) $(bindir)/$(CXX_CROSS_NAME); \
107: else \
108: rm -f $(bindir)/$(GXX_INSTALL_NAME); \
109: $(INSTALL_PROGRAM) g++ $(bindir)/$(GXX_INSTALL_NAME); \
110: chmod a+x $(bindir)/$(GXX_INSTALL_NAME); \
111: rm -f $(bindir)/$(CXX_INSTALL_NAME); \
112: ln $(bindir)/$(GXX_INSTALL_NAME) $(bindir)/$(CXX_INSTALL_NAME); \
113: fi ; \
114: fi
115:
116: c++.install-info:
117:
118: c++.install-man: $(srcdir)/cp/g++.1
119: -if [ -f cc1plus ] ; then \
120: $(INSTALL_DATA) $(srcdir)/cp/g++.1 $(mandir)/g++$(manext) ; \
121: chmod a-x $(mandir)/g++$(manext) ; \
122: else true; fi
123:
124: c++.uninstall:
125: -rm -rf $(bindir)/$(CXX_INSTALL_NAME)
126: -rm -rf $(bindir)/$(CXX_CROSS_NAME)
127: -rm -rf $(bindir)/$(GXX_INSTALL_NAME)
128: -rm -rf $(bindir)/$(GXX_CROSS_NAME)
129: -rm -rf $(mandir)/g++$(manext)
130:
131: # Clean hooks:
132: # A lot of the ancillary files are deleted by the main makefile.
133: # We just have to delete files specific to us.
134:
135: c++.mostlyclean:
136: -rm -f cp/*.o
137: c++.clean:
138: c++.distclean:
139: -rm -f cp/config.status cp/Makefile
140: -rm -f cp/parse.output
141: c++.extraclean:
142: c++.realclean:
143: -rm -f cp/parse.c cp/parse.h
144:
145: # Stage hooks:
146: # The main makefile has already created stage?/cp.
147:
148: c++.stage1:
149: -mv cp/*.o stage1/cp
150: c++.stage2:
151: -mv cp/*.o stage2/cp
152: c++.stage3:
153: -mv cp/*.o stage3/cp
154: c++.stage4:
155: -mv cp/*.o stage4/cp
156:
157: # Maintenance hooks:
158:
159: # This target creates the files that can be rebuilt, but go in the
160: # distribution anyway. It then copies the files to the distdir directory.
161: c++.distdir:
162: mkdir tmp/cp
163: cd cp ; $(MAKE) $(FLAGS_TO_PASS) $(CXX_FLAGS_TO_PASS) parse.c hash.h
164: cd cp; \
165: for file in *[0-9a-zA-Z+]; do \
166: ln $$file ../tmp/cp >/dev/null 2>&1 || cp $$file ../tmp/cp; \
167: done
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.