

The purpose of .PHONY in a Makefile - thepumpkin1979
http://stackoverflow.com/questions/2145590/what-is-the-purpose-of-phony-in-a-makefile

======
lelf
> _I have gone through this, but it is too complicated_

Really?

4.6 Phony Targets

A phony target is one that is not really the name of a file; rather it is just
a name for a recipe to be executed when you make an explicit request. <…>

    
    
         clean:
                 rm *.o temp
    

Since it has no prerequisites, the file clean would inevitably be considered
up to date, and its recipe would not be executed. To avoid this problem, you
can explicitly declare the target to be phony, using the special target .PHONY
(see Special Built-in Target Names) as follows:

    
    
         .PHONY : clean
    

Once this is done, ‘make clean’ will run the recipe regardless of whether
there is a file named clean.

~~~
leen
> _Really?_

I did not dig up the changelog of the make homepage but the linked post is
fairly old (2010) and the make manual gets updated somewhat frequently[1].

Why this was posted and upvoted tho I don't quite understand. It's not some
kind of arcane concept barely anybody knew/knows about. The accepted answer
doesn't seem to be better than the part in the current manual about it either.

[1]: > _This is Edition 0.72, last updated 9 October 2013, of The GNU Make
Manual, for GNU make version 4.0._

