2009-10-03 23:10:11 +02:00
|
|
|
# Makefile.am is used by automake 1.11 to generate Makefile.in.
|
|
|
|
|
|
|
|
ACLOCAL_AMFLAGS = -I .. -I ../config
|
2010-01-11 13:38:09 +01:00
|
|
|
AUTOMAKE_OPTIONS = no-dependencies
|
2009-10-03 23:10:11 +02:00
|
|
|
|
|
|
|
gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
|
|
|
|
target_noncanonical := @target_noncanonical@
|
|
|
|
libexecsubdir := $(libexecdir)/gcc/$(target_noncanonical)/$(gcc_version)
|
|
|
|
|
2010-11-03 10:14:32 +01:00
|
|
|
AM_CPPFLAGS = -I$(top_srcdir)/../include $(DEFS)
|
2011-08-10 10:48:37 +02:00
|
|
|
AM_CFLAGS = @ac_lto_plugin_warn_cflags@
|
2014-03-17 14:04:12 +01:00
|
|
|
AM_LDFLAGS = @ac_lto_plugin_ldflags@
|
2010-12-20 18:03:10 +01:00
|
|
|
AM_LIBTOOLFLAGS = --tag=disable-static
|
2014-04-17 14:25:25 +02:00
|
|
|
override CFLAGS := $(filter-out -fsanitize=address,$(CFLAGS))
|
|
|
|
override LDFLAGS := $(filter-out -fsanitize=address,$(LDFLAGS))
|
2009-10-03 23:10:11 +02:00
|
|
|
|
|
|
|
libexecsub_LTLIBRARIES = liblto_plugin.la
|
2011-02-12 16:48:15 +01:00
|
|
|
gcc_build_dir = ../$(host_subdir)/gcc
|
2011-02-12 13:02:24 +01:00
|
|
|
in_gcc_libs = $(foreach lib, $(libexecsub_LTLIBRARIES), $(gcc_build_dir)/$(lib))
|
2009-10-03 23:10:11 +02:00
|
|
|
|
2011-02-07 21:32:17 +01:00
|
|
|
# Can be removed when libiberty becomes a normal convenience library
|
|
|
|
Wc=-Wc,
|
2014-04-17 14:23:28 +02:00
|
|
|
LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
|
2011-02-07 21:32:17 +01:00
|
|
|
|
2010-11-03 10:14:32 +01:00
|
|
|
liblto_plugin_la_SOURCES = lto-plugin.c
|
2010-12-15 11:29:01 +01:00
|
|
|
liblto_plugin_la_LIBADD = \
|
2014-04-17 14:25:25 +02:00
|
|
|
$(if $(wildcard ../libiberty/noasan/libiberty.a),$(Wc)../libiberty/noasan/libiberty.a, \
|
|
|
|
$(if $(wildcard ../libiberty/pic/libiberty.a),$(Wc)../libiberty/pic/libiberty.a,))
|
2010-12-06 01:50:04 +01:00
|
|
|
# Note that we intentionally override the bindir supplied by ACX_LT_HOST_FLAGS
|
2014-03-17 14:04:12 +01:00
|
|
|
liblto_plugin_la_LDFLAGS = $(AM_LDFLAGS) \
|
|
|
|
$(lt_host_flags) -module -bindir $(libexecsubdir) \
|
2014-04-17 14:25:25 +02:00
|
|
|
$(if $(wildcard ../libiberty/noasan/libiberty.a),, \
|
|
|
|
$(if $(wildcard ../libiberty/pic/libiberty.a),,-Wc,../libiberty/libiberty.a))
|
2011-02-07 21:32:17 +01:00
|
|
|
liblto_plugin_la_DEPENDENCIES = $(if $(wildcard \
|
2014-04-17 14:25:25 +02:00
|
|
|
../libiberty/noasan/libiberty.a),../libiberty/noasan/libiberty.a, \
|
|
|
|
$(if $(wildcard ../libiberty/pic/libiberty.a),../libiberty/pic/libiberty.a,))
|
2014-04-17 14:23:28 +02:00
|
|
|
liblto_plugin_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
|
|
|
|
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
|
|
|
$(liblto_plugin_la_LDFLAGS) $(LTLDFLAGS) -o $@
|
2010-07-22 14:50:00 +02:00
|
|
|
|
2011-02-12 16:48:15 +01:00
|
|
|
all-local: $(in_gcc_libs)
|
2010-07-22 14:50:00 +02:00
|
|
|
|
2011-02-12 13:02:24 +01:00
|
|
|
$(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
|