From f69c33d586b58e274271052fc471acb7d4fd329e Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Fri, 30 Oct 2015 17:42:55 -0400 Subject: Makefile.am: Finish fixing out-of-tree builds --- diff --git a/Makefile.am b/Makefile.am index 415ad97..60adb4b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -22,14 +22,17 @@ sbin_PROGRAMS = firman firman_SOURCES = # Hack to work around Automake's lack of support for linking programs in other # languages. -firman_LDADD = $(firman_SOURCES) +# Even uglier to support out-of-tree builds with VPATH. firman_LINK = \ set -e; \ vpath='$(VPATH)'; \ - for f in $(firman_LDADD); do \ - $(SH) -n "$${vpath}$${vpath:+/}$${f}"; \ + sources=''; \ + for f in $(firman_SOURCES); do \ + f="$${vpath}$${vpath:+/}$${f}"; \ + sources="$${sources} $${f}"; \ + $(SH) -n "$${f}"; \ done; \ - '$(srcdir)/tools/shld.sh' -I '$(SH)' -o $@ config.sh + '$(srcdir)/tools/shld.sh' -I '$(SH)' -o $@ config.sh $${sources} EXTRA_DIST = \ autogen.sh \ -- cgit v0.9.1