Next: , Up: Phony Targets


4.6.2 Phony Targets Prerequisites

Normally a phony target is not be a prerequisite of a real target file, because that would mean commands are run every time make goes to update that file.

However if you have targets which you want remade everytime you run make, then this using a phony target which has a real target is a convenient way to do it.

For example, suppose one has a rule like:

     FORCE:
     
     .PHONY: FORCE
     
     # run compiler to produce preprocessor output into .pp file...
     %.pp : %.c FORCE

Something like this can be used for debugging macros and other oddities. The %.pp is never a normal target, but used explicitly on the command line like so:

     make foo.pp