From a2bce72255d2d4013ca2dff8b94250a0ca85160e Mon Sep 17 00:00:00 2001 From: Avery Pennarun Date: Mon, 21 Feb 2011 03:57:48 -0800 Subject: [PATCH] Simplify autodependency examples. Turns out we don't need sed to process the output of gcc -MD. We can just do this: read DEPS $3 cat <<-EOF redo-ifchange \$1.c - gcc $CFLAGS -MD -MF \$3.deps.tmp -o \$3 -c \$1.c - DEPS=\$(sed -e "s/^\$3://" -e 's/\\\\//g' <\$3.deps.tmp) - rm -f \$3.deps.tmp - redo-ifchange \$DEPS + gcc $CFLAGS -MD -MF \$3.deps -o \$3 -c \$1.c + read DEPS <\$3.deps + rm -f \$3.deps + redo-ifchange \${DEPS#*:} EOF chmod +x $3