Follow-up Comment #4, bug #22923 (project make):
We have implemented output merging with a shell wrapper script. We ask make
to use this wrapper script via the SHELL variable.
The script itself is pretty simple, although it may be bash-centric:
----------------------------------------
#!/bin/sh
# Simple shell wrapper for stdout and stderr buffering
# Created 2002, Erik Cumps
#
# Use with parallel makes to prevent confusing output.
# Run make SHELL=makesh ... or edit makefile.
#
# This version merges stdout/stderr.
cleanup() {
if [ -f /tmp/makesh-$$ ]; then
cat /tmp/makesh-$$
rm -f /tmp/makesh-$$
fi
if [ "${RC}" = "beach" ]; then
# interrupted before reaping child status or weird error
echo "*** makesh: interrupted by signal before reaping child
status" 1>&2
exit 42
else
exit ${RC}
fi
}
# Run command, redirect stdout/stderr to temp file
# Remember command's exit status
RC="beach"
trap cleanup SIGHUP SIGINT SIGQUIT SIGTERM
/bin/bash -c "$@" 1>/tmp/makesh-$$ 2>&1
RC=$?
cleanup
----------------------------------------
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?22923>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
_______________________________________________
Bug-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-make