#!/bin/bash
#
# Wrapper around make, to colorize it's output and pipe through less.
# Jumps to the first gcc error that occurs during the build process.
#

SIZE=`/bin/stty size`
if [ -z "${CLMAKE_OPTS}" ]; then
	CLMAKE_OPTS='-r -pError'
fi
/usr/bin/make "$@" 2>&1 | /usr/share/colormake/colormake.pl $SIZE | /usr/bin/less ${CLMAKE_OPTS}
exit ${PIPESTATUS[0]}
