[Top][All Lists]

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

Re: Wording in GNU Make manual regarding phony targets

From: Bruno Haible
Subject: Re: Wording in GNU Make manual regarding phony targets
Date: Tue, 20 Dec 2005 13:44:34 +0100
User-agent: KMail/1.5

Paul D. Smith wrote:
> You say "[Bruno] also observed that in "force" targets this is usually
> the situation" ... I didn't understand that comment?

My issue is a bit more different than just pure doc: R. Bernstein suggested
that I use .PHONY in a Makefile of mine, because that would speed up
"make"'s execution (avoiding some disk accesses). The problems I have
with .PHONY is

  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".

  2) Such a rule is hard to respect over the years, when a Makefile
     becomes bigger and bigger. It would be nice to have a GNU make
     warning option that would tell me

         Makefile:38: warning: target 'real-file.c' exists as a file but 
depends on 'force' which is phony

  3) With such a warning in place, I would sometimes have to remove
     the phonycity of a target, defeating the earlier speedups. So
     what is the right compromise between speedup and correct execution
     of a Makefile?


reply via email to

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