Makefile.am 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. ## Copyright (C) 2014 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 \
  18. -I $(srcdir)/../gcc/c -I $(srcdir)/../gcc/c-family \
  19. -I $(srcdir)/../libcpp/include $(GMPINC)
  20. AM_CXXFLAGS = $(WARN_FLAGS) $(WERROR) $(visibility)
  21. override CXXFLAGS := $(filter-out -fsanitize=address,$(CXXFLAGS))
  22. override LDFLAGS := $(filter-out -fsanitize=address,$(LDFLAGS))
  23. # Can be simplified when libiberty becomes a normal convenience library.
  24. libiberty_normal = ../libiberty/libiberty.a
  25. libiberty_noasan = ../libiberty/noasan/libiberty.a
  26. libiberty_pic = ../libiberty/pic/libiberty.a
  27. Wc=-Wc,
  28. libiberty = $(if $(wildcard $(libiberty_noasan)),$(Wc)$(libiberty_noasan), \
  29. $(if $(wildcard $(libiberty_pic)),$(Wc)$(libiberty_pic), \
  30. $(Wc)$(libiberty_normal)))
  31. libiberty_dep = $(patsubst $(Wc)%,%,$(libiberty))
  32. plugindir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)/plugin
  33. cc1libdir = $(libdir)/$(libsuffix)
  34. if ENABLE_PLUGIN
  35. plugin_LTLIBRARIES = libcc1plugin.la
  36. cc1lib_LTLIBRARIES = libcc1.la
  37. endif
  38. BUILT_SOURCES = compiler-name.h
  39. # Put this in a header so we don't run sed for each compilation. This
  40. # is also simpler to debug as one can easily see the constant.
  41. compiler-name.h: Makefile
  42. echo "#define COMPILER_NAME \"`echo gcc | sed '$(transform)'`\"" > compiler-name.h
  43. shared_source = callbacks.cc callbacks.hh connection.cc connection.hh \
  44. marshall.cc marshall.hh rpc.hh status.hh
  45. libcc1plugin_la_LDFLAGS = -module -export-symbols $(srcdir)/libcc1plugin.sym
  46. libcc1plugin_la_SOURCES = plugin.cc $(shared_source)
  47. libcc1plugin_la_LIBADD = $(libiberty)
  48. libcc1plugin_la_DEPENDENCIES = $(libiberty_dep)
  49. libcc1plugin_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
  50. $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
  51. $(CXXFLAGS) $(libcc1plugin_la_LDFLAGS) $(LTLDFLAGS) -o $@
  52. LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
  53. libcc1_la_LDFLAGS = -module -export-symbols $(srcdir)/libcc1.sym
  54. libcc1_la_SOURCES = findcomp.cc libcc1.cc names.cc names.hh $(shared_source)
  55. libcc1_la_LIBADD = $(libiberty)
  56. libcc1_la_DEPENDENCIES = $(libiberty_dep)
  57. libcc1_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
  58. $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
  59. $(CXXFLAGS) $(libcc1_la_LDFLAGS) $(LTLDFLAGS) -o $@