]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/cp/Make-lang.in
Merge in gcc2 snapshot 19980929. See gcc/ChangeLog and gcc/FSFChangeLog for
[thirdparty/gcc.git] / gcc / cp / Make-lang.in
CommitLineData
6e498b5c 1# Top level makefile fragment for GNU C++.
36df36f9 2# Copyright (C) 1994, 1995, 1997, 1998, 1999 Free Software Foundation, Inc.
6e498b5c 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
a9cce9f8 18#the Free Software Foundation, 59 Temple Place - Suite 330,
19#Boston, MA 02111-1307, USA.
6e498b5c 20
21# This file provides the language dependent support in the main Makefile.
22# Each language makefile fragment must provide the following targets:
23#
24# foo.all.build, foo.all.cross, foo.start.encap, foo.rest.encap,
25# foo.info, foo.dvi,
26# foo.install-normal, foo.install-common, foo.install-info, foo.install-man,
27# foo.uninstall, foo.distdir,
a8514488 28# foo.mostlyclean, foo.clean, foo.distclean, foo.extraclean,
29# foo.maintainer-clean, foo.stage1, foo.stage2, foo.stage3, foo.stage4
6e498b5c 30#
31# where `foo' is the name of the language.
32#
33# It should also provide rules for:
34#
35# - making any compiler driver (eg: g++)
36# - the compiler proper (eg: cc1plus)
37# - define the names for selecting the language in LANGUAGES.
6686e84d 38#\f
6e498b5c 39# Extra flags to pass to recursive makes.
40CXX_FLAGS_TO_PASS = \
41 "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
42 "CXXFLAGS=$(CXXFLAGS)" \
43 "CXX_FOR_TARGET=$(CXX_FOR_TARGET)"
44
ddb9bca7 45# Actual names to use when installing a native compiler.
be13bd10 46CXX_INSTALL_NAME = `t='$(program_transform_name)'; echo c++ | sed $$t`
47GXX_INSTALL_NAME = `t='$(program_transform_name)'; echo g++ | sed $$t`
0fc25c4b 48DEMANGLER_INSTALL_NAME = `t='$(program_transform_name)'; echo c++filt | sed $$t`
ddb9bca7 49
50# Actual names to use when installing a cross-compiler.
be13bd10 51CXX_CROSS_NAME = `t='$(program_transform_cross_name)'; echo c++ | sed $$t`
52GXX_CROSS_NAME = `t='$(program_transform_cross_name)'; echo g++ | sed $$t`
0fc25c4b 53DEMANGLER_CROSS_NAME = `t='$(program_transform_cross_name)'; echo c++filt | sed $$t`
ddb9bca7 54
8c5c575d 55# The name to use for the demangler program.
0a5c9710 56DEMANGLER_PROG = c++filt$(exeext)
3cc0b4b9 57
58# Extra headers to install.
59CXX_EXTRA_HEADERS = $(srcdir)/cp/inc/typeinfo $(srcdir)/cp/inc/exception \
60 $(srcdir)/cp/inc/new $(srcdir)/cp/inc/new.h
61
62# Extra code to include in libgcc2.
4b7a79e2 63CXX_LIB2FUNCS = tinfo.o tinfo2.o new.o opnew.o opnewnt.o opvnew.o opvnewnt.o \
64 opdel.o opdelnt.o opvdel.o opvdelnt.o exception.o
02d7f858 65CXX_LIB2SRCS = $(srcdir)/cp/new.cc $(srcdir)/cp/new1.cc $(srcdir)/cp/new2.cc \
66 $(srcdir)/cp/exception.cc $(srcdir)/cp/tinfo.cc \
67 $(srcdir)/cp/tinfo2.cc $(srcdir)/cp/tinfo.h
6686e84d 68#\f
6e498b5c 69# Define the names for selecting c++ in LANGUAGES.
70# Note that it would be nice to move the dependency on g++
71# into the C++ rule, but that needs a little bit of work
72# to do the right thing within all.cross.
2848c1dc 73C++ c++: cc1plus$(exeext)
6e498b5c 74
c9db0571 75# Tell GNU make to ignore these if they exist.
76.PHONY: C++ c++
77
b0df6589 78g++.c: $(srcdir)/gcc.c
79 -rm -f $@
ea4a6c81 80 $(LN_S) $(srcdir)/gcc.c $@
b0df6589 81
82g++spec.o: $(srcdir)/cp/g++spec.c
eaf26d83 83 $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/cp/g++spec.c
b0df6589 84
85# N.B.: This is a copy of the gcc.o rule, with -DLANG_SPECIFIC_DRIVER added.
86# It'd be nice if we could find an easier way to do this---rather than have
87# to track changes to the toplevel gcc Makefile as well.
88# We depend on g++.c last, to make it obvious where it came from.
be2828ce 89g++.o: $(CONFIG_H) intl.h multilib.h config.status system.h \
90 Makefile $(lang_specs_files) g++.c prefix.h
b0df6589 91 $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
92 $(DRIVER_DEFINES) \
93 -DLANG_SPECIFIC_DRIVER \
94 -c g++.c
95
6e498b5c 96# Create the compiler driver for g++.
be2828ce 97GXX_OBJS = g++.o g++spec.o choose-temp.o intl.o pexecute.o prefix.o version.o \
98 mkstemp.o
99g++$(exeext): $(GXX_OBJS) $(EXTRA_GCC_OBJS) $(LIBDEPS)
100 $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \
101 $(GXX_OBJS) $(EXTRA_GCC_OBJS) $(LIBS)
6e498b5c 102
103# Create a version of the g++ driver which calls the cross-compiler.
b0df6589 104g++-cross$(exeext): g++$(exeext)
105 -rm -f g++-cross$(exeext)
106 cp g++$(exeext) g++-cross$(exeext)
6e498b5c 107
2f3c3bda 108cxxmain.o: $(srcdir)/../libiberty/cplus-dem.c $(DEMANGLE_H)
8c5c575d 109 rm -f cxxmain.c
5ab0395f 110 $(LN_S) $(srcdir)/../libiberty/cplus-dem.c cxxmain.c
8c5c575d 111 $(CC) -c -DMAIN $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
0993eaa2 112 -DVERSION=\"$(version)\" cxxmain.c
8c5c575d 113
6896278d 114# Apparently OpenVM needs the -o to be at the beginning of the link line.
f72d4821 115$(DEMANGLER_PROG): cxxmain.o underscore.o getopt.o getopt1.o $(LIBDEPS)
6896278d 116 $(CC) -o $@ $(ALL_CFLAGS) $(LDFLAGS) \
74f21139 117 cxxmain.o underscore.o getopt.o getopt1.o $(LIBS)
8c5c575d 118
6e498b5c 119CXX_SRCS = $(srcdir)/cp/call.c $(srcdir)/cp/decl2.c \
120 $(srcdir)/cp/except.c $(srcdir)/cp/input.c $(srcdir)/cp/pt.c \
121 $(srcdir)/cp/spew.c $(srcdir)/cp/xref.c $(srcdir)/cp/class.c \
63b1d638 122 $(srcdir)/cp/expr.c $(srcdir)/cp/lex.c \
6e498b5c 123 $(srcdir)/cp/ptree.c $(srcdir)/cp/tree.c $(srcdir)/cp/cvt.c \
63b1d638 124 $(srcdir)/cp/errfn.c $(srcdir)/cp/rtti.c $(srcdir)/cp/method.c \
6e498b5c 125 $(srcdir)/cp/search.c $(srcdir)/cp/typeck.c $(srcdir)/cp/decl.c \
b465397d 126 $(srcdir)/cp/error.c $(srcdir)/cp/friend.c $(srcdir)/cp/init.c \
127 $(srcdir)/cp/parse.y $(srcdir)/cp/sig.c $(srcdir)/cp/typeck2.c \
0090dad2 128 $(srcdir)/cp/repo.c $(srcdir)/cp/semantics.c
6e498b5c 129
2848c1dc 130cc1plus$(exeext): $(P) $(CXX_SRCS) $(LIBDEPS) stamp-objlist c-common.o c-pragma.o \
ec35db73 131 $(srcdir)/cp/cp-tree.h $(srcdir)/cp/cp-tree.def hash.o
2848c1dc 132 cd cp; $(MAKE) $(FLAGS_TO_PASS) $(CXX_FLAGS_TO_PASS) ../cc1plus$(exeext)
6686e84d 133#\f
6e498b5c 134# Build hooks:
135
caeef7d9 136c++.all.build: g++$(exeext)
02d7f858 137c++.all.cross: g++-cross$(exeext) $(DEMANGLER_PROG)
138c++.start.encap: g++$(exeext)
8c5c575d 139c++.rest.encap: $(DEMANGLER_PROG)
6e498b5c 140
141c++.info:
142c++.dvi:
3cc0b4b9 143
144# C++ language-support library pieces for libgcc.
2848c1dc 145tinfo.o: cc1plus$(exeext) $(srcdir)/cp/tinfo.cc
50c90ccd 146 $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(CXXFLAGS) $(INCLUDES) \
3cc0b4b9 147 -c $(srcdir)/cp/tinfo.cc
2848c1dc 148tinfo2.o: cc1plus$(exeext) $(srcdir)/cp/tinfo2.cc
50c90ccd 149 $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(CXXFLAGS) $(INCLUDES) \
3cc0b4b9 150 -c $(srcdir)/cp/tinfo2.cc
2848c1dc 151exception.o: cc1plus$(exeext) $(srcdir)/cp/exception.cc
50c90ccd 152 $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(CXXFLAGS) $(INCLUDES) \
c76251c1 153 -c -fexceptions $(srcdir)/cp/exception.cc
2848c1dc 154new.o: cc1plus$(exeext) $(srcdir)/cp/new.cc
50c90ccd 155 $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(CXXFLAGS) $(INCLUDES) \
3cc0b4b9 156 -c $(srcdir)/cp/new.cc
2848c1dc 157opnew.o: cc1plus$(exeext) $(srcdir)/cp/new1.cc
50c90ccd 158 $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(CXXFLAGS) $(INCLUDES) \
4b7a79e2 159 -c $(srcdir)/cp/new1.cc -DL_op_new -o opnew.o
2848c1dc 160opnewnt.o: cc1plus$(exeext) $(srcdir)/cp/new1.cc
50c90ccd 161 $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(CXXFLAGS) $(INCLUDES) \
4b7a79e2 162 -c $(srcdir)/cp/new1.cc -DL_op_newnt -o opnewnt.o
2848c1dc 163opvnew.o: cc1plus$(exeext) $(srcdir)/cp/new2.cc
50c90ccd 164 $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(CXXFLAGS) $(INCLUDES) \
4b7a79e2 165 -c $(srcdir)/cp/new2.cc -DL_op_vnew -o opvnew.o
2848c1dc 166opvnewnt.o: cc1plus$(exeext) $(srcdir)/cp/new2.cc
50c90ccd 167 $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(CXXFLAGS) $(INCLUDES) \
4b7a79e2 168 -c $(srcdir)/cp/new2.cc -DL_op_vnewnt -o opvnewnt.o
2848c1dc 169opdel.o: cc1plus$(exeext) $(srcdir)/cp/new2.cc
50c90ccd 170 $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(CXXFLAGS) $(INCLUDES) \
4b7a79e2 171 -c $(srcdir)/cp/new2.cc -DL_op_delete -o opdel.o
2848c1dc 172opdelnt.o: cc1plus$(exeext) $(srcdir)/cp/new2.cc
50c90ccd 173 $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(CXXFLAGS) $(INCLUDES) \
4b7a79e2 174 -c $(srcdir)/cp/new2.cc -DL_op_delnt -o opdelnt.o
2848c1dc 175opvdel.o: cc1plus$(exeext) $(srcdir)/cp/new2.cc
50c90ccd 176 $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(CXXFLAGS) $(INCLUDES) \
4b7a79e2 177 -c $(srcdir)/cp/new2.cc -DL_op_vdel -o opvdel.o
2848c1dc 178opvdelnt.o: cc1plus$(exeext) $(srcdir)/cp/new2.cc
50c90ccd 179 $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(CXXFLAGS) $(INCLUDES) \
4b7a79e2 180 -c $(srcdir)/cp/new2.cc -DL_op_vdelnt -o opvdelnt.o
3cc0b4b9 181
182# We want to update cplib2.txt if any of the source files change...
183cplib2.txt: $(CXX_LIB2SRCS) $(CXX_EXTRA_HEADERS) cplib2.ready
003da05e 184 case " $(LANGUAGES) " in \
185 *" "[cC]"++ "*) \
186 echo $(CXX_LIB2FUNCS) > cplib2.new;; \
187 *) \
188 echo "" > cplib2.new;; \
189 esac
3cc0b4b9 190 mv -f cplib2.new cplib2.txt
191
192# Or if it would be different.
858f0ad8 193cplib2.ready: $(GCC_PASSES) $(LANGUAGES) $(LIBGCC2_DEPS) stmp-int-hdrs
3cc0b4b9 194 @if [ -r cplib2.txt ]; then \
003da05e 195 case " $(LANGUAGES) " in \
196 *" "[cC]"++ "*) \
197 echo $(CXX_LIB2FUNCS) > cplib2.new;; \
198 *) \
199 echo "" > cplib2.new;; \
200 esac; \
f17e56ef 201 if cmp -s cplib2.new cplib2.txt; then true; else \
3cc0b4b9 202 touch cplib2.ready; \
203 fi; \
204 rm -f cplib2.new; \
860740a7 205 else true ; \
3cc0b4b9 206 fi
207 @if [ -f cplib2.ready ]; then true; else \
208 touch cplib2.ready; \
209 fi
6686e84d 210#\f
6e498b5c 211# Install hooks:
212# cc1plus is installed elsewhere as part of $(COMPILERS).
213
214# Nothing to do here.
215c++.install-normal:
216
217# Install the driver program as $(target)-g++
218# and also as either g++ (if native) or $(tooldir)/bin/g++.
219c++.install-common:
75c3e7b2 220 -if [ -f cc1plus$(exeext) ] ; then \
221 if [ -f g++-cross$(exeext) ] ; then \
222 rm -f $(bindir)/$(GXX_CROSS_NAME)$(exeext); \
223 $(INSTALL_PROGRAM) g++-cross$(exeext) $(bindir)/$(GXX_CROSS_NAME)$(exeext); \
224 chmod a+x $(bindir)/$(GXX_CROSS_NAME)$(exeext); \
225 rm -f $(bindir)/$(CXX_CROSS_NAME)$(exeext); \
ea4a6c81 226 $(LN) $(bindir)/$(GXX_CROSS_NAME)$(exeext) $(bindir)/$(CXX_CROSS_NAME)$(exeext); \
6e498b5c 227 else \
75c3e7b2 228 rm -f $(bindir)/$(GXX_INSTALL_NAME)$(exeext); \
229 $(INSTALL_PROGRAM) g++$(exeext) $(bindir)/$(GXX_INSTALL_NAME)$(exeext); \
230 chmod a+x $(bindir)/$(GXX_INSTALL_NAME)$(exeext); \
231 rm -f $(bindir)/$(CXX_INSTALL_NAME)$(exeext); \
ea4a6c81 232 $(LN) $(bindir)/$(GXX_INSTALL_NAME)$(exeext) $(bindir)/$(CXX_INSTALL_NAME)$(exeext); \
6e498b5c 233 fi ; \
0fc25c4b 234 if [ x$(DEMANGLER_PROG) != x ] && [ -x "$(DEMANGLER_PROG)" ]; then \
235 if [ -f g++-cross$(exeext) ] ; then \
236 rm -f $(bindir)/$(DEMANGLER_CROSS_NAME)$(exeext); \
237 $(INSTALL_PROGRAM) $(DEMANGLER_PROG) $(bindir)/$(DEMANGLER_CROSS_NAME)$(exeext); \
238 chmod a+x $(bindir)/$(DEMANGLER_CROSS_NAME)$(exeext); \
239 else \
240 rm -f $(bindir)/$(DEMANGLER_INSTALL_NAME)$(exeext); \
241 $(INSTALL_PROGRAM) $(DEMANGLER_PROG) $(bindir)/$(DEMANGLER_INSTALL_NAME)$(exeext); \
242 chmod a+x $(bindir)/$(DEMANGLER_INSTALL_NAME)$(exeext); \
243 fi ; \
244 fi ; \
6e498b5c 245 fi
246
247c++.install-info:
248
249c++.install-man: $(srcdir)/cp/g++.1
75c3e7b2 250 -if [ -f cc1plus$(exeext) ] ; then \
a14eefe6 251 if [ -f g++-cross$(exeext) ] ; then \
3cf6a465 252 rm -f $(man1dir)/$(GXX_CROSS_NAME)$(manext); \
253 $(INSTALL_DATA) $(srcdir)/cp/g++.1 $(man1dir)/$(GXX_CROSS_NAME)$(manext); \
254 chmod a-x $(man1dir)/$(GXX_CROSS_NAME)$(manext); \
21ee5f65 255 else \
3cf6a465 256 rm -f $(man1dir)/$(GXX_INSTALL_NAME)$(manext); \
257 $(INSTALL_DATA) $(srcdir)/cp/g++.1 $(man1dir)/$(GXX_INSTALL_NAME)$(manext); \
258 chmod a-x $(man1dir)/$(GXX_INSTALL_NAME)$(manext); \
21ee5f65 259 fi; \
6e498b5c 260 else true; fi
261
262c++.uninstall:
75c3e7b2 263 -rm -rf $(bindir)/$(CXX_INSTALL_NAME)$(exeext)
264 -rm -rf $(bindir)/$(CXX_CROSS_NAME)$(exeext)
265 -rm -rf $(bindir)/$(GXX_INSTALL_NAME)$(exeext)
266 -rm -rf $(bindir)/$(GXX_CROSS_NAME)$(exeext)
0fc25c4b 267 -rm -rf $(bindir)/$(DEMANGLER_INSTALL_NAME)$(exeext)
268 -rm -rf $(bindir)/$(DEMANGLER_CROSS_NAME)$(exeext)
3cf6a465 269 -rm -rf $(man1dir)/$(GXX_INSTALL_NAME)$(manext)
270 -rm -rf $(man1dir)/$(GXX_CROSS_NAME)$(manext)
6686e84d 271#\f
6e498b5c 272# Clean hooks:
273# A lot of the ancillary files are deleted by the main makefile.
274# We just have to delete files specific to us.
275
276c++.mostlyclean:
1480d19b 277 -rm -f cp/*$(objext) $(DEMANGLER_PROG)
6e498b5c 278c++.clean:
3cc0b4b9 279 -rm -f cplib2.txt cplib2.ready
6e498b5c 280c++.distclean:
281 -rm -f cp/config.status cp/Makefile
282 -rm -f cp/parse.output
39c8ac16 283 -rm -f g++.c
6e498b5c 284c++.extraclean:
a8514488 285c++.maintainer-clean:
6e498b5c 286 -rm -f cp/parse.c cp/parse.h
6686e84d 287#\f
6e498b5c 288# Stage hooks:
289# The main makefile has already created stage?/cp.
290
860740a7 291c++.stage1: stage1-start
a14eefe6 292 -mv cp/*$(objext) stage1/cp
860740a7 293c++.stage2: stage2-start
a14eefe6 294 -mv cp/*$(objext) stage2/cp
860740a7 295c++.stage3: stage3-start
a14eefe6 296 -mv cp/*$(objext) stage3/cp
860740a7 297c++.stage4: stage4-start
a14eefe6 298 -mv cp/*$(objext) stage4/cp
6686e84d 299#\f
6e498b5c 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.
304c++.distdir:
e607544c 305 mkdir tmp/cp
edf8c644 306 mkdir tmp/cp/inc
6e498b5c 307 cd cp ; $(MAKE) $(FLAGS_TO_PASS) $(CXX_FLAGS_TO_PASS) parse.c hash.h
308 cd cp; \
309 for file in *[0-9a-zA-Z+]; do \
ea4a6c81 310 $(LN) $$file ../tmp/cp; \
6e498b5c 311 done
edf8c644 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