One of them didn't clean away .d.tmp files properly.
The other would overwrite the .d files unconditionally, thereby
causing a possibly unnecessary dependency rebuild, which touches the
date of Makefile, which causes a possibly unnecessary rebuild of
buildinf.h and everything that depends on that.
Reviewed-by: Andy Polyakov <appro@openssl.org>
rm -f \$\@.tmp; touch \$\@.tmp
-\$(MAKEDEPEND) -f\$\@.tmp -o"|$obj$objext" -- \$(CFLAGS) $ecflags$incs -- $srcs \\
2>/dev/null
- sed -e 's/^.*|//' -e 's/ \\/\\(\\\\.\\|[^ ]\\)*//g' -e '/: *\$\$/d' -e '/^\\(#.*\\| *\\)\$\$/d' \$\@.tmp > \$\@
- rm \$\@.tmp
+ sed -i -e 's/^.*|//' -e 's/ \\/\\(\\\\.\\|[^ ]\\)*//g' -e '/: *\$\$/d' -e '/^\\(#.*\\| *\\)\$\$/d' \$\@.tmp
+ \@if ! cmp \$\@.tmp \$\@ > /dev/null 2> /dev/null; then \\
+ mv \$\@.tmp \$\@; \\
+ else \\
+ rm -f \$\@.tmp; \\
+ fi
EOF
$deps = $obj.$depext;
}
\@touch $obj$depext.tmp
\@if ! cmp $obj$depext.tmp $obj$depext > /dev/null 2> /dev/null; then \\
mv $obj$depext.tmp $obj$depext; \\
+ else \\
+ rm -f $obj$depext.tmp; \\
fi
EOF
}