[PATCH modular 3/3] build.sh: rebuild a failing target with Automake silent rules disabled

Gaetan Nadon memsize at videotron.ca
Thu Jan 6 08:40:18 PST 2011

With Automake silent rules enabled, the compiler error message is
displayed but not the command that caused it.

This patch will re-issue the make command that failed, but this time
with the V=1 alongside the MAKEFLAGS env variable. A message is issued
to not confuse the user as to why the target failed twice.

This introduces a new cmd line option --retry-v1. The "v1" part is a hint
to those familiar with Automake silent rule variable "V".
There is no backing environment variable for this option.

Reported-by: Pat Kane <pekane52 at gmail.com>

Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
 build.sh |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/build.sh b/build.sh
index de96a47..42cf585 100755
--- a/build.sh
+++ b/build.sh
@@ -447,6 +447,12 @@ process() {
     if [ $? -ne 0 ]; then
+	# Rerun with Automake silent rules disabled to see failing gcc statement
+	if [ X"$RETRY_VERBOSE" != X ]; then
+	    echo ""
+	    echo "build.sh: Rebuilding $component with Automake silent rules disabled"
+	    ${MAKE} $MAKEFLAGS V=1
+	fi
 	failed "$MAKE $MAKEFLAGS" $module $component
 	cd $old_pwd
 	return 1
@@ -1005,6 +1011,7 @@ usage() {
     echo "  --cmd <cmd> Execute arbitrary git, gmake, or make command <cmd>"
     echo "  --confflags <options> Pass options to autgen.sh/configure"
     echo "  --modfile <file> Only process the module/components specified in <file>"
+    echo "  --retry-v1  Remake 'all' on failure with Automake silent rules disabled"
     echo ""
     echo "Usage: $basename -L"
     echo "  -L : just list modules to build"
@@ -1205,6 +1212,9 @@ do
+    --retry-v1)
+	;;
 	if [ X"$too_many" = Xyes ]; then
 	    echo "unrecognized and/or too many command-line arguments"

More information about the xorg-devel mailing list