Makefile.am 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. ## Copyright (C) 2014-2022 Free Software Foundation, Inc.
  2. ## This file is part of GCC.
  3. ## GCC is free software; you can redistribute it and/or modify it under
  4. ## the terms of the GNU General Public License as published by the Free
  5. ## Software Foundation; either version 3, or (at your option) any later
  6. ## version.
  7. ## GCC is distributed in the hope that it will be useful, but WITHOUT ANY
  8. ## WARRANTY; without even the implied warranty of MERCHANTABILITY or
  9. ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  10. ## for more details.
  11. ## You should have received a copy of the GNU General Public License
  12. ## along with GCC; see the file COPYING3. If not see
  13. ## <http://www.gnu.org/licenses/>.
  14. ACLOCAL_AMFLAGS = -I .. -I ../config
  15. gcc_build_dir = ../gcc
  16. AM_CPPFLAGS = -I $(srcdir)/../include -I $(srcdir)/../libgcc \
  17. -I $(gcc_build_dir) -I$(srcdir)/../gcc $($@_CPPFLAGS) $(GMPINC) \
  18. -I $(srcdir)/../gcc/c-family -I $(srcdir)/../libcpp/include
  19. CPPFLAGS_FOR_C = -I $(srcdir)/../gcc/c
  20. CPPFLAGS_FOR_CXX = -I $(srcdir)/../gcc/cp
  21. AM_CXXFLAGS = $(WARN_FLAGS) $(WERROR) $(visibility) $(CET_HOST_FLAGS)
  22. if DARWIN_DYNAMIC_LOOKUP
  23. AM_CXXFLAGS += -Wl,-undefined,dynamic_lookup
  24. endif
  25. override CXXFLAGS := $(subst -mdynamic-no-pic,-fPIC,$(CXXFLAGS))
  26. override CXXFLAGS := $(filter-out -fsanitize=address,$(CXXFLAGS))
  27. override LDFLAGS := $(filter-out -fsanitize=address,$(LDFLAGS))
  28. # Can be simplified when libiberty becomes a normal convenience library.
  29. libiberty_normal = ../libiberty/libiberty.a
  30. libiberty_noasan = ../libiberty/noasan/libiberty.a
  31. libiberty_pic = ../libiberty/pic/libiberty.a
  32. Wc=-Wc,
  33. libiberty = $(if $(wildcard $(libiberty_noasan)),$(Wc)$(libiberty_noasan), \
  34. $(if $(wildcard $(libiberty_pic)),$(Wc)$(libiberty_pic), \
  35. $(Wc)$(libiberty_normal)))
  36. libiberty_dep = $(patsubst $(Wc)%,%,$(libiberty))
  37. plugindir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)/plugin
  38. cc1libdir = $(libdir)/$(libsuffix)
  39. if ENABLE_PLUGIN
  40. plugin_LTLIBRARIES = libcc1plugin.la libcp1plugin.la
  41. cc1lib_LTLIBRARIES = libcc1.la
  42. endif
  43. shared_source = callbacks.cc callbacks.hh connection.cc connection.hh \
  44. marshall.cc marshall.hh rpc.hh status.hh
  45. marshall_c_source = marshall-c.hh
  46. marshall_cxx_source = marshall-cp.hh
  47. libcc1plugin_la_LDFLAGS = -module -export-symbols $(srcdir)/libcc1plugin.sym
  48. libcc1plugin_la_SOURCES = libcc1plugin.cc context.cc context.hh \
  49. $(shared_source) $(marshall_c_source)
  50. libcc1plugin.lo_CPPFLAGS = $(CPPFLAGS_FOR_C)
  51. libcc1plugin_la_LIBADD = $(libiberty)
  52. libcc1plugin_la_DEPENDENCIES = $(libiberty_dep)
  53. libcc1plugin_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
  54. $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
  55. $(CXXFLAGS) $(libcc1plugin_la_LDFLAGS) $(LTLDFLAGS) -o $@
  56. libcp1plugin_la_LDFLAGS = -module -export-symbols $(srcdir)/libcp1plugin.sym
  57. libcp1plugin_la_SOURCES = libcp1plugin.cc context.cc context.hh \
  58. $(shared_source) $(marshall_cxx_source)
  59. libcp1plugin.lo_CPPFLAGS = $(CPPFLAGS_FOR_CXX)
  60. libcp1plugin_la_LIBADD = $(libiberty)
  61. libcp1plugin_la_DEPENDENCIES = $(libiberty_dep)
  62. libcp1plugin_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
  63. $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
  64. $(CXXFLAGS) $(libcp1plugin_la_LDFLAGS) $(LTLDFLAGS) -o $@
  65. LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
  66. libcc1_la_LDFLAGS = -module -export-symbols $(srcdir)/libcc1.sym
  67. libcc1_la_SOURCES = findcomp.cc libcc1.cc libcp1.cc \
  68. compiler.cc compiler.hh names.cc names.hh $(shared_source) \
  69. $(marshall_c_source) $(marshall_cxx_source)
  70. libcc1_la_LIBADD = $(libiberty)
  71. libcc1_la_DEPENDENCIES = $(libiberty_dep)
  72. libcc1_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
  73. $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
  74. $(CXXFLAGS) $(libcc1_la_LDFLAGS) $(LTLDFLAGS) -o $@