]> git.ipfire.org Git - thirdparty/gcc.git/blob - c++tools/Makefile.in
configure: Implement --enable-host-pie
[thirdparty/gcc.git] / c++tools / Makefile.in
1 # Makefile for c++tools
2 # Copyright (C) 2020-2022 Free Software Foundation, Inc.
3 #
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.
13 #
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/>.
17
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_PROGRAM := @INSTALL_PROGRAM@
26 INSTALL_STRIP_PROGRAM := $(srcdir)/../install-sh -c -s
27 AUTOCONF := @AUTOCONF@
28 AUTOHEADER := @AUTOHEADER@
29 CXX := @CXX@
30 CXXFLAGS := @CXXFLAGS@
31 PICFLAG := @PICFLAG@
32 LD_PICFLAG := @LD_PICFLAG@
33 CXXOPTS := $(CXXFLAGS) $(PICFLAG) -fno-exceptions -fno-rtti
34 LDFLAGS := @LDFLAGS@
35 exeext := @EXEEXT@
36 LIBIBERTY := ../libiberty/libiberty.a
37 NETLIBS := @NETLIBS@
38 VERSION.O := ../gcc/version.o
39
40 all::
41
42 mostlyclean::
43 rm -f $(MAPPER.O)
44
45 clean::
46 rm -f g++-mapper-server$(exeext)
47
48 distclean::
49 rm -f config.log config.status config.h
50
51 maintainer-clean::
52
53 install::
54
55 check::
56 installcheck::
57 dvi::
58 pdf::
59 html::
60 info::
61 install-info::
62 install-pdf::
63 install-dvi::
64 install-man::
65 install-html::
66
67 install-strip: override INSTALL_PROGRAM = $(INSTALL_STRIP_PROGRAM)
68 ifneq ($(STRIP),)
69 install-strip: STRIPPROG = $(STRIP)
70 export STRIPPROG
71 endif
72 install-strip: install
73
74 vpath %.cc $(srcdir)
75 vpath %.in $(srcdir)
76 .SUFFIXES:
77 .SUFFIXES: .cc .o
78
79 # Per-source & per-directory compile flags (warning: recursive)
80 SRC_CXXFLAGS = $(CXXFLAGS$(patsubst $(srcdir)%,%,$1)) \
81 $(if $(filter-out $(srcdir)/,$1),\
82 $(call $0,$(dir $(patsubst %/,%,$1))))
83
84 %.o: %.cc
85 $(CXX) $(strip $(CXXOPTS) $(call SRC_CXXFLAGS,$<) $(CXXINC)) \
86 -MMD -MP -MF ${@:.o=.d} -c -o $@ $<
87
88 ifeq (@CXX_AUX_TOOLS@,yes)
89
90 all::g++-mapper-server$(exeext)
91
92 ifneq ($(PICFLAG),)
93 override LIBIBERTY := ../libiberty/pic/libiberty.a
94 endif
95
96 MAPPER.O := server.o resolver.o
97 CODYLIB = ../libcody/libcody.a
98 CXXINC += -I$(srcdir)/../libcody -I$(srcdir)/../include -I$(srcdir)/../gcc -I. -I../gcc
99 g++-mapper-server$(exeext): $(MAPPER.O) $(CODYLIB)
100 +$(CXX) $(LDFLAGS) $(PICFLAG) $(LD_PICFLAG) -o $@ $^ $(LIBIBERTY) $(NETLIBS)
101
102 # copy to gcc dir so tests there can run
103 all::../gcc/g++-mapper-server$(exeext)
104
105 ../gcc/g++-mapper-server$(exeext): g++-mapper-server$(exeext)
106 $(INSTALL) $< $@
107
108 install::
109 $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(libexecsubdir)
110 $(INSTALL_PROGRAM) g++-mapper-server$(exeext) $(DESTDIR)$(libexecsubdir)
111 endif
112
113 ifneq ($(MAINTAINER),)
114 override MAINTAINER += $1
115 endif
116 ifeq (@MAINTAINER@,yes)
117 MAINTAINER = $2
118 else
119 MAINTAINER = \# --enable-maintainer-mode to rebuild $1, or make MAINTAINER=touch
120 endif
121
122 all:: Makefile
123
124 Makefile: $(srcdir)/Makefile.in config.status
125 $(SHELL) ./config.status Makefile
126
127 $(srcdir)/configure: $(srcdir)/configure.ac
128 $(call MAINTAINER,$@,cd $(@D) && $(AUTOCONF) -W all,error)
129
130 $(srcdir)/config.h.in: $(srcdir)/configure.ac
131 $(call MAINTAINER,$@,cd $(@D) && $(AUTOHEADER) -f -W all,error)
132
133 config.h: config.status config.h.in
134 ./$< --header=$@
135 touch $@
136
137 config.status: $(srcdir)/configure $(srcdir)/config.h.in
138 if test -x $@; then ./$@ -recheck; else $< @configure_args@; fi
139
140 .PHONY: all check clean distclean maintainer-clean
141
142 -include $(MAPPER.O:.o=.d)