]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/cp/Make-lang.in
* diagnostic-core.h: Include bversion.h.
[thirdparty/gcc.git] / gcc / cp / Make-lang.in
CommitLineData
90a83261 1# Top level -*- makefile -*- fragment for GNU C++.
f7ef2277 2# Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
7cf0dbf3 3# 2005, 2007, 2008, 2009, 2010
9ed9ebfd 4# Free Software Foundation, Inc.
6e498b5c 5
5d1e9c98 6#This file is part of GCC.
6e498b5c 7
5d1e9c98 8#GCC is free software; you can redistribute it and/or modify
6e498b5c 9#it under the terms of the GNU General Public License as published by
aa139c3f 10#the Free Software Foundation; either version 3, or (at your option)
6e498b5c 11#any later version.
12
5d1e9c98 13#GCC is distributed in the hope that it will be useful,
6e498b5c 14#but WITHOUT ANY WARRANTY; without even the implied warranty of
15#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16#GNU General Public License for more details.
17
aa139c3f 18# You should have received a copy of the GNU General Public License
19# along with GCC; see the file COPYING3. If not see
20# <http://www.gnu.org/licenses/>.
6e498b5c 21
22# This file provides the language dependent support in the main Makefile.
23# Each language makefile fragment must provide the following targets:
24#
ae6555f9 25# foo.all.cross, foo.start.encap, foo.rest.encap,
26e296a8 26# foo.install-common, foo.install-man, foo.install-info, foo.install-pdf,
fb433b0b 27# foo.install-html, foo.info, foo.dvi, foo.pdf, foo.html, foo.uninstall,
80e909c6 28# foo.mostlyclean, foo.clean, foo.distclean,
a8514488 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.
6e498b5c 38
ddb9bca7 39# Actual names to use when installing a native compiler.
88a86c80 40CXX_INSTALL_NAME := $(shell echo c++|sed '$(program_transform_name)')
41GXX_INSTALL_NAME := $(shell echo g++|sed '$(program_transform_name)')
42CXX_TARGET_INSTALL_NAME := $(target_noncanonical)-$(shell echo c++|sed '$(program_transform_name)')
43GXX_TARGET_INSTALL_NAME := $(target_noncanonical)-$(shell echo g++|sed '$(program_transform_name)')
c02b6f4e 44CP_PLUGIN_HEADERS := cp-tree.h cxx-pretty-print.h name-lookup.h
ddb9bca7 45
6686e84d 46#\f
6e498b5c 47# Define the names for selecting c++ in LANGUAGES.
48# Note that it would be nice to move the dependency on g++
49# into the C++ rule, but that needs a little bit of work
50# to do the right thing within all.cross.
9f30f9e7 51c++: cc1plus$(exeext)
6e498b5c 52
c9db0571 53# Tell GNU make to ignore these if they exist.
9f30f9e7 54.PHONY: c++
c9db0571 55
cb22f930 56g++spec.o: $(srcdir)/cp/g++spec.c $(SYSTEM_H) coretypes.h $(TM_H) $(GCC_H) \
3c6c0e40 57 $(CONFIG_H) $(OPTS_H)
21886706 58 (SHLIB_LINK='$(SHLIB_LINK)'; \
585d4848 59 $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(DRIVER_DEFINES) \
21886706 60 $(INCLUDES) $(srcdir)/cp/g++spec.c)
b0df6589 61
6e498b5c 62# Create the compiler driver for g++.
21886706 63GXX_OBJS = $(GCC_OBJS) g++spec.o intl.o prefix.o version.o
be2828ce 64g++$(exeext): $(GXX_OBJS) $(EXTRA_GCC_OBJS) $(LIBDEPS)
70293f47 65 +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
be2828ce 66 $(GXX_OBJS) $(EXTRA_GCC_OBJS) $(LIBS)
6e498b5c 67
68# Create a version of the g++ driver which calls the cross-compiler.
b0df6589 69g++-cross$(exeext): g++$(exeext)
70 -rm -f g++-cross$(exeext)
71 cp g++$(exeext) g++-cross$(exeext)
6e498b5c 72
f357ac87 73# The compiler itself.
74# Shared with C front end:
7bedc3a0 75CXX_C_OBJS = attribs.o incpath.o prefix.o \
76 $(C_COMMON_OBJS) $(CXX_TARGET_OBJS)
f357ac87 77
11a35d8f 78# Language-specific object files for C++ and Objective C++.
79CXX_AND_OBJCXX_OBJS = cp/call.o cp/decl.o cp/expr.o cp/pt.o cp/typeck2.o \
0a3b29ad 80 cp/class.o cp/decl2.o cp/error.o cp/lex.o cp/parser.o cp/ptree.o cp/rtti.o \
81 cp/typeck.o cp/cvt.o cp/except.o cp/friend.o cp/init.o cp/method.o \
0de2b732 82 cp/search.o cp/semantics.o cp/tree.o cp/repo.o cp/dump.o cp/optimize.o \
5dd72fac 83 cp/mangle.o cp/cp-objcp-common.o cp/name-lookup.o cp/cxx-pretty-print.o \
11a35d8f 84 cp/cp-gimplify.o tree-mudflap.o $(CXX_C_OBJS)
85
86# Language-specific object files for C++.
7bedc3a0 87CXX_OBJS = cp/cp-lang.o c-family/stub-objc.o $(CXX_AND_OBJCXX_OBJS)
f357ac87 88
18cfeada 89c++_OBJS = $(CXX_OBJS) cc1plus-checksum.o cp/g++spec.o
6fb2153a 90
9e91bfe8 91# Use strict warnings for this front end.
9d61b2aa 92cp-warn = $(STRICT_WARN)
f357ac87 93
18cfeada 94# compute checksum over all object files and the options
95cc1plus-checksum.c : build/genchecksum$(build_exeext) checksum-options \
96 $(CXX_OBJS) $(BACKEND) $(LIBDEPS)
97 build/genchecksum$(build_exeext) $(CXX_OBJS) $(BACKEND) $(LIBDEPS) \
98 checksum-options > cc1plus-checksum.c.tmp && \
99 $(srcdir)/../move-if-change cc1plus-checksum.c.tmp cc1plus-checksum.c
f1035767 100
cd819d2f 101cc1plus-checksum.o : cc1plus-checksum.c $(CONFIG_H) $(SYSTEM_H)
21886706 102
f1035767 103cc1plus$(exeext): $(CXX_OBJS) cc1plus-checksum.o $(BACKEND) $(LIBDEPS)
70293f47 104 +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
268a100a 105 $(CXX_OBJS) cc1plus-checksum.o $(BACKEND) $(LIBS) $(BACKENDLIBS)
f357ac87 106
107# Special build rules.
108$(srcdir)/cp/cfns.h: $(srcdir)/cp/cfns.gperf
f82b06e0 109 gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L ANSI-C \
f357ac87 110 $(srcdir)/cp/cfns.gperf > $(srcdir)/cp/cfns.h
111
6686e84d 112#\f
6e498b5c 113# Build hooks:
114
05988adb 115c++.all.cross: g++-cross$(exeext)
02d7f858 116c++.start.encap: g++$(exeext)
05988adb 117c++.rest.encap:
ca6eabd1 118c++.info:
352ea6ae 119c++.install-info:
120c++.dvi:
51f93521 121c++.pdf:
26e296a8 122c++.install-pdf:
fb433b0b 123c++.install-html:
352ea6ae 124c++.html:
ca6eabd1 125c++.srcinfo:
a6b4c5a9 126c++.srcextra:
6e498b5c 127
975d01b5 128c++.tags: force
39aebbc3 129 cd $(srcdir)/cp; etags -o TAGS.sub *.c *.h --language=none \
130 --regex='/DEFTREECODE [(]\([A-Z_]+\)/\1/' cp-tree.def; \
131 etags --include TAGS.sub --include ../TAGS.sub
975d01b5 132
ca6eabd1 133c++.man: doc/g++.1
134
135c++.srcman: doc/g++.1
136 -cp -p $^ $(srcdir)/doc
215d428d 137
a00dec3b 138# 'make check' in gcc/ looks for check-c++, as do all toplevel C++-related
139# check targets. However, our DejaGNU framework requires 'check-g++' as its
140# entry point. We feed the former to the latter here.
71a3866b 141check-c++ : check-g++
a0d20ccb 142check-c++-subtargets : check-g++-subtargets
a00dec3b 143# List of targets that can use the generic check- rule and its // variant.
71a3866b 144lang_checks += check-g++
a0d20ccb 145lang_checks_parallelized += check-g++
146# For description see comment above check_gcc_parallelize in gcc/Makefile.in.
147check_g++_parallelize = old-deja.exp dg.exp
71a3866b 148
6686e84d 149#\f
6e498b5c 150# Install hooks:
151# cc1plus is installed elsewhere as part of $(COMPILERS).
152
6e498b5c 153# Install the driver program as $(target)-g++
154# and also as either g++ (if native) or $(tooldir)/bin/g++.
414d46fe 155c++.install-common: installdirs
994974c8 156 -rm -f $(DESTDIR)$(bindir)/$(GXX_INSTALL_NAME)$(exeext)
157 -$(INSTALL_PROGRAM) g++$(exeext) $(DESTDIR)$(bindir)/$(GXX_INSTALL_NAME)$(exeext)
158 -chmod a+x $(DESTDIR)$(bindir)/$(GXX_INSTALL_NAME)$(exeext)
159 -rm -f $(DESTDIR)$(bindir)/$(CXX_INSTALL_NAME)$(exeext)
160 -( cd $(DESTDIR)$(bindir) && \
161 $(LN) $(GXX_INSTALL_NAME)$(exeext) $(CXX_INSTALL_NAME)$(exeext) )
75c3e7b2 162 -if [ -f cc1plus$(exeext) ] ; then \
163 if [ -f g++-cross$(exeext) ] ; then \
b113996a 164 if [ -d $(DESTDIR)$(gcc_tooldir)/bin/. ] ; then \
165 rm -f $(DESTDIR)$(gcc_tooldir)/bin/g++$(exeext); \
166 $(INSTALL_PROGRAM) g++-cross$(exeext) $(DESTDIR)$(gcc_tooldir)/bin/g++$(exeext); \
167 rm -f $(DESTDIR)$(gcc_tooldir)/bin/c++$(exeext); \
168 ( cd $(DESTDIR)$(gcc_tooldir)/bin && \
653e5405 169 $(LN) g++$(exeext) c++$(exeext) ); \
f608fc6d 170 else true; fi; \
6e498b5c 171 else \
b113996a 172 rm -f $(DESTDIR)$(bindir)/$(GXX_TARGET_INSTALL_NAME)$(exeext); \
173 ( cd $(DESTDIR)$(bindir) && \
174 $(LN) $(GXX_INSTALL_NAME)$(exeext) $(GXX_TARGET_INSTALL_NAME)$(exeext) ); \
175 rm -f $(DESTDIR)$(bindir)/$(CXX_TARGET_INSTALL_NAME)$(exeext); \
176 ( cd $(DESTDIR)$(bindir) && \
177 $(LN) $(CXX_INSTALL_NAME)$(exeext) $(CXX_TARGET_INSTALL_NAME)$(exeext) ); \
6e498b5c 178 fi ; \
179 fi
180
0182edfd 181# We can't use links because not everyone supports them, and we can't use
182# .so because Irix 6.5 doesn't support them. So just copy the manpage.
ca6eabd1 183doc/g++.1: doc/gcc.1
49e86385 184 cp $< doc/g++.1
a7a78208 185
9031d10b 186c++.install-man: $(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext)
ca6eabd1 187
01ac74a6 188$(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext): doc/g++.1 installdirs
ca6eabd1 189 -rm -f $@
190 -$(INSTALL_DATA) $< $@
191 -chmod a-x $@
6e498b5c 192
c02b6f4e 193c++.install-plugin: installdirs
194# We keep the directory structure for files in config and .def files. All
195# other files are flattened to a single directory.
196 headers="$(CP_PLUGIN_HEADERS)"; \
197 for file in $$headers; do \
198 path=$(srcdir)/cp/$$file; \
199 dest=$(plugin_includedir)/cp/$$file; \
200 echo $(INSTALL_DATA) $$path $(DESTDIR)$$dest; \
201 dir=`dirname $$dest`; \
202 $(mkinstalldirs) $(DESTDIR)$$dir; \
203 $(INSTALL_DATA) $$path $(DESTDIR)$$dest; \
204 done
205
6e498b5c 206c++.uninstall:
b113996a 207 -rm -rf $(DESTDIR)$(bindir)/$(CXX_INSTALL_NAME)$(exeext)
b113996a 208 -rm -rf $(DESTDIR)$(bindir)/$(GXX_INSTALL_NAME)$(exeext)
b113996a 209 -rm -rf $(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext)
6686e84d 210#\f
6e498b5c 211# Clean hooks:
212# A lot of the ancillary files are deleted by the main makefile.
213# We just have to delete files specific to us.
214
215c++.mostlyclean:
ca6eabd1 216 -rm -f doc/g++.1
05988adb 217 -rm -f cp/*$(objext)
d5a37d75 218 -rm -f cp/*$(coverageexts)
6e498b5c 219c++.clean:
220c++.distclean:
221 -rm -f cp/config.status cp/Makefile
a8514488 222c++.maintainer-clean:
6686e84d 223#\f
6e498b5c 224# Stage hooks:
225# The main makefile has already created stage?/cp.
226
860740a7 227c++.stage1: stage1-start
a14eefe6 228 -mv cp/*$(objext) stage1/cp
860740a7 229c++.stage2: stage2-start
a14eefe6 230 -mv cp/*$(objext) stage2/cp
860740a7 231c++.stage3: stage3-start
a14eefe6 232 -mv cp/*$(objext) stage3/cp
860740a7 233c++.stage4: stage4-start
a14eefe6 234 -mv cp/*$(objext) stage4/cp
ef3bb540 235c++.stageprofile: stageprofile-start
236 -mv cp/*$(objext) stageprofile/cp
237c++.stagefeedback: stagefeedback-start
238 -mv cp/*$(objext) stagefeedback/cp
21886706 239
240#\f
241# .o: .h dependencies.
242CXX_TREE_H = $(TREE_H) cp/name-lookup.h cp/cp-tree.h $(C_COMMON_H) \
3f9da559 243 $(FUNCTION_H) \
21886706 244 $(SYSTEM_H) coretypes.h $(CONFIG_H) $(TARGET_H) $(GGC_H) \
c4b9c21a 245 $(srcdir)/../include/hashtab.h
21886706 246
247CXX_PRETTY_PRINT_H = cp/cxx-pretty-print.h $(C_PRETTY_PRINT_H)
248
249cp/lex.o: cp/lex.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) \
250 $(C_PRAGMA_H) toplev.h output.h input.h cp/operators.def $(TM_P_H)
92468061 251cp/cp-lang.o: cp/cp-lang.c $(CXX_TREE_H) $(TM_H) debug.h langhooks.h \
bb87f728 252 $(LANGHOOKS_DEF_H) $(C_COMMON_H) gtype-cp.h gt-cp-cp-lang.h \
cc7d6aed 253 cp/cp-objcp-common.h $(EXPR_H) $(TARGET_H)
21886706 254cp/decl.o: cp/decl.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) cp/decl.h \
596981c8 255 output.h toplev.h $(HASHTAB_H) $(RTL_H) \
21886706 256 cp/operators.def $(TM_P_H) $(TREE_INLINE_H) $(DIAGNOSTIC_H) $(C_PRAGMA_H) \
9b40bfbf 257 debug.h gt-cp-decl.h $(TIMEVAR_H) $(TARGET_H) $(PLUGIN_H) \
c4b9c21a 258 intl.h tree-iterator.h $(SPLAY_TREE_H)
259cp/decl2.o: cp/decl2.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) cp/decl.h \
596981c8 260 output.h toplev.h $(C_COMMON_H) gt-cp-decl2.h $(CGRAPH_H) \
c4b9c21a 261 $(C_PRAGMA_H) $(TREE_DUMP_H) intl.h $(TARGET_H) $(GIMPLE_H) $(POINTER_SET_H) \
7bedc3a0 262 $(SPLAY_TREE_H) c-family/c-ada-spec.h
21886706 263cp/cp-objcp-common.o : cp/cp-objcp-common.c $(CONFIG_H) $(SYSTEM_H) \
264 coretypes.h $(TM_H) $(TREE_H) $(CXX_TREE_H) $(C_COMMON_H) toplev.h \
265 langhooks.h $(LANGHOOKS_DEF_H) $(DIAGNOSTIC_H) debug.h \
266 $(CXX_PRETTY_PRINT_H) cp/cp-objcp-common.h gt-cp-cp-objcp-common.h
92468061 267cp/typeck2.o: cp/typeck2.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) output.h \
852f689e 268 $(TM_P_H) $(DIAGNOSTIC_CORE_H) gt-cp-typeck2.h $(REAL_H) intl.h
c4b9c21a 269cp/typeck.o: cp/typeck.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) \
270 toplev.h $(DIAGNOSTIC_H) convert.h $(C_COMMON_H) $(TARGET_H) \
271 output.h toplev.h
272cp/class.o: cp/class.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) toplev.h \
273 $(TARGET_H) convert.h $(CGRAPH_H) $(TREE_DUMP_H) gt-cp-class.h \
274 $(SPLAY_TREE_H)
275cp/call.o: cp/call.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) toplev.h \
852f689e 276 $(DIAGNOSTIC_CORE_H) intl.h gt-cp-call.h convert.h $(TARGET_H) langhooks.h
92468061 277cp/friend.o: cp/friend.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H)
c4b9c21a 278cp/init.o: cp/init.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) \
92468061 279 $(EXCEPT_H) $(TARGET_H)
c4b9c21a 280cp/method.o: cp/method.c $(CXX_TREE_H) $(TM_H) toplev.h \
28454517 281 $(TM_P_H) $(TARGET_H) $(DIAGNOSTIC_H) gt-cp-method.h $(GIMPLE_H)
92468061 282cp/cvt.o: cp/cvt.c $(CXX_TREE_H) $(TM_H) cp/decl.h $(FLAGS_H) \
ca82e026 283 convert.h $(TARGET_H) intl.h
c4b9c21a 284cp/search.o: cp/search.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) toplev.h \
ca82e026 285 intl.h
92468061 286cp/tree.o: cp/tree.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) \
c4b9c21a 287 $(TREE_INLINE_H) $(REAL_H) gt-cp-tree.h \
9b40bfbf 288 $(TARGET_H) debug.h $(CGRAPH_H) $(SPLAY_TREE_H) $(GIMPLE_H)
21886706 289cp/ptree.o: cp/ptree.c $(CXX_TREE_H) $(TM_H)
92468061 290cp/rtti.o: cp/rtti.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) convert.h \
5c892d4a 291 $(TARGET_H) $(C_PRAGMA_H) gt-cp-rtti.h intl.h
596981c8 292cp/except.o: cp/except.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) \
92468061 293 cp/cfns.h $(TREE_INLINE_H) $(TARGET_H)
294cp/expr.o: cp/expr.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) $(TM_P_H)
21886706 295cp/pt.o: cp/pt.c $(CXX_TREE_H) $(TM_H) cp/decl.h cp/cp-objcp-common.h \
596981c8 296 toplev.h $(TREE_INLINE_H) pointer-set.h gt-cp-pt.h vecprim.h intl.h
92468061 297cp/error.o: cp/error.c $(CXX_TREE_H) $(TM_H) $(DIAGNOSTIC_H) \
ce084dfc 298 $(FLAGS_H) $(REAL_H) $(LANGHOOKS_DEF_H) $(CXX_PRETTY_PRINT_H) \
299 tree-diagnostic.h tree-pretty-print.h
852f689e 300cp/repo.o: cp/repo.c $(CXX_TREE_H) $(TM_H) toplev.h $(DIAGNOSTIC_CORE_H) \
21886706 301 gt-cp-repo.h
596981c8 302cp/semantics.o: cp/semantics.c $(CXX_TREE_H) $(TM_H) toplev.h \
c4b9c21a 303 $(FLAGS_H) output.h $(RTL_H) $(TIMEVAR_H) \
46bd81af 304 $(TREE_INLINE_H) $(CGRAPH_H) $(TARGET_H) $(C_COMMON_H) $(GIMPLE_H) \
0f71a633 305 bitmap.h gt-cp-semantics.h
21886706 306cp/dump.o: cp/dump.c $(CXX_TREE_H) $(TM_H) $(TREE_DUMP_H)
c4b9c21a 307cp/optimize.o: cp/optimize.c $(CXX_TREE_H) $(TM_H) \
308 input.h $(PARAMS_H) debug.h $(TREE_INLINE_H) $(GIMPLE_H) \
852f689e 309 $(TARGET_H) tree-iterator.h $(CGRAPH_H) $(DIAGNOSTIC_CORE_H)
92468061 310cp/mangle.o: cp/mangle.c $(CXX_TREE_H) $(TM_H) $(REAL_H) \
20009fe3 311 gt-cp-mangle.h $(TARGET_H) $(TM_P_H) $(CGRAPH_H)
852f689e 312cp/parser.o: cp/parser.c $(CXX_TREE_H) $(TM_H) $(DIAGNOSTIC_CORE_H) \
313 gt-cp-parser.h output.h $(TARGET_H) $(PLUGIN_H) intl.h
92468061 314cp/cp-gimplify.o: cp/cp-gimplify.c $(CXX_TREE_H) $(C_COMMON_H) \
75a70cf9 315 $(TM_H) coretypes.h pointer-set.h tree-iterator.h
21886706 316
317cp/name-lookup.o: cp/name-lookup.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
92468061 318 $(TM_H) $(CXX_TREE_H) $(TIMEVAR_H) gt-cp-name-lookup.h \
852f689e 319 $(DIAGNOSTIC_CORE_H) $(FLAGS_H) debug.h
21886706 320
321cp/cxx-pretty-print.o: cp/cxx-pretty-print.c $(CXX_PRETTY_PRINT_H) \
ce084dfc 322 $(CONFIG_H) $(SYSTEM_H) $(TM_H) coretypes.h $(CXX_TREE_H) tree-pretty-print.h