Retro68/gcc/lto-plugin/Makefile.am

53 lines
2.2 KiB
Makefile
Raw Normal View History

2012-03-27 23:13:14 +00:00
# Makefile.am is used by automake 1.11 to generate Makefile.in.
ACLOCAL_AMFLAGS = -I .. -I ../config
AUTOMAKE_OPTIONS = no-dependencies
gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
target_noncanonical := @target_noncanonical@
2015-08-28 15:33:40 +00:00
libexecsubdir := $(libexecdir)/gcc/$(real_target_noncanonical)/$(gcc_version)$(accel_dir_suffix)
2012-03-27 23:13:14 +00:00
AM_CPPFLAGS = -I$(top_srcdir)/../include $(DEFS)
AM_CFLAGS = @ac_lto_plugin_warn_cflags@
2014-09-21 17:33:12 +00:00
AM_LDFLAGS = @ac_lto_plugin_ldflags@
2012-03-27 23:13:14 +00:00
AM_LIBTOOLFLAGS = --tag=disable-static
2015-08-28 15:33:40 +00:00
override CFLAGS := $(filter-out -fsanitize=address,$(CFLAGS))
override LDFLAGS := $(filter-out -fsanitize=address,$(LDFLAGS))
2012-03-27 23:13:14 +00:00
libexecsub_LTLIBRARIES = liblto_plugin.la
2015-08-28 15:33:40 +00:00
gcc_build_dir = @gcc_build_dir@
2012-03-27 23:13:14 +00:00
in_gcc_libs = $(foreach lib, $(libexecsub_LTLIBRARIES), $(gcc_build_dir)/$(lib))
liblto_plugin_la_SOURCES = lto-plugin.c
2015-08-28 15:33:40 +00:00
# Note that we intentionally override the bindir supplied by ACX_LT_HOST_FLAGS.
2014-09-21 17:33:12 +00:00
liblto_plugin_la_LDFLAGS = $(AM_LDFLAGS) \
2015-08-28 15:33:40 +00:00
$(lt_host_flags) -module -bindir $(libexecsubdir)
# Can be simplified when libiberty becomes a normal convenience library.
libiberty = $(with_libiberty)/libiberty.a
libiberty_noasan = $(with_libiberty)/noasan/libiberty.a
libiberty_pic = $(with_libiberty)/pic/libiberty.a
Wc=-Wc,
liblto_plugin_la_LIBADD = \
$(if $(wildcard $(libiberty_noasan)),$(Wc)$(libiberty_noasan), \
$(if $(wildcard $(libiberty_pic)),$(Wc)$(libiberty_pic),))
liblto_plugin_la_LDFLAGS += \
$(if $(wildcard $(libiberty_noasan)),, \
$(if $(wildcard $(libiberty_pic)),,-Wc,$(libiberty)))
liblto_plugin_la_DEPENDENCIES = \
$(if $(wildcard $(libiberty_noasan)),$(libiberty_noasan), \
$(if $(wildcard $(libiberty_pic)),$(libiberty_pic),))
LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
liblto_plugin_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(liblto_plugin_la_LDFLAGS) $(LTLDFLAGS) -o $@
2012-03-27 23:13:14 +00:00
all-local: $(in_gcc_libs)
$(in_gcc_libs) : $(gcc_build_dir)/%: %
@if test "X`dlname=; . ./$*; echo dlname:$$dlname`" = "Xdlname:"; then \
echo WARNING: $* is static, not copying to $@ >&2 ; \
else \
$(mkinstalldirs) $(gcc_build_dir) && \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $* `pwd`/$@ ; \
fi