Re: source dependencies cleanup?

Paul Flinders (ptf@datasci.co.uk)
Tue, 3 Dec 1996 21:36:09 -0000


> From: Andrew E. Mileski <aem@nic.ott.hookup.net>
> > Out of interest why doesn't the kernel use -MD to generate dependancies
> > on the fly.
> >
> > If the answer is that we don't want to be tied to gcc then I would
suggest
> > that it's already too late for that.
>
> I _think_ the answer is, GCC is simply too slow. The 'mkdep.c' utility
> doesn't have all the baggage of GCC, and is very fast.

Everybody who has replied has confused -MD with -M

-M makes gcc output dependancies to stdout, it needs a separate
pass to be made use of and is slow. When I did do dependancies
this way I quickly discovered that it's faster to do it in Perl as some
people have mentioned.

-MD makes the preprocessor output the dependancies to a separate
file during normal compilation. It adds just the amout of time taken to
open a file and spit half a K or so to it to the compilation. The need
for a separate "make depend" phase goes away and the dependancies
can't get out of date.

"make config" seems to result in most things being re-compiled anyway
as a result of <linux/config.h> and <linux/autoconf.h> being touched.
This could be avoided but only at the expense of splitting the config
options into several files.

Regards

Paul.