help-make
[Top][All Lists]
Advanced

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

Re: Wording in GNU Make manual regarding phony targets


From: Dave Hylands
Subject: Re: Wording in GNU Make manual regarding phony targets
Date: Tue, 20 Dec 2005 10:54:13 -0800

Sending reply to list...

Hi Bruno,

>   1) The way he suggested it, I should also add .PHONY to the "force"
>      target. But since sometimes we have a dependency
>
>         real-file.c : ... force
>
>      this would violate the documented rule that "A phony target should
>      not be a prerequisite of a real target file".

I would amend that slightly. Certainly for "normal" makefiles this is
the case. But if you have targets which you want remade everytime you
run make, then this is the way to do it.

For example, I typically have a rule like:

FORCE:

.PHONY: FORCE

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

I normally use this for debugging macros and other oddities. The %.pp
is never a normal target, but always used explicitly on the command
line like so:

make foo.pp

--
Dave Hylands
Vancouver, BC, Canada
http://www.DaveHylands.com/




reply via email to

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