Re: mkdep bug: creates too many dependencies

Michael Elizabeth Chastain (mec@shout.net)
Thu, 5 Feb 1998 17:19:55 -0600


Hi Peter,

> mkdep.c doesn't honour #if when calculating dependencies.
>
> E.g.
>
> #ifndef __KERNEL__
> # include <false_positive.h>
> #endif

That's true, and it's a feature. If you change the configuration or
the command-line options, then foo.c may come to depend on
false_positive.h after all. People don't run 'make dep' every time
they change something that might affect this, and it would be sticky
to even compute the set of flags needed (because some of them are
tucked away in local Makefiles). So 'make dep' conservatively makes
dependencies on all of them.

In the long run, I plan to eliminate 'make dep' completely. If a
file doesn't have a dependency list, it needs to be compiled, and
the dependency list needs to be calculated. This produces the first
compilation.

If a file does have a dependency list, and any dependency is out of date,
it needs to be recompiled, *and the dependency list needs to be remade*.
This keeps the dependency list always up-to-date.

I have implemented this feature in my Dancing Makefiles,
<ftp://ftp.shout.net/pub/users/mec/experimental/dancing-makefiles.2185>.
I use 'gcc -MD' to compute the dependencies. It works very fast and
nicely, and it completely handles this problem.

Right now I don't have plans to port this single feature to 2.1.XX
because mkdep.c does a good enough job most of the time.

> Incidentally, mkdep.c also misparses
>
> # /**/ include <false_negative.h>
>
> but don't fix this bug until the first one is fixed (if at all) :) .

Also fixed in Dancing Makefiles because gcc -MD does the parsing
(there is no more mkdep.c).

Regards,

Michael Chastain
<mailto:mec@shout.net>
"love without fear"
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu