Remove assert in get_def_bb_for_const
[official-gcc.git] / gcc / cp / Make-lang.in
blob625a77c53867abc33531f3c66af29a807f273c03
1 # Top level -*- makefile -*- fragment for GNU C++.
2 #   Copyright (C) 1994-2016 Free Software Foundation, Inc.
4 #This file is part of GCC.
6 #GCC 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 3, or (at your option)
9 #any later version.
11 #GCC 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.
16 # You should have received a copy of the GNU General Public License
17 # along with GCC; see the file COPYING3.  If not see
18 # <http://www.gnu.org/licenses/>.
20 # This file provides the language dependent support in the main Makefile.
21 # Each language makefile fragment must provide the following targets:
23 # foo.all.cross, foo.start.encap, foo.rest.encap,
24 # foo.install-common, foo.install-man, foo.install-info, foo.install-pdf,
25 # foo.install-html, foo.info, foo.dvi, foo.pdf, foo.html, foo.uninstall,
26 # foo.mostlyclean, foo.clean, foo.distclean,
27 # foo.maintainer-clean, foo.stage1, foo.stage2, foo.stage3, foo.stage4
29 # where `foo' is the name of the language.
31 # It should also provide rules for:
33 # - making any compiler driver (eg: g++)
34 # - the compiler proper (eg: cc1plus)
35 # - define the names for selecting the language in LANGUAGES.
37 # Actual names to use when installing a native compiler.
38 CXX_INSTALL_NAME := $(shell echo c++|sed '$(program_transform_name)')
39 GXX_INSTALL_NAME := $(shell echo g++|sed '$(program_transform_name)')
40 CXX_TARGET_INSTALL_NAME := $(target_noncanonical)-$(shell echo c++|sed '$(program_transform_name)')
41 GXX_TARGET_INSTALL_NAME := $(target_noncanonical)-$(shell echo g++|sed '$(program_transform_name)')
42 CP_PLUGIN_HEADERS := cp-tree.h cxx-pretty-print.h name-lookup.h type-utils.h
44 #\f
45 # Define the names for selecting c++ in LANGUAGES.
46 # Note that it would be nice to move the dependency on g++
47 # into the C++ rule, but that needs a little bit of work
48 # to do the right thing within all.cross.
49 c++: cc1plus$(exeext)
51 # Tell GNU make to ignore these if they exist.
52 .PHONY: c++
54 CFLAGS-cp/g++spec.o += $(DRIVER_DEFINES)
56 # Create the compiler driver for g++.
57 GXX_OBJS = $(GCC_OBJS) cp/g++spec.o
58 xg++$(exeext): $(GXX_OBJS) $(EXTRA_GCC_OBJS) libcommon-target.a $(LIBDEPS)
59         +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
60           $(GXX_OBJS) $(EXTRA_GCC_OBJS) libcommon-target.a \
61           $(EXTRA_GCC_LIBS) $(LIBS)
63 # Create a version of the g++ driver which calls the cross-compiler.
64 g++-cross$(exeext): xg++$(exeext)
65         -rm -f g++-cross$(exeext)
66         cp xg++$(exeext) g++-cross$(exeext)
68 # The compiler itself.
69 # Shared with C front end:
70 CXX_C_OBJS = attribs.o incpath.o \
71         $(C_COMMON_OBJS) $(CXX_TARGET_OBJS)
73 # Language-specific object files for C++ and Objective C++.
74 CXX_AND_OBJCXX_OBJS = cp/call.o cp/decl.o cp/expr.o cp/pt.o cp/typeck2.o \
75  cp/class.o cp/decl2.o cp/error.o cp/lex.o cp/parser.o cp/ptree.o cp/rtti.o \
76  cp/typeck.o cp/cvt.o cp/except.o cp/friend.o cp/init.o cp/method.o \
77  cp/search.o cp/semantics.o cp/tree.o cp/repo.o cp/dump.o cp/optimize.o \
78  cp/mangle.o cp/cp-objcp-common.o cp/name-lookup.o cp/cxx-pretty-print.o \
79  cp/cp-cilkplus.o \
80  cp/cp-gimplify.o cp/cp-array-notation.o cp/lambda.o \
81  cp/vtable-class-hierarchy.o cp/constexpr.o cp/cp-ubsan.o \
82  cp/constraint.o cp/logic.o $(CXX_C_OBJS)
84 # Language-specific object files for C++.
85 CXX_OBJS = cp/cp-lang.o c-family/stub-objc.o $(CXX_AND_OBJCXX_OBJS)
87 c++_OBJS = $(CXX_OBJS) cc1plus-checksum.o cp/g++spec.o
89 # Use strict warnings for this front end.
90 cp-warn = $(STRICT_WARN)
92 # compute checksum over all object files and the options
93 # re-use the checksum from the prev-final stage so it passes
94 # the bootstrap comparison and allows comparing of the cc1 binary
95 cc1plus-checksum.c : build/genchecksum$(build_exeext) checksum-options \
96         $(CXX_OBJS) $(BACKEND) $(LIBDEPS) 
97         if [ -f ../stage_final ] \
98            && cmp -s ../stage_current ../stage_final; then \
99            cp ../prev-gcc/cc1plus-checksum.c cc1plus-checksum.c; \
100         else \
101           build/genchecksum$(build_exeext) $(CXX_OBJS) $(BACKEND) $(LIBDEPS) \
102                      checksum-options > cc1plus-checksum.c.tmp &&          \
103           $(srcdir)/../move-if-change cc1plus-checksum.c.tmp cc1plus-checksum.c; \
104         fi
106 cc1plus$(exeext): $(CXX_OBJS) cc1plus-checksum.o $(BACKEND) $(LIBDEPS)
107         +$(LLINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \
108               $(CXX_OBJS) cc1plus-checksum.o $(BACKEND) $(LIBS) $(BACKENDLIBS)
110 ifeq ($(ENABLE_MAINTAINER_RULES), true)
111 # Special build rule.  This is a maintainer rule, that is only
112 # available when GCC is configured with --enable-maintainer-mode.  In
113 # other cases, it is not available to avoid triggering rebuilds if a
114 # user has the source checked out with unusual timestamps.
115 $(srcdir)/cp/cfns.h: $(srcdir)/cp/cfns.gperf
116 else
117 # We keep the rule so that you can still force a rebuild, even if you
118 # didn't configure GCC with --enable-maintainer-mode, by manually
119 # deleting the $(srcdir)/cp/cfns.h file.
120 $(srcdir)/cp/cfns.h:
121 endif
122         gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L C++ \
123                 $(srcdir)/cp/cfns.gperf --output-file $(srcdir)/cp/cfns.h
126 # Build hooks:
128 c++.all.cross: g++-cross$(exeext)
129 c++.start.encap: xg++$(exeext)
130 c++.rest.encap:
131 c++.info:
132 c++.install-info:
133 c++.dvi:
134 c++.pdf:
135 c++.install-pdf:
136 c++.install-html:
137 c++.html:
138 c++.srcinfo:
139 c++.srcextra:
141 c++.tags: force
142         cd $(srcdir)/cp; etags -o TAGS.sub *.c *.cc *.h --language=none \
143           --regex='/DEFTREECODE [(]\([A-Z_]+\)/\1/' cp-tree.def; \
144         etags --include TAGS.sub --include ../TAGS.sub
146 c++.man: doc/g++.1
148 c++.srcman: doc/g++.1
149         -cp -p $^ $(srcdir)/doc
151 # 'make check' in gcc/ looks for check-c++, as do all toplevel C++-related
152 # check targets.  However, our DejaGNU framework requires 'check-g++' as its
153 # entry point.  We feed the former to the latter here.
154 check-c++ : check-g++
156 # Run the testsuite in C++1z mode.
157 check-c++1z:
158         $(MAKE) GXX_TESTSUITE_STDS=1z check-g++
160 # Run the testsuite in all standard conformance levels.
161 check-c++-all:
162         $(MAKE) RUNTESTFLAGS="$(RUNTESTFLAGS) --stds=98,11,14,1z,concepts" check-g++
164 # Run the testsuite with garbage collection at every opportunity.
165 check-g++-strict-gc:
166         $(MAKE) RUNTESTFLAGS="$(RUNTESTFLAGS) --extra_opts,--param,ggc-min-heapsize=0,--param,ggc-min-expand=0" \
167           TESTSUITEDIR="$(TESTSUITEDIR).gc" check-g++
168 check-c++-subtargets : check-g++-subtargets
169 # List of targets that can use the generic check- rule and its // variant.
170 lang_checks += check-g++
171 lang_checks_parallelized += check-g++
172 # For description see the check_$lang_parallelize comment in gcc/Makefile.in.
173 check_g++_parallelize = 10000
175 # Install hooks:
176 # cc1plus is installed elsewhere as part of $(COMPILERS).
178 # Install the driver program as $(target)-g++ and $(target)-c++, and
179 # also as g++ and c++ if native.
180 c++.install-common: installdirs
181         -if test "$(enable_as_accelerator)" != "yes" ; then \
182           rm -f $(DESTDIR)$(bindir)/$(GXX_INSTALL_NAME)$(exeext); \
183           $(INSTALL_PROGRAM) xg++$(exeext) $(DESTDIR)$(bindir)/$(GXX_INSTALL_NAME)$(exeext); \
184           chmod a+x $(DESTDIR)$(bindir)/$(GXX_INSTALL_NAME)$(exeext); \
185           rm -f $(DESTDIR)$(bindir)/$(CXX_INSTALL_NAME)$(exeext); \
186           ( cd $(DESTDIR)$(bindir) && \
187             $(LN) $(GXX_INSTALL_NAME)$(exeext) $(CXX_INSTALL_NAME)$(exeext) ); \
188           if [ -f cc1plus$(exeext) ] ; then \
189             if [ ! -f g++-cross$(exeext) ] ; then \
190               rm -f $(DESTDIR)$(bindir)/$(GXX_TARGET_INSTALL_NAME)$(exeext); \
191               ( cd $(DESTDIR)$(bindir) && \
192                 $(LN) $(GXX_INSTALL_NAME)$(exeext) $(GXX_TARGET_INSTALL_NAME)$(exeext) ); \
193               rm -f $(DESTDIR)$(bindir)/$(CXX_TARGET_INSTALL_NAME)$(exeext); \
194               ( cd $(DESTDIR)$(bindir) && \
195                 $(LN) $(CXX_INSTALL_NAME)$(exeext) $(CXX_TARGET_INSTALL_NAME)$(exeext) ); \
196             fi ; \
197           fi; \
198         fi
200 # We can't use links because not everyone supports them.  So just copy the
201 # manpage.
202 doc/g++.1: doc/gcc.1
203         cp $< doc/g++.1
205 c++.install-man: $(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext)
207 $(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext): doc/g++.1 installdirs
208         -rm -f $@
209         -$(INSTALL_DATA) $< $@
210         -chmod a-x $@
212 c++.install-plugin: installdirs
213 # We keep the directory structure for files in config and .def files. All
214 # other files are flattened to a single directory.
215         headers="$(CP_PLUGIN_HEADERS)"; \
216         for file in $$headers; do \
217           path=$(srcdir)/cp/$$file; \
218           dest=$(plugin_includedir)/cp/$$file; \
219           echo $(INSTALL_DATA) $$path $(DESTDIR)$$dest; \
220           dir=`dirname $$dest`; \
221           $(mkinstalldirs) $(DESTDIR)$$dir; \
222           $(INSTALL_DATA) $$path $(DESTDIR)$$dest; \
223         done
225 c++.uninstall:
226         -rm -rf $(DESTDIR)$(bindir)/$(CXX_INSTALL_NAME)$(exeext)
227         -rm -rf $(DESTDIR)$(bindir)/$(GXX_INSTALL_NAME)$(exeext)
228         -rm -rf $(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext)
230 # Clean hooks:
231 # A lot of the ancillary files are deleted by the main makefile.
232 # We just have to delete files specific to us.
234 c++.mostlyclean:
235         -rm -f doc/g++.1
236         -rm -f cp/*$(objext)
237         -rm -f cp/*$(coverageexts)
238         -rm -f xg++$(exeext) g++-cross$(exeext) cc1plus$(exeext)
239 c++.clean:
240 c++.distclean:
241         -rm -f cp/config.status cp/Makefile
242         -rm -f cxxmain.c
243 c++.maintainer-clean:
245 # Stage hooks:
246 # The main makefile has already created stage?/cp.
248 c++.stage1: stage1-start
249         -mv cp/*$(objext) stage1/cp
250 c++.stage2: stage2-start
251         -mv cp/*$(objext) stage2/cp
252 c++.stage3: stage3-start
253         -mv cp/*$(objext) stage3/cp
254 c++.stage4: stage4-start
255         -mv cp/*$(objext) stage4/cp
256 c++.stageprofile: stageprofile-start
257         -mv cp/*$(objext) stageprofile/cp
258 c++.stagefeedback: stagefeedback-start
259         -mv cp/*$(objext) stagefeedback/cp