From: Alexandre Oliva Date: Tue, 27 Apr 1999 15:57:42 +0000 (+0000) Subject: * depcomp (gcc): Imported comments removed from depend2.am, so X-Git-Tag: user-dep-gen-merge-branchpoint~10 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=63e374ea551ba739b7855cc6b10e4cfa12589d11;p=thirdparty%2Fautomake.git * depcomp (gcc): Imported comments removed from depend2.am, so that we don't lose them. --- diff --git a/ChangeLog b/ChangeLog index 614add582..2d5ad82d7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 1999-04-27 Alexandre Oliva + * depcomp (gcc): Imported comments removed from depend2.am, so + that we don't lose them. + * m4/depout.m4 (AM_OUTPUT_DEPENDENCY_COMMANDS): Avoid sed s/$U// when not using ansi2knr. diff --git a/depcomp b/depcomp index 694ec3ce1..951a984ca 100755 --- a/depcomp +++ b/depcomp @@ -36,6 +36,15 @@ rm -f "$tmpdepfile" case "$depmode" in gcc) +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). +## - Using -M directly means running the compiler twice (even worse +## than renaming). if "$@" -Wp,-MD,"$tmpdepfile"; then : else stat=$? @@ -45,8 +54,17 @@ gcc) rm -f "$depfile" echo "$object : \\" > "$depfile" sed 's/^[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the `deleted header file' problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. tr ' ' ' -' < "$tmpdepfile" | \ +' < "$tmpdepfile" | +## Some versions of gcc put a space before the `:'. On the theory +## that the space means something, we add a space to the output as +## well. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;;