build/unix/print-failed-commands.sh
author James Willcox <jwillcox@mozilla.com>
Mon, 30 Jan 2012 16:47:19 -0500
changeset 88195 b735935813b2174fed1330293f25802c673b43ae
parent 1 9b2a99adc05e53cd4010de512f50118594756650
child 98529 f4157e8c410708d76703f19e4dfb61859bfe32d8
permissions -rwxr-xr-x
Bug 719872 (part 1) - Backout 8de271eee34b r=mattwoodrow DONTBUILD

#!/bin/sh
#
# Usage from makefile:
#   ELOG = . $(topdir)/build/autoconf/print-failed-commands.sh
#   $(ELOG) $(CC) $CFLAGS -o $@ $<
#
# This shell script is used by the build system to print out commands that fail
# to execute properly.  It is designed to make the "make -s" command more
# useful.
#
# Note that in the example we are sourcing rather than execing the script.
# Since make already started a shell for us, we might as well use it rather
# than starting a new one.

( exec "$@" ) || {
    echo
    echo "In the directory " `pwd`
    echo "The following command failed to execute properly:"
    echo "$@"
    exit 1;
}