michael@0: #!/bin/sh michael@0: # This Source Code Form is subject to the terms of the Mozilla Public michael@0: # License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: # file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: # michael@0: # Usage from makefile: michael@0: # ELOG = . $(topdir)/build/autoconf/print-failed-commands.sh michael@0: # $(ELOG) $(CC) $CFLAGS -o $@ $< michael@0: # michael@0: # This shell script is used by the build system to print out commands that fail michael@0: # to execute properly. It is designed to make the "make -s" command more michael@0: # useful. michael@0: # michael@0: # Note that in the example we are sourcing rather than execing the script. michael@0: # Since make already started a shell for us, we might as well use it rather michael@0: # than starting a new one. michael@0: michael@0: ( exec "$@" ) || { michael@0: echo michael@0: echo "In the directory " `pwd` michael@0: echo "The following command failed to execute properly:" michael@0: echo "$@" michael@0: exit 1; michael@0: }