help-make
[Top][All Lists]
Advanced

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

Re: multiple .PHONY or single .PHONY


From: Greg Chicares
Subject: Re: multiple .PHONY or single .PHONY
Date: Thu, 18 Feb 2010 15:25:47 +0000
User-agent: Thunderbird 2.0.0.23 (Windows/20090812)

On 2010-02-18 14:37Z, Martin d'Anjou wrote:
> 
> Is it okay to declare .PHONY multiple times, scattered throughout the 
> makefile like this:
> 
> .PHONY: all
> .PHONY: clean
> .PHONY: other

Sure. This example in the manual uses .PHONY that way:
  http://www.gnu.org/software/make/manual/html_node/Special-Variables.html

I find it clearer to keep a target and its .PHONY dependency together:

.PHONY: x
x: prerequisites
        commands
...
.PHONY: y
y: ...

The manual says the prerequisites of .PHONY are combined:

  http://www.gnu.org/software/make/manual/html_node/Prerequisite-Types.html
| Also, you may still declare multiple lines of prerequisites for the
| same target: they are appended appropriately.





reply via email to

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