Fix internal error on small array with negative lower bound
[official-gcc.git] / c++tools / Makefile.in
blob77bda3d56dc16af82eef7c718b223c945c5c13c1
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 PIEFLAG := @PIEFLAG@
33 CXXOPTS := $(CXXFLAGS) $(PIEFLAG) -fno-exceptions -fno-rtti
34 LDFLAGS := @LDFLAGS@
35 exeext := @EXEEXT@
36 LIBIBERTY := ../libiberty/libiberty.a
37 NETLIBS := @NETLIBS@
38 VERSION.O := ../gcc/version.o
40 all::
42 mostlyclean::
43 rm -f $(MAPPER.O)
45 clean:: mostlyclean
46 rm -f g++-mapper-server$(exeext)
48 distclean:: clean
49 rm -f config.log config.status config.h config.cache Makefile
50 rm -f $(MAPPER.O:%.o=%.d)
52 maintainer-clean:: distclean
54 install::
56 check::
57 installcheck::
58 dvi::
59 pdf::
60 html::
61 info::
62 install-info::
63 install-pdf::
64 install-dvi::
65 install-man::
66 install-html::
68 install-strip: override INSTALL_PROGRAM = $(INSTALL_STRIP_PROGRAM)
69 ifneq ($(STRIP),)
70 install-strip: STRIPPROG = $(STRIP)
71 export STRIPPROG
72 endif
73 install-strip: install
75 vpath %.cc $(srcdir)
76 vpath %.in $(srcdir)
77 .SUFFIXES:
78 .SUFFIXES: .cc .o
80 # Per-source & per-directory compile flags (warning: recursive)
81 SRC_CXXFLAGS = $(CXXFLAGS$(patsubst $(srcdir)%,%,$1)) \
82 $(if $(filter-out $(srcdir)/,$1),\
83 $(call $0,$(dir $(patsubst %/,%,$1))))
85 %.o: %.cc
86 $(CXX) $(strip $(CXXOPTS) $(call SRC_CXXFLAGS,$<) $(CXXINC)) \
87 -MMD -MP -MF ${@:.o=.d} -c -o $@ $<
89 ifeq (@CXX_AUX_TOOLS@,yes)
91 all::g++-mapper-server$(exeext)
93 MAPPER.O := server.o resolver.o
94 CODYLIB = ../libcody/libcody.a
95 CXXINC += -I$(srcdir)/../libcody -I$(srcdir)/../include -I$(srcdir)/../gcc -I. -I../gcc
96 g++-mapper-server$(exeext): $(MAPPER.O) $(CODYLIB)
97 +$(CXX) $(LDFLAGS) $(PIEFLAG) -o $@ $^ $(LIBIBERTY) $(NETLIBS)
99 # copy to gcc dir so tests there can run
100 all::../gcc/g++-mapper-server$(exeext)
102 ../gcc/g++-mapper-server$(exeext): g++-mapper-server$(exeext)
103 $(INSTALL) $< $@
105 install::
106 $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(libexecsubdir)
107 $(INSTALL_PROGRAM) g++-mapper-server$(exeext) $(DESTDIR)$(libexecsubdir)
108 endif
110 ifneq ($(MAINTAINER),)
111 override MAINTAINER += $1
112 endif
113 ifeq (@MAINTAINER@,yes)
114 MAINTAINER = $2
115 else
116 MAINTAINER = \# --enable-maintainer-mode to rebuild $1, or make MAINTAINER=touch
117 endif
119 all:: Makefile
121 Makefile: $(srcdir)/Makefile.in config.status
122 $(SHELL) ./config.status Makefile
124 $(srcdir)/configure: $(srcdir)/configure.ac
125 $(call MAINTAINER,$@,cd $(@D) && $(AUTOCONF) -W all,error)
127 $(srcdir)/config.h.in: $(srcdir)/configure.ac
128 $(call MAINTAINER,$@,cd $(@D) && $(AUTOHEADER) -f -W all,error)
130 config.h: config.status config.h.in
131 ./$< --header=$@
132 touch $@
134 config.status: $(srcdir)/configure $(srcdir)/config.h.in
135 if test -x $@; then ./$@ -recheck; else $< @configure_args@; fi
137 .PHONY: all check mostlyclean clean distclean maintainer-clean
139 -include $(MAPPER.O:.o=.d)