help-make
[Top][All Lists]
Advanced

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

FW: Generated makefiles


From: BShah
Subject: FW: Generated makefiles
Date: Wed, 7 Aug 2002 18:34:34 +0100

(Forgot to forward to the group earlier!)

See inline

> %% address@hidden writes:
> 
>   b> If a generated makefile is included and it doesexist, and rule to
>   b> make the makefile exists, gmake will remake the makefile only if
>   b> that makefile is out of date, and then re-invoke itself.
> 
>   b> The second statement appears to be the problem as I am seeing the
>   b> makefile being regenerated but make is NOT restarting.
> 
>   b> Anyone have any ideas about this?
> 
> You should use the -d option and see what's going on.  It 
> might be that
> make _is_ restarting, you just can't tell.
> 
> Or it might be that your rule does not convince make that the file was
> really changed: if make thinks that your rule didn't actually do
> anything then it won't consider the target to be modified.
> 
> At any rate, using -d should give you all the details you need.

Well, -d did give me the information I needed. It was definitely not
re-invoking make when the makefile was being remade. Now, the reason for
this is complex, but I found it with the debug output.

Basically, the particular makefile (file1) in question WAS being regenerated
but was being regenerated BEFORE gmake had gotten around to considering it,
as a result of another makefile (file2) that could also be generated. This
meant that when make had gotten around to considering file1, it was
considered to be up to date. This meant that gmake went ahead with its job
but with old information!

This was purely by chance since file2 was considered before file1 by gmakes
algorithm. I found the link was actually quite a complex chain so it wasn't
simple to see where the problem occured.

I believe this could be buggy behaviour - gmake should probably reconsider
the timestamps at the end of its "makefile targets" check. While not
strictly necessary if you have done your makefiles correctly, it might help
to get out of odd situations like this one... What do you think?

B.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]