redo-ifchange build/config.sh
. build/config.sh

TEMPFILE=`mktemp $1.XXXXXX` || exit 1
cp $1 $TEMPFILE

g++ -MD -MF $1.d -c -x c++-header $TEMPFILE $CFLAGS
EXIT=$?

mv $TEMPFILE.gch $3
rm $TEMPFILE

sed -i '' -e 's@src/pch\.h\.......@src/pch\.h@' $1.d
read DEPS < $1.d
redo-ifchange ${DEPS#*:}

exit $EXIT
