Makefile.am 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. # Makefile.am is used by automake 1.11 to generate Makefile.in.
  2. ACLOCAL_AMFLAGS = -I .. -I ../config
  3. AUTOMAKE_OPTIONS = no-dependencies
  4. gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
  5. target_noncanonical := @target_noncanonical@
  6. libexecsubdir := $(libexecdir)/gcc/$(real_target_noncanonical)/$(gcc_version)$(accel_dir_suffix)
  7. AM_CPPFLAGS = -I$(top_srcdir)/../include $(DEFS)
  8. AM_CFLAGS = @ac_lto_plugin_warn_cflags@
  9. AM_LDFLAGS = @ac_lto_plugin_ldflags@
  10. AM_LIBTOOLFLAGS = --tag=disable-static
  11. override CFLAGS := $(filter-out -fsanitize=address,$(CFLAGS))
  12. override LDFLAGS := $(filter-out -fsanitize=address,$(LDFLAGS))
  13. libexecsub_LTLIBRARIES = liblto_plugin.la
  14. gcc_build_dir = @gcc_build_dir@
  15. in_gcc_libs = $(foreach lib, $(libexecsub_LTLIBRARIES), $(gcc_build_dir)/$(lib))
  16. liblto_plugin_la_SOURCES = lto-plugin.c
  17. # Note that we intentionally override the bindir supplied by ACX_LT_HOST_FLAGS.
  18. liblto_plugin_la_LDFLAGS = $(AM_LDFLAGS) \
  19. $(lt_host_flags) -module -bindir $(libexecsubdir)
  20. # Can be simplified when libiberty becomes a normal convenience library.
  21. libiberty = $(with_libiberty)/libiberty.a
  22. libiberty_noasan = $(with_libiberty)/noasan/libiberty.a
  23. libiberty_pic = $(with_libiberty)/pic/libiberty.a
  24. Wc=-Wc,
  25. liblto_plugin_la_LIBADD = \
  26. $(if $(wildcard $(libiberty_noasan)),$(Wc)$(libiberty_noasan), \
  27. $(if $(wildcard $(libiberty_pic)),$(Wc)$(libiberty_pic),))
  28. liblto_plugin_la_LDFLAGS += \
  29. $(if $(wildcard $(libiberty_noasan)),, \
  30. $(if $(wildcard $(libiberty_pic)),,-Wc,$(libiberty)))
  31. liblto_plugin_la_DEPENDENCIES = \
  32. $(if $(wildcard $(libiberty_noasan)),$(libiberty_noasan), \
  33. $(if $(wildcard $(libiberty_pic)),$(libiberty_pic),))
  34. LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
  35. liblto_plugin_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
  36. $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
  37. $(liblto_plugin_la_LDFLAGS) $(LTLDFLAGS) -o $@
  38. all-local: $(in_gcc_libs)
  39. $(in_gcc_libs) : $(gcc_build_dir)/%: %
  40. @if test "X`dlname=; . ./$*; echo dlname:$$dlname`" = "Xdlname:"; then \
  41. echo WARNING: $* is static, not copying to $@ >&2 ; \
  42. else \
  43. $(mkinstalldirs) $(gcc_build_dir) && \
  44. $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $* `pwd`/$@ ; \
  45. fi