help-make
[Top][All Lists]
Advanced

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

Re: Wording in GNU Make manual regarding phony targets


From: R. Bernstein
Subject: Re: Wording in GNU Make manual regarding phony targets
Date: Mon, 19 Dec 2005 18:46:06 -0500

Paul D. Smith writes:
 > Hi; I'm certainly not adverse to changing the wording to be more clear,
 > but I'd like to understand what you mean first.
 > 
 > You say "[Bruno] also observed that in "force" targets this is usually
 > the situation" ... I didn't understand that comment?

I'm not sure, but here is one possibility.  Let's say I'm using
automake. I could add something like this to the end

ifdef FORCE
$($(bin_PROGRAMS)_OBJECTS): force
endif 

and this would have all objects and binaries to get remade if I run
setting FORCE (e.g. "make FORCE=1") no matter how I change the
Makefile otherwise. 

 > Second, you discuss using .PHONY targets "where one tracing, profiling,
 > or debugging code working by instrumenting/augmenting the Makefile"; I
 > don't follow that either.  A mark of .PHONY is transitive: by that I
 > mean that if you mark a target as .PHONY then all the targets that
 > depend on that target are ALSO implicitly .PHONY; they will always be
 > rebuilt.
 > 
 > So, I don't see how it can be used for temporary measures like debugging
 > or tracing...?  Unless you mean editing the file to turn on/off the
 > .PHONY-ness; but in that case wouldn't it be simpler to just use -W or
 > similar?

You are right, this doesn't make any sense. Whatever I was thinking
was wrong. My bad.

That said, the point remains that when one has a feature or mechanism
others will find ways to use it -- sometimes in ways that weren't
considered initially. It may be an okay as a rule of thumb thing that
phony targets are generally not prerequisites of real target
files. But to suggest they "should not be" may be a bit too
strong. There may be times when such as that given above where this is
*exactly* what is desired.




reply via email to

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