[committed][RISC-V] Remove errant hunk of code
[official-gcc.git] / c++tools / Makefile.in
blobdcb1029e064f91aecb65a40ac939465ccf3b553b
1 # Makefile for c++tools
2 # Copyright (C) 2020-2023 Free Software Foundation, Inc.
4 # This file is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; see the file COPYING3. If not see
16 # <http://www.gnu.org/licenses/>.
18 srcdir := @srcdir@
19 prefix := @prefix@
20 bindir := @bindir@
21 libexecdir := @libexecdir@
22 target_noncanonical := @target_noncanonical@
23 gcc_version := $(shell @get_gcc_base_ver@ $(srcdir)/../gcc/BASE-VER)
24 libexecsubdir := $(libexecdir)/gcc/$(target_noncanonical)/$(gcc_version)
25 INSTALL := @INSTALL@
26 INSTALL_PROGRAM := @INSTALL_PROGRAM@
27 INSTALL_STRIP_PROGRAM := $(srcdir)/../install-sh -c -s
28 AUTOCONF := @AUTOCONF@
29 AUTOHEADER := @AUTOHEADER@
30 CXX := @CXX@
31 CXXFLAGS := @CXXFLAGS@
32 PICFLAG := @PICFLAG@
33 LD_PICFLAG := @LD_PICFLAG@
34 CXXOPTS := $(CXXFLAGS) $(PICFLAG) -fno-exceptions -fno-rtti
35 LDFLAGS := @LDFLAGS@
36 exeext := @EXEEXT@
37 LIBIBERTY := ../libiberty/libiberty.a
38 NETLIBS := @NETLIBS@
39 VERSION.O := ../gcc/version.o
41 all::
43 mostlyclean::
44 rm -f $(MAPPER.O)
46 clean:: mostlyclean
47 rm -f g++-mapper-server$(exeext)
49 distclean:: clean
50 rm -f config.log config.status config.h config.cache Makefile
51 rm -f $(MAPPER.O:%.o=%.d)
53 maintainer-clean:: distclean
55 install::
57 check::
58 installcheck::
59 dvi::
60 pdf::
61 html::
62 info::
63 install-info::
64 install-pdf::
65 install-dvi::
66 install-man::
67 install-html::
69 install-strip: override INSTALL_PROGRAM = $(INSTALL_STRIP_PROGRAM)
70 ifneq ($(STRIP),)
71 install-strip: STRIPPROG = $(STRIP)
72 export STRIPPROG
73 endif
74 install-strip: install
76 vpath %.cc $(srcdir)
77 vpath %.in $(srcdir)
78 .SUFFIXES:
79 .SUFFIXES: .cc .o
81 # Per-source & per-directory compile flags (warning: recursive)
82 SRC_CXXFLAGS = $(CXXFLAGS$(patsubst $(srcdir)%,%,$1)) \
83 $(if $(filter-out $(srcdir)/,$1),\
84 $(call $0,$(dir $(patsubst %/,%,$1))))
86 %.o: %.cc
87 $(CXX) $(strip $(CXXOPTS) $(call SRC_CXXFLAGS,$<) $(CXXINC)) \
88 -MMD -MP -MF ${@:.o=.d} -c -o $@ $<
90 ifeq (@CXX_AUX_TOOLS@,yes)
92 all::g++-mapper-server$(exeext)
94 ifneq ($(PICFLAG),)
95 override LIBIBERTY := ../libiberty/pic/libiberty.a
96 endif
98 MAPPER.O := server.o resolver.o
99 CODYLIB = ../libcody/libcody.a
100 CXXINC += -I$(srcdir)/../libcody -I$(srcdir)/../include -I$(srcdir)/../gcc -I. -I../gcc
101 g++-mapper-server$(exeext): $(MAPPER.O) $(CODYLIB)
102 +$(CXX) $(LDFLAGS) $(PICFLAG) $(LD_PICFLAG) -o $@ $^ $(LIBIBERTY) $(NETLIBS)
104 # copy to gcc dir so tests there can run
105 all::../gcc/g++-mapper-server$(exeext)
107 ../gcc/g++-mapper-server$(exeext): g++-mapper-server$(exeext)
108 $(INSTALL) $< $@
110 install::
111 $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(libexecsubdir)
112 $(INSTALL_PROGRAM) g++-mapper-server$(exeext) $(DESTDIR)$(libexecsubdir)
113 endif
115 ifneq ($(MAINTAINER),)
116 override MAINTAINER += $1
117 endif
118 ifeq (@MAINTAINER@,yes)
119 MAINTAINER = $2
120 else
121 MAINTAINER = \# --enable-maintainer-mode to rebuild $1, or make MAINTAINER=touch
122 endif
124 all:: Makefile
126 Makefile: $(srcdir)/Makefile.in config.status
127 $(SHELL) ./config.status Makefile
129 $(srcdir)/configure: $(srcdir)/configure.ac
130 $(call MAINTAINER,$@,cd $(@D) && $(AUTOCONF) -W all,error)
132 $(srcdir)/config.h.in: $(srcdir)/configure.ac
133 $(call MAINTAINER,$@,cd $(@D) && $(AUTOHEADER) -f -W all,error)
135 config.h: config.status config.h.in
136 ./$< --header=$@
137 touch $@
139 config.status: $(srcdir)/configure $(srcdir)/config.h.in
140 if test -x $@; then ./$@ -recheck; else $< @configure_args@; fi
142 .PHONY: all check mostlyclean clean distclean maintainer-clean
144 -include $(MAPPER.O:.o=.d)