Re: source dependencies cleanup?

Raja R Harinath (harinath@cs.umn.edu)
03 Dec 1996 19:37:53 -0600


"Peter T. Breuer" <ptb@oboe.it.uc3m.es> writes:
> "A month of sundays ago Paul Flinders wrote:"
> > > From: Peter T. Breuer <ptb@oboe.it.uc3m.es>
> > > b) it requires you to recompile every touched file every time you make
> > > any update to your system, even if you don't want those files to be
> > > compiled. Call the time to recompile the dependencies as it goes X.
> > > Call the time to recompile the object code Y. So the total is X + Y.
> >
> > Without doing a lot of work at a sub-file granularity I would be reluctant
> > *not* to re-compile a file which had been touched as part of an update.
>
> That's wrong. Linus updates the alpha stuff practically every release,
> and I am not going to recompile _that_! Then there is the m68k stuff,
> the scsi stuff on a non-scsi machine, all the net drivers that I don't
> need (I only have one type of card and I use it as a versioned module)
> plus the sound that I don't use, all the isdn stuff, all the file systems
> that I don't use etc. etc. etc.

This is orthogonal to `mkdep'.

It is the makefile rules that control what is relevant (which of the
updated files actually belongs to the kernel). One can generate/include
only dependencies of relevant files using either method, `mkdep' or `gcc
-MD'.

> > > c) because of b) (and a)!), it is a lot slower than a makedep follwed
> > > by a conditional recompilation. Suppose the makedep takes an extra
> > > 20% of Y, but that after the makedep I only have to actually recompile
> > > 50% of my files. Then the time to recompile is
> > > 0.2*Y + 0.5*Y = 0.7*Y
> > >
> > > This cannot be worse that X+Y!! You would only have a chance of winning
> > > out if I had to recompile 80% of my files after an upgrade, which is
> > > not the case.
> > >
> > > In any case, what really happens is that I run mkdep, which takes 0s
> > > effectively, and then get a slightly worse approximation to the files
> > > taht I need to recompile. Say I have to recompile 60% instead of 50%.
> > > Then the total time used is
> > > 0 + 0.6*Y = 0.6*Y
> >
> > The amout of extra time taken by -MD is *very* small. I don't see why
>
> I know. I called it X.
>
> I only assume that it is positive. It could be 0.0001*Y as far as I
> am concerned and the above shows that it is still too large! You can't
> beat the math. My point was that 0.7*Y NOT GREATER THAN Y + X.

I come up with (0.5 + 0.0001) * Y for `gcc -MD', given my set of
assumptions (and my understanding of how you use X & Y :-).

> > b) I can forget to do it (make depend)

I use Debian's `make-kpkg' to "fix" that.

- Hari

-- 
Raja R Harinath ------------------------------ harinath@cs.umn.edu
"When all else fails, read the instructions."      -- Cahn's Axiom
"Our policy is, when in doubt, do the right thing."   -- Roy L Ash