Target: PHONY

Another important part of debian/rules file but generally of the whole world of makefiles are PHONY targets; targets which don't actually create a file, but do something.

You can have add "phony" targets to your debian/rules file too (usually are placed by default as end line); targets which don't actually create a file, but do something. These are created like normal targets: for instance, to add a "all" target to our makefile we would add :

 
all: foo 

Make sure that file "all" it's not your build directory, if not the rule won't run correctly. So we can tell make that this is a phony target and should be rebuilt always this is by using the target .PHONY. so, we can add to our Makefile:

.PHONY: all 

In fact these rule's commands won't create any target file, but will be executed every time the target comes up for remaking. Common example is the clean one:

.PHONY : clean 
clean: 
rm -.h 

Once this has been definied, make clean will run the commands with every file named clean.