help-make
[Top][All Lists]
Advanced

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

Re: rule w/multiple targets causes failure in -j mode; how to fix


From: Jamie Cuesta
Subject: Re: rule w/multiple targets causes failure in -j mode; how to fix
Date: Sun, 22 Mar 2009 13:15:32 -0700 (PDT)

Eric Melski wrote:

> You can work around that by having the generate_output rule
> also create a file on disk named "generate_output"; then on
> the second run, make will see that the file
> "generate_output" is not newer than output.h or output.o,
> and will not rebuild.  

This is a workable solution.  I can add this to the rule-writing code in  my 
makefile generator w/o much effort.  And give such files special names that 
make their purpose fairly self-evident.

> But now you have this extra file kicking around that serves no purpose
> other than to work around a deficiency in your build tool.

A deficiency?  I thought it would have reached (design) perfection by now. 
<grin>

> And you need to remember to manage that file along with your other
> objects -- it should get deleted by "make clean", for example.

Given that a "make clean" amounts to deleting all output-directory content, 
this is not a problem.

> And if somebody does something like "touch generate_output" in
> between builds, that may mess up make's ability to detect that
> output.h and output.o need to be rebuilt.

Fortunately my users perform such activities only at their own risk.

> Actually, a third option just occurred to me:
 
> I'm sure this has some drawback too, but I haven't had my
> morning coffee yet, so I'm not sure what that is.

Well, Eric, you've already given me a perfectly adequate solution, so please 
take your time in vetting this 'extra-credit' one<grin>

Thank you very much for your help!

Jamie







reply via email to

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