redo-ifchange config.sh
. ./config.sh
cat > $3 <<-EOF
if [ -e "\$1.cpp" ]
then
  CC=g++
  EXT=.cpp
else
  CC=gcc
  EXT=.c
fi

\$CC -MD -MF \$1.d -c -o \$3 \$1\$EXT $CFLAGS
EXIT=\$?

read DEPS < \$1.d
redo-ifchange \${DEPS#*:} src/pch.h.gch

exit \$EXIT
EOF
chmod a+x $3
