[beast: 3/16] BUILD: Makefile.decl: distfile-list: generate absolute file names



commit 85d8296d2e84e152887bcf8f2062c87b1912ecbd
Author: Tim Janik <timj gnu org>
Date:   Thu Sep 10 21:09:18 2015 +0200

    BUILD: Makefile.decl: distfile-list: generate absolute file names

 Makefile.decl |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)
---
diff --git a/Makefile.decl b/Makefile.decl
index 83b6b0b..e5ceebc 100644
--- a/Makefile.decl
+++ b/Makefile.decl
@@ -33,19 +33,22 @@ download-recursive:
 # listed as DISTFILES. this asserts a writable file named $DISTFILE_LIST.
 .PHONY: distfile-list
 distfile-list:
-       @if test ! -f "$(DISTFILE_LIST)" ; then                         \
-               echo 'distfile-list: $$(DISTFILE_LIST) is unwritable' ; \
-               exit 1 ;                                                \
-       fi
+       $(AM_V_GEN)
+       $(Q) test -w "$(DISTFILE_LIST)" || \
+         { echo '$$(DISTFILE_LIST): failed to write' >/dev/stderr ; false ; }
        @for subdir in $(SUBDIRS) ; do                          \
          test "$$subdir" = '.' ||                              \
            $(MAKE) -C "$$subdir" $(AM_MAKEFLAGS) $@ ||         \
            exit 1 ;                                            \
        done
-       for file in $(DISTFILES) ; do                           \
-         test -e "$$file" &&                                   \
-           echo "$(subdir)/$$file" >> $(DISTFILE_LIST) ;       \
-       done ; true
+       $(Q) for file in $(DISTFILES) ; do                      \
+         if [[ "$$file" = /* ]] && test -e "$$file" ; then     \
+           echo "$$file" >> $(DISTFILE_LIST) ;                 \
+         elif test -e "$(abs_builddir)/$$file" ; then          \
+           echo "$(abs_builddir)/$$file" >> $(DISTFILE_LIST) ; \
+         elif test -e "$(abs_srcdir)/$$file" ; then            \
+           echo "$(abs_srcdir)/$$file" >> $(DISTFILE_LIST) ;   \
+         fi ; done ; true
 
 # === check: check-before / check-after ===
 .PHONY: check-before check-after


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]