On 2010-05-25 20:35Z, J.T. Conklin wrote:
> A co-worker started adding .PHONY: targets for each included makefile
> fragment.  For example, changing:
> 
>    include Foo.mk
> 
> to:
> 
>    .PHONY: Foo.mk
>    include Foo.mk
> 
> arguing that this suppresses gmake from attempting to regenerate
> Foo.mk using dozens of implicit rules, and therefore improving
> performance.
> 
> I've never seen .PHONY used in this way, but from the gmake -d output
> I see it indeed does what he claims.  Are there any reason why not to
> use .PHONY this way?  Is there a better idiom to use to avoid rebuilds
> of Makefile fragments.

I feel a little squeamish about that because the 'make' manual says:
  "A phony target is one that is not really the name of a file."
but 'Foo.mk' really is the name of a file. Here's how I do it:

include $(src_dir)/whatever.make
$(src_dir)/whatever.make:: ;

and the rationale is in this message:

http://lists.gnu.org/archive/html/help-make/2006-03/msg00008.html

_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to