[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: automatic dependency tracking

From: Tom Tromey
Subject: Re: automatic dependency tracking
Date: 18 Jan 2002 15:53:50 -0700

>>>>> "Tom" == Tom Lord <address@hidden> writes:

Tom> Is there anything known to be non-portable about this technique
Tom> for generating a list of all included files?


Tom>    cc [-I options] -E <source-file> 
Tom>    | sed -e '{
Tom>                /^#[[:space:]]\{1,\}[[:digit:]]\{1,\}[[:space:]]\{1,\}"/!d

I think `:space:' and the like aren't portable.

Beyond that, I think `#' and `#line' are common on Unix but not
elsewhere.  Even on Unix there is some confusion; there is a recent
thread on one of the gcc lists about how these lines should be quoted
on Windows boxes (where `\' is the directory separator).

Tom> I noticed that depcomp uses something similar for some compilers,
Tom> but not others.

It is a fallback because it is a bit unreliable -- or, more precisely,
isn't known to be reliable, whereas something like using `-M' on a
known compiler is known to be reliable.  Also, for compilers that can
generate dependencies as a side effect, doing so is a performance
improvement as we don't have to preprocess twice.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]