You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
385 B

#!/bin/bash
# makelog - Redirect make's output into logfile
usage() {
echo "Usage: makelog <target>..."
}
test "$1" == "--help" && { usage; exit 0; }
test -z "$1" && { usage; exit 1; }
logfile=$(mktemp makelog.XXXXXX)
trap "rm -f $logfile" EXIT
time make $* 2>&1 | tee $logfile
mkdir -p build_tmp
echo -e "\nmake $*:\n" >> build_tmp/make.log
cat $logfile >> build_tmp/make.log