From f8c30fa9c0afbb20dff75def1067198678e06038 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Thu, 26 Nov 2009 01:19:08 +0000 Subject: [PATCH] Cleaner solution for echoing the SOURCES variable. --- src/Makefile.am | 2 ++ test/Makefile.am | 2 ++ test/check-build | 4 +--- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index fb3e905..485bddb 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -20,3 +20,5 @@ libzzuf_la_CFLAGS = -DLIBZZUF libzzuf_la_LDFLAGS = -avoid-version -no-undefined $(DLL_LDFLAGS) libzzuf_la_LIBADD = $(GETOPT_LIBS) $(DL_LIBS) $(MATH_LIBS) $(WINSOCK2_LIBS) +echo-sources: ; echo $(SOURCES) + diff --git a/test/Makefile.am b/test/Makefile.am index f1ddaf4..69646b0 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -6,3 +6,5 @@ noinst_PROGRAMS = zzcat zzero zznop bug-overflow bug-memory bug-div0 TESTS = check-build check-md5 check-overflow check-memory check-div0 \ check-rng check-utils +echo-sources: ; echo $(SOURCES) + diff --git a/test/check-build b/test/check-build index e21f6ad..2624a1a 100755 --- a/test/check-build +++ b/test/check-build @@ -29,9 +29,7 @@ fi failure=0 for dir in src test; do pushd ../$dir >/dev/null - # Dirty hack to print the $(SOURCES) variable - for x in $(make -s ID SHELL='echo @@$(SOURCES)@@' | tr -d '\n' | sed 's/.*@@\([^@]*\)@@.*/\1/'); - do + for x in $(make echo-sources); do if grep '[[:space:]]$' "$x" >/dev/null 2>&1; then echo "error: $dir/$x contains trailing spaces" failure=1