Hi, GCC 3.0 doesn't still exactly implement exactly what 'depcomp' wants. The problem is that if the compile fails, the file specified to -MF is deleted too. With 'gcc -MF $depfile', $depfile is deleted. But, $depfile is eventually included by the Makefile -- so subsequent 'make' invocations will fail, since an included file doesn't exist. I don't know if this a GCC bug. I'm assuming it's not -- it makes sense to clean up if the compile fails; the compiler doesn't provide rollback for -o, why should it provide rollback for -MF. Here's a patch to fix this problem. (The 'if' statement looks slightly peculiar, but it matches similar 'if's used in the rest of the file.)
from Raja R Harinath <[EMAIL PROTECTED]> * depcomp (gcc3): Protect against the compiler deleting the dependency output file. Index: depcomp =================================================================== RCS file: /cvs/automake/automake/depcomp,v retrieving revision 1.17 diff -u -p -u -r1.17 depcomp --- depcomp 2001/02/10 01:26:54 1.17 +++ depcomp 2001/02/18 00:52:27 @@ -51,8 +51,14 @@ case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! - exec "$@" -MT "$object" -MF "$depfile" -MD -MP - ;; + if "$@" -MT "$object" -MF "$tmpdepfile" -MD -MP; then : + else + stat=$? + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; gcc) ## There are various ways to get dependency output from gcc. Here's
- Hari -- Raja R Harinath ------------------------------ [EMAIL PROTECTED] "When all else fails, read the instructions." -- Cahn's Axiom "Our policy is, when in doubt, do the right thing." -- Roy L Ash