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