This doesn't affect your explanation as a whole, but ...

On Tue, Jan 29, 2002 at 08:35:54AM -0600, Michael Elizabeth Chastain wrote:
> The way that the dependencies are set up is:
> 
>   foo.o: foo.c bar1.h
>     gcc -D __KERNEL__ ... -o foo.o foo.c
> 
>   bar1.h: bar2.h
>     touch bar1.h
>  
> So when you update bar2.h, then Make will update the timestamp on
> bar1.h by touching it (causing you the problem with read-only files),
> which causes foo.o to be out-of-date and rebuilt.
> 
> Suppose that you nuke out that "touch" command.  And then you update
> bar2.h.  Then bar1.h is out of date, and foo.o will be rebuilt.

This isn't accurate.  bar1.h is out of date, but if its rule doesn't
change its timestamp, so that bar1.h is still older than foo.o,
foo.o will not be rebuilt.  IOW, make doesn't equate "running its
rule" with "updating it".

Tested with GNU make 3.79.1:

% cat Makefile 
foo.o: bar1.h
        touch foo.o
bar1.h: bar2.h
% touch bar1.h; sleep 1; touch foo.o; sleep 1; touch bar2.h
% make
make: `foo.o' is up to date.

Andrew

_______________________________________________
kbuild-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/kbuild-devel

Reply via email to