tech-toolchain archive

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

Re: make: ignore stale .depend



> > The problem is that 'mkdep' puts the path of .c files into .depend
>
>In that case, the fix is to change mkdep :-) but I don't see that this
>is the real problem.

Agreed.  It would have been better to say the problem arises because...

>The real problem is that the list of files on the right-hand-side of a
>.depend line is a derived piece of data, it's out of date with respect
>to its source information, and it's not getting rebuilt at the right
>time.

Agreed.  As I've noted before, generating that data as a side effect of
compilation mitgates a lot of the issues.

This problem is also pretty much solved in meta mode.

>The only proper fix is to express that dependency correctly and let
>the normal mechanisms of make take care of it. 

To some extent, yes.  Make doesn't however have a mechanism for
forgetting nodes and recomputing them, so you still face the issue of it
learning a bogus dependency and being stuck with it.
The current FROM_DEPEND etc flag at least allows make to discount such
dependencies. 

>gmake has a feature that lets it rebuild and rescan included makefile
>fragments that are out of date; ISTM that this, combined with correct
>rules for the .depend and *.d files (which we do not currently have),
>should solve the problem completely and permanently.

The suggested way to use that is much the same as my autodep.mk
and the auto-regeneration can lead to problems too.

I stopped using gmake seriously 15 years ago, and my experience since
hasn't been encouraging.  BTW  the suggested rules for handling .d's
introduce a race condition ;-)

>There is no need to treat rules read from .depend in a special way and
>we really ought to remove that logic.

Assuming you have a better solution implemented, sure (and I'm not
convinced gmake's example counts).
Until then though the current hacks are better than nothing.

--sjg


Home | Main Index | Thread Index | Old Index