Makefile.in 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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. srcdir := @srcdir@
  18. prefix := @prefix@
  19. bindir := @bindir@
  20. libexecdir := @libexecdir@
  21. target_noncanonical := @target_noncanonical@
  22. gcc_version := $(shell @get_gcc_base_ver@ $(srcdir)/../gcc/BASE-VER)
  23. libexecsubdir := $(libexecdir)/gcc/$(target_noncanonical)/$(gcc_version)
  24. INSTALL_PROGRAM := @INSTALL_PROGRAM@
  25. INSTALL_STRIP_PROGRAM := $(srcdir)/../install-sh -c -s
  26. AUTOCONF := @AUTOCONF@
  27. AUTOHEADER := @AUTOHEADER@
  28. CXX := @CXX@
  29. CXXFLAGS := @CXXFLAGS@
  30. PIEFLAG := @PIEFLAG@
  31. CXXOPTS := $(CXXFLAGS) $(PIEFLAG) -fno-exceptions -fno-rtti
  32. LDFLAGS := @LDFLAGS@
  33. exeext := @EXEEXT@
  34. LIBIBERTY := ../libiberty/libiberty.a
  35. NETLIBS := @NETLIBS@
  36. VERSION.O := ../gcc/version.o
  37. all::
  38. mostlyclean::
  39. rm -f $(MAPPER.O)
  40. clean::
  41. rm -f g++-mapper-server$(exeext)
  42. distclean::
  43. rm -f config.log config.status config.h
  44. maintainer-clean::
  45. install::
  46. check::
  47. installcheck::
  48. dvi::
  49. pdf::
  50. html::
  51. info::
  52. install-info::
  53. install-pdf::
  54. install-dvi::
  55. install-man::
  56. install-html::
  57. install-strip: override INSTALL_PROGRAM = $(INSTALL_STRIP_PROGRAM)
  58. ifneq ($(STRIP),)
  59. install-strip: STRIPPROG = $(STRIP)
  60. export STRIPPROG
  61. endif
  62. install-strip: install
  63. vpath %.cc $(srcdir)
  64. vpath %.in $(srcdir)
  65. .SUFFIXES:
  66. .SUFFIXES: .cc .o
  67. # Per-source & per-directory compile flags (warning: recursive)
  68. SRC_CXXFLAGS = $(CXXFLAGS$(patsubst $(srcdir)%,%,$1)) \
  69. $(if $(filter-out $(srcdir)/,$1),\
  70. $(call $0,$(dir $(patsubst %/,%,$1))))
  71. %.o: %.cc
  72. $(CXX) $(strip $(CXXOPTS) $(call SRC_CXXFLAGS,$<) $(CXXINC)) \
  73. -MMD -MP -MF ${@:.o=.d} -c -o $@ $<
  74. ifeq (@CXX_AUX_TOOLS@,yes)
  75. all::g++-mapper-server$(exeext)
  76. MAPPER.O := server.o resolver.o
  77. CODYLIB = ../libcody/libcody.a
  78. CXXINC += -I$(srcdir)/../libcody -I$(srcdir)/../include -I$(srcdir)/../gcc -I. -I../gcc
  79. g++-mapper-server$(exeext): $(MAPPER.O) $(CODYLIB)
  80. +$(CXX) $(LDFLAGS) $(PIEFLAG) -o $@ $^ $(LIBIBERTY) $(NETLIBS)
  81. # copy to gcc dir so tests there can run
  82. all::../gcc/g++-mapper-server$(exeext)
  83. ../gcc/g++-mapper-server$(exeext): g++-mapper-server$(exeext)
  84. $(INSTALL) $< $@
  85. install::
  86. $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(libexecsubdir)
  87. $(INSTALL_PROGRAM) g++-mapper-server$(exeext) $(DESTDIR)$(libexecsubdir)
  88. endif
  89. ifneq ($(MAINTAINER),)
  90. override MAINTAINER += $1
  91. endif
  92. ifeq (@MAINTAINER@,yes)
  93. MAINTAINER = $2
  94. else
  95. MAINTAINER = \# --enable-maintainer-mode to rebuild $1, or make MAINTAINER=touch
  96. endif
  97. all:: Makefile
  98. Makefile: $(srcdir)/Makefile.in config.status
  99. $(SHELL) ./config.status Makefile
  100. $(srcdir)/configure: $(srcdir)/configure.ac
  101. $(call MAINTAINER,$@,cd $(@D) && $(AUTOCONF) -W all,error)
  102. $(srcdir)/config.h.in: $(srcdir)/configure.ac
  103. $(call MAINTAINER,$@,cd $(@D) && $(AUTOHEADER) -f -W all,error)
  104. config.h: config.status config.h.in
  105. ./$< --header=$@
  106. touch $@
  107. config.status: $(srcdir)/configure $(srcdir)/config.h.in
  108. if test -x $@; then ./$@ -recheck; else $< @configure_args@; fi
  109. .PHONY: all check clean distclean maintainer-clean
  110. -include $(MAPPER.O:.o=.d)