help-make
[Top][All Lists]
Advanced

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

Re: is "force" a keyword in prerequisites


From: Sam Ravnborg
Subject: Re: is "force" a keyword in prerequisites
Date: Mon, 5 Jul 2010 13:16:03 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

On Mon, Jul 05, 2010 at 10:07:36AM +0800, Jiongliang Zhang wrote:
> Hi All,
> 
> I found this format in GNUmakefile:
> 
> mytarget : force
>         command
> 
> but I can't find force as target or something else. it just appeared
> in the prerequisites.
> Can you tell me what's the force mean in here.

"force" is a shorthand to say: always execute this command.
In the above code-snippet you left out a few things.
It usually looks like this:

mytarget: prerequisite(s) force
        command

.PHONY: force


So if any of the prerequisite(s) are in the 
dependency chain then make will also try to update
mytarget due to the dependency on "force".

        Sam



reply via email to

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