1 # Makefile for c++tools
2 # Copyright 2020 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.
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/>.
21 libexecdir
:= @libexecdir@
22 target_noncanonical
:= @target_noncanonical@
23 version
:= $(shell cat
$(srcdir)/..
/gcc
/BASE-VER
)
24 libexecsubdir
:= $(libexecdir
)/gcc
/$(target_noncanonical
)/$(version
)
26 AUTOCONF
:= @AUTOCONF@
27 AUTOHEADER
:= @AUTOHEADER@
29 CXXFLAGS
:= @CXXFLAGS@
30 CXXOPTS
:= $(CXXFLAGS
) -fno-exceptions
-fno-rtti
32 LIBIBERTY
:= ..
/libiberty
/libiberty.a
33 VERSION.O
:= ..
/gcc
/version.o
41 rm -f c
++-mapper-server
$(exeext
)
44 rm -f config.log config.status config.h
66 # Per-source & per-directory compile flags (warning: recursive)
67 SRC_CXXFLAGS
= $(CXXFLAGS
$(patsubst $(srcdir)%,%,$1)) \
68 $(if
$(filter-out $(srcdir)/,$1),\
69 $(call
$0,$(dir $(patsubst %/,%,$1))))
72 $(CXX
) $(strip $(CXXOPTS
) $(call SRC_CXXFLAGS
,$<) $(CXXINC
)) \
73 -MMD
-MP
-MF
${@
:.o
=.d
} -c
-o
$@
$<
75 ifeq (@CXX_AUX_TOOLS@
,yes
)
77 all::g
++-mapper-server
$(exeext
)
79 MAPPER.O
:= server.o resolver.o
80 CODYLIB
= ..
/libcody
/libcody.a
81 CXXINC
+= -I
$(srcdir)/..
/libcody
-I
$(srcdir)/..
/include -I
$(srcdir)/..
/gcc
-I.
82 g
++-mapper-server
$(exeext
): $(MAPPER.O
) $(CODYLIB
)
83 +$(CXX
) $(LDFLAGS
) -o
$@
$^
$(VERSION.O
) $(LIBIBERTY
)
85 # copy to gcc dir so tests there can run
86 all::..
/gcc
/g
++-mapper-server
$(exeext
)
88 ..
/gcc
/g
++-mapper-server
$(exeext
): g
++-mapper-server
$(exeext
)
92 $(INSTALL
) -p g
++-mapper-server
$(exeext
) $(DESTDIR
)$(libexecsubdir
)
96 ifneq ($(MAINTAINER
),)
97 override MAINTAINER
+= $1
99 ifeq (@MAINTAINER@
,yes
)
102 MAINTAINER
= \
# --enable-maintainer-mode to rebuild $1, or make MAINTAINER=touch
107 Makefile
: $(srcdir)/Makefile.in config.status
108 $(SHELL
) .
/config.status Makefile
110 $(srcdir)/configure
: $(srcdir)/configure.ac
111 $(call MAINTAINER
,$@
,cd
$(@D
) && $(AUTOCONF
) -W
all,error
)
113 $(srcdir)/config.h.in
: $(srcdir)/configure.ac
114 $(call MAINTAINER
,$@
,cd
$(@D
) && $(AUTOHEADER
) -f
-W
all,error
)
116 config.h
: config.status config.h.in
120 config.status
: $(srcdir)/configure
$(srcdir)/config.h.in
121 if
test -x
$@
; then .
/$@
-recheck
; else $< @configure_args@
; fi
123 .PHONY
: all check clean distclean maintainer-clean
125 -include $(MAPPER.O
:.o
=.d
)