]> gcc.gnu.org Git - gcc.git/blob - gcc/cp/Make-lang.in
Makefile.in (WARN_CFLAGS): Add -pedantic -Wno-long-long.
[gcc.git] / gcc / cp / Make-lang.in
1 # Top level makefile fragment for GNU C++.
2 # Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000
3 # Free Software Foundation, Inc.
4
5 #This file is part of GNU CC.
6
7 #GNU CC is free software; you can redistribute it and/or modify
8 #it under the terms of the GNU General Public License as published by
9 #the Free Software Foundation; either version 2, or (at your option)
10 #any later version.
11
12 #GNU CC is distributed in the hope that it will be useful,
13 #but WITHOUT ANY WARRANTY; without even the implied warranty of
14 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 #GNU General Public License for more details.
16
17 #You should have received a copy of the GNU General Public License
18 #along with GNU CC; see the file COPYING. If not, write to
19 #the Free Software Foundation, 59 Temple Place - Suite 330,
20 #Boston, MA 02111-1307, USA.
21
22 # This file provides the language dependent support in the main Makefile.
23 # Each language makefile fragment must provide the following targets:
24 #
25 # foo.all.build, foo.all.cross, foo.start.encap, foo.rest.encap,
26 # foo.info, foo.dvi,
27 # foo.install-normal, foo.install-common, foo.install-info, foo.install-man,
28 # foo.uninstall, foo.distdir,
29 # foo.mostlyclean, foo.clean, foo.distclean, foo.extraclean,
30 # foo.maintainer-clean, foo.stage1, foo.stage2, foo.stage3, foo.stage4
31 #
32 # where `foo' is the name of the language.
33 #
34 # It should also provide rules for:
35 #
36 # - making any compiler driver (eg: g++)
37 # - the compiler proper (eg: cc1plus)
38 # - define the names for selecting the language in LANGUAGES.
39 #\f
40 # Extra flags to pass to recursive makes.
41 CXX_FLAGS_TO_PASS = \
42 "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
43 "CXXFLAGS=$(CXXFLAGS)" \
44 "CXX_FOR_TARGET=$(CXX_FOR_TARGET)"
45
46 # Actual names to use when installing a native compiler.
47 CXX_INSTALL_NAME = `t='$(program_transform_name)'; echo c++ | sed $$t`
48 GXX_INSTALL_NAME = `t='$(program_transform_name)'; echo g++ | sed $$t`
49 DEMANGLER_INSTALL_NAME = `t='$(program_transform_name)'; echo c++filt | sed $$t`
50
51 # Actual names to use when installing a cross-compiler.
52 CXX_CROSS_NAME = `t='$(program_transform_cross_name)'; echo c++ | sed $$t`
53 GXX_CROSS_NAME = `t='$(program_transform_cross_name)'; echo g++ | sed $$t`
54 DEMANGLER_CROSS_NAME = `t='$(program_transform_cross_name)'; echo c++filt | sed $$t`
55
56 # The name to use for the demangler program.
57 DEMANGLER_PROG = c++filt$(exeext)
58
59 # Extra headers to install.
60 CXX_EXTRA_HEADERS = $(srcdir)/cp/inc/typeinfo $(srcdir)/cp/inc/exception \
61 $(srcdir)/cp/inc/new $(srcdir)/cp/inc/new.h $(srcdir)/cp/inc/cxxabi.h
62
63 # Extra code to include in libgcc2.
64 CXX_LIB2FUNCS = tinfo.o tinfo2.o new.o opnew.o opnewnt.o opvnew.o opvnewnt.o \
65 opdel.o opdelnt.o opvdel.o opvdelnt.o exception.o vec.o
66 CXX_LIB2SRCS = $(srcdir)/cp/new.cc $(srcdir)/cp/new1.cc $(srcdir)/cp/new2.cc \
67 $(srcdir)/cp/exception.cc $(srcdir)/cp/tinfo.cc \
68 $(srcdir)/cp/tinfo2.cc $(srcdir)/cp/tinfo.h
69 #\f
70 # Define the names for selecting c++ in LANGUAGES.
71 # Note that it would be nice to move the dependency on g++
72 # into the C++ rule, but that needs a little bit of work
73 # to do the right thing within all.cross.
74 C++ c++: cc1plus$(exeext)
75
76 # Tell GNU make to ignore these if they exist.
77 .PHONY: C++ c++
78
79 g++spec.o: $(srcdir)/cp/g++spec.c system.h $(GCC_H)
80 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/cp/g++spec.c
81
82 $(INTL_TARGETS): $(srcdir)/cp/parse.c
83 $(srcdir)/cp/parse.c: $(srcdir)/cp/parse.y
84 @cp_srcdir=`sed -n 's/^srcdir[ ]*=[ ]*//p' cp/Makefile` && \
85 echo "cd cp && $(MAKE) $$cp_srcdir/parse.c" && \
86 cd cp && \
87 $(MAKE) $(LANG_FLAGS_TO_PASS) $(CXX_FLAGS_TO_PASS) \
88 $$cp_srcdir/parse.c
89
90 # Create the compiler driver for g++.
91 GXX_OBJS = gcc.o g++spec.o intl.o prefix.o version.o
92 g++$(exeext): $(GXX_OBJS) $(EXTRA_GCC_OBJS) $(LIBDEPS)
93 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \
94 $(GXX_OBJS) $(EXTRA_GCC_OBJS) $(LIBS)
95
96 # Create a version of the g++ driver which calls the cross-compiler.
97 g++-cross$(exeext): g++$(exeext)
98 -rm -f g++-cross$(exeext)
99 cp g++$(exeext) g++-cross$(exeext)
100
101 cxxmain.o: $(srcdir)/../libiberty/cplus-dem.c $(DEMANGLE_H)
102 rm -f cxxmain.c
103 $(LN_S) $(srcdir)/../libiberty/cplus-dem.c cxxmain.c
104 $(CC) -c -DMAIN $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
105 -DVERSION=\"$(version)\" cxxmain.c
106
107 # Apparently OpenVM needs the -o to be at the beginning of the link line.
108 $(DEMANGLER_PROG): cxxmain.o underscore.o $(LIBDEPS)
109 $(CC) -o $@ $(ALL_CFLAGS) $(LDFLAGS) \
110 cxxmain.o underscore.o $(LIBS)
111
112 CXX_SRCS = $(srcdir)/cp/call.c $(srcdir)/cp/class.c $(srcdir)/cp/cp-tree.def \
113 $(srcdir)/cp/cp-tree.h $(srcdir)/cp/cvt.c $(srcdir)/cp/decl.c \
114 $(srcdir)/cp/decl.h $(srcdir)/cp/decl2.c $(srcdir)/cp/dump.c \
115 $(srcdir)/cp/errfn.c $(srcdir)/cp/error.c $(srcdir)/cp/except.c \
116 $(srcdir)/cp/expr.c $(srcdir)/cp/friend.c $(srcdir)/cp/init.c \
117 $(srcdir)/cp/input.c $(srcdir)/cp/lex.c $(srcdir)/cp/lex.h \
118 $(srcdir)/cp/method.c $(srcdir)/cp/optimize.c $(srcdir)/cp/parse.y \
119 $(srcdir)/cp/pt.c $(srcdir)/cp/ptree.c $(srcdir)/cp/repo.c \
120 $(srcdir)/cp/rtti.c $(srcdir)/cp/search.c $(srcdir)/cp/semantics.c \
121 $(srcdir)/cp/spew.c $(srcdir)/cp/tree.c $(srcdir)/cp/typeck.c \
122 $(srcdir)/cp/typeck2.c $(srcdir)/cp/xref.c
123
124 cc1plus$(exeext): $(P) $(CXX_SRCS) $(LIBDEPS) stamp-objlist c-common.o \
125 c-pragma.o $(srcdir)/cp/cp-tree.h $(srcdir)/cp/cp-tree.def \
126 $(srcdir)/cp/gxx.gperf $(srcdir)/cp/cfns.gperf hash.o
127 cd cp; $(MAKE) $(LANG_FLAGS_TO_PASS) $(CXX_FLAGS_TO_PASS) ../cc1plus$(exeext)
128 #\f
129 # Build hooks:
130
131 c++.all.build: g++$(exeext)
132 c++.all.cross: g++-cross$(exeext) $(DEMANGLER_PROG)
133 c++.start.encap: g++$(exeext)
134 c++.rest.encap: $(DEMANGLER_PROG)
135
136 c++.info:
137 c++.dvi:
138
139 # C++ language-support library pieces for libgcc.
140 tinfo.o: cc1plus$(exeext) $(srcdir)/cp/tinfo.cc
141 $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(GXX_ABI_FLAG) $(CXXFLAGS) $(INCLUDES) \
142 -c $(srcdir)/cp/tinfo.cc
143 tinfo2.o: cc1plus$(exeext) $(srcdir)/cp/tinfo2.cc
144 $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(GXX_ABI_FLAG) $(CXXFLAGS) $(INCLUDES) \
145 -c $(srcdir)/cp/tinfo2.cc
146 exception.o: cc1plus$(exeext) $(srcdir)/cp/exception.cc
147 $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(GXX_ABI_FLAG) $(CXXFLAGS) $(INCLUDES) \
148 -c -fexceptions $(srcdir)/cp/exception.cc
149 new.o: cc1plus$(exeext) $(srcdir)/cp/new.cc
150 $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(GXX_ABI_FLAG) $(CXXFLAGS) $(INCLUDES) \
151 -c $(srcdir)/cp/new.cc
152 opnew.o: cc1plus$(exeext) $(srcdir)/cp/new1.cc
153 $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(GXX_ABI_FLAG) $(CXXFLAGS) $(INCLUDES) \
154 -c $(srcdir)/cp/new1.cc -DL_op_new -o opnew.o
155 opnewnt.o: cc1plus$(exeext) $(srcdir)/cp/new1.cc
156 $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(GXX_ABI_FLAG) $(CXXFLAGS) $(INCLUDES) \
157 -c $(srcdir)/cp/new1.cc -DL_op_newnt -o opnewnt.o
158 opvnew.o: cc1plus$(exeext) $(srcdir)/cp/new2.cc
159 $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(GXX_ABI_FLAG) $(CXXFLAGS) $(INCLUDES) \
160 -c $(srcdir)/cp/new2.cc -DL_op_vnew -o opvnew.o
161 opvnewnt.o: cc1plus$(exeext) $(srcdir)/cp/new2.cc
162 $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(GXX_ABI_FLAG) $(CXXFLAGS) $(INCLUDES) \
163 -c $(srcdir)/cp/new2.cc -DL_op_vnewnt -o opvnewnt.o
164 opdel.o: cc1plus$(exeext) $(srcdir)/cp/new2.cc
165 $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(GXX_ABI_FLAG) $(CXXFLAGS) $(INCLUDES) \
166 -c $(srcdir)/cp/new2.cc -DL_op_delete -o opdel.o
167 opdelnt.o: cc1plus$(exeext) $(srcdir)/cp/new2.cc
168 $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(GXX_ABI_FLAG) $(CXXFLAGS) $(INCLUDES) \
169 -c $(srcdir)/cp/new2.cc -DL_op_delnt -o opdelnt.o
170 opvdel.o: cc1plus$(exeext) $(srcdir)/cp/new2.cc
171 $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(GXX_ABI_FLAG) $(CXXFLAGS) $(INCLUDES) \
172 -c $(srcdir)/cp/new2.cc -DL_op_vdel -o opvdel.o
173 opvdelnt.o: cc1plus$(exeext) $(srcdir)/cp/new2.cc
174 $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(GXX_ABI_FLAG) $(CXXFLAGS) $(INCLUDES) \
175 -c $(srcdir)/cp/new2.cc -DL_op_vdelnt -o opvdelnt.o
176 vec.o: cc1plus$(exeext) $(srcdir)/cp/vec.cc
177 $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(GXX_ABI_FLAG) $(CXXFLAGS) $(INCLUDES) \
178 -c $(srcdir)/cp/vec.cc -o vec.o
179
180 # We want to update cplib2.txt if any of the source files change...
181 cplib2.txt: $(CXX_LIB2SRCS) $(CXX_EXTRA_HEADERS) cplib2.ready
182 case " $(LANGUAGES) " in \
183 *" "[cC]"++ "*) \
184 echo $(CXX_LIB2FUNCS) > cplib2.new;; \
185 *) \
186 echo "" > cplib2.new;; \
187 esac
188 mv -f cplib2.new cplib2.txt
189
190 # Or if it would be different.
191 # Don't try to do write if `.' is not writable;
192 # in that case, we're installing from someone else's directory.
193 # But go ahead and fail if that directory hasn't been properly built.
194 cplib2.ready: $(GCC_PASSES) stmp-int-hdrs $(STMP_FIXPROTO)
195 @if [ -r cplib2.txt -a -w . ]; then \
196 case " $(LANGUAGES) " in \
197 *" "[cC]"++ "*) \
198 echo $(CXX_LIB2FUNCS) > cplib2.new;; \
199 *) \
200 echo "" > cplib2.new;; \
201 esac; \
202 if cmp -s cplib2.new cplib2.txt; then true; else \
203 touch cplib2.ready; \
204 fi; \
205 rm -f cplib2.new; \
206 else true ; \
207 fi
208 @if [ -f cplib2.ready ]; then true; else \
209 touch cplib2.ready; \
210 fi
211 #\f
212 # Install hooks:
213 # cc1plus is installed elsewhere as part of $(COMPILERS).
214
215 # Nothing to do here.
216 c++.install-normal:
217
218 # Install the driver program as $(target)-g++
219 # and also as either g++ (if native) or $(tooldir)/bin/g++.
220 c++.install-common:
221 -if [ -f cc1plus$(exeext) ] ; then \
222 if [ -f g++-cross$(exeext) ] ; then \
223 rm -f $(bindir)/$(GXX_CROSS_NAME)$(exeext); \
224 $(INSTALL_PROGRAM) g++-cross$(exeext) $(bindir)/$(GXX_CROSS_NAME)$(exeext); \
225 chmod a+x $(bindir)/$(GXX_CROSS_NAME)$(exeext); \
226 rm -f $(bindir)/$(CXX_CROSS_NAME)$(exeext); \
227 $(LN) $(bindir)/$(GXX_CROSS_NAME)$(exeext) $(bindir)/$(CXX_CROSS_NAME)$(exeext); \
228 else \
229 rm -f $(bindir)/$(GXX_INSTALL_NAME)$(exeext); \
230 $(INSTALL_PROGRAM) g++$(exeext) $(bindir)/$(GXX_INSTALL_NAME)$(exeext); \
231 chmod a+x $(bindir)/$(GXX_INSTALL_NAME)$(exeext); \
232 rm -f $(bindir)/$(CXX_INSTALL_NAME)$(exeext); \
233 $(LN) $(bindir)/$(GXX_INSTALL_NAME)$(exeext) $(bindir)/$(CXX_INSTALL_NAME)$(exeext); \
234 fi ; \
235 if [ x$(DEMANGLER_PROG) != x ] && [ -x "$(DEMANGLER_PROG)" ]; then \
236 if [ -f g++-cross$(exeext) ] ; then \
237 rm -f $(bindir)/$(DEMANGLER_CROSS_NAME)$(exeext); \
238 $(INSTALL_PROGRAM) $(DEMANGLER_PROG) $(bindir)/$(DEMANGLER_CROSS_NAME)$(exeext); \
239 chmod a+x $(bindir)/$(DEMANGLER_CROSS_NAME)$(exeext); \
240 else \
241 rm -f $(bindir)/$(DEMANGLER_INSTALL_NAME)$(exeext); \
242 $(INSTALL_PROGRAM) $(DEMANGLER_PROG) $(bindir)/$(DEMANGLER_INSTALL_NAME)$(exeext); \
243 chmod a+x $(bindir)/$(DEMANGLER_INSTALL_NAME)$(exeext); \
244 fi ; \
245 fi ; \
246 fi
247
248 c++.install-info:
249
250 c++.install-man: $(srcdir)/cp/g++.1
251 -if [ -f cc1plus$(exeext) ] ; then \
252 if [ -f g++-cross$(exeext) ] ; then \
253 rm -f $(man1dir)/$(GXX_CROSS_NAME)$(manext); \
254 $(INSTALL_DATA) $(srcdir)/cp/g++.1 $(man1dir)/$(GXX_CROSS_NAME)$(manext); \
255 chmod a-x $(man1dir)/$(GXX_CROSS_NAME)$(manext); \
256 else \
257 rm -f $(man1dir)/$(GXX_INSTALL_NAME)$(manext); \
258 $(INSTALL_DATA) $(srcdir)/cp/g++.1 $(man1dir)/$(GXX_INSTALL_NAME)$(manext); \
259 chmod a-x $(man1dir)/$(GXX_INSTALL_NAME)$(manext); \
260 fi; \
261 else true; fi
262
263 c++.uninstall:
264 -rm -rf $(bindir)/$(CXX_INSTALL_NAME)$(exeext)
265 -rm -rf $(bindir)/$(CXX_CROSS_NAME)$(exeext)
266 -rm -rf $(bindir)/$(GXX_INSTALL_NAME)$(exeext)
267 -rm -rf $(bindir)/$(GXX_CROSS_NAME)$(exeext)
268 -rm -rf $(bindir)/$(DEMANGLER_INSTALL_NAME)$(exeext)
269 -rm -rf $(bindir)/$(DEMANGLER_CROSS_NAME)$(exeext)
270 -rm -rf $(man1dir)/$(GXX_INSTALL_NAME)$(manext)
271 -rm -rf $(man1dir)/$(GXX_CROSS_NAME)$(manext)
272 #\f
273 # Clean hooks:
274 # A lot of the ancillary files are deleted by the main makefile.
275 # We just have to delete files specific to us.
276
277 c++.mostlyclean:
278 -rm -f cp/*$(objext) $(DEMANGLER_PROG)
279 c++.clean:
280 -rm -f cplib2.txt cplib2.ready
281 c++.distclean:
282 -rm -f cp/config.status cp/Makefile
283 -rm -f cp/parse.output
284 c++.extraclean:
285 c++.maintainer-clean:
286 -rm -f cp/parse.c cp/parse.h
287 #\f
288 # Stage hooks:
289 # The main makefile has already created stage?/cp.
290
291 c++.stage1: stage1-start
292 -mv cp/*$(objext) stage1/cp
293 c++.stage2: stage2-start
294 -mv cp/*$(objext) stage2/cp
295 c++.stage3: stage3-start
296 -mv cp/*$(objext) stage3/cp
297 c++.stage4: stage4-start
298 -mv cp/*$(objext) stage4/cp
299 #\f
300 # Maintenance hooks:
301
302 # This target creates the files that can be rebuilt, but go in the
303 # distribution anyway. It then copies the files to the distdir directory.
304 c++.distdir:
305 mkdir tmp/cp
306 mkdir tmp/cp/inc
307 cd cp ; $(MAKE) $(LANG_FLAGS_TO_PASS) $(CXX_FLAGS_TO_PASS) parse.c hash.h
308 cd cp; \
309 for file in *[0-9a-zA-Z+]; do \
310 $(LN) $$file ../tmp/cp; \
311 done
312 cd cp/inc; \
313 for file in *[0-9a-zA-Z+]; do \
314 ln $$file ../../tmp/cp/inc >/dev/null 2>&1 \
315 || cp $$file ../../tmp/cp/inc; \
316 done
This page took 0.054084 seconds and 6 git commands to generate.