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: Jiongliang Zhang
Subject: Re: is "force" a keyword in prerequisites
Date: Tue, 6 Jul 2010 13:56:31 +0800

As the documentation said:
http://www.gnu.org/software/automake/manual/make/Force-Targets.html#Force-Targets

the force target make the target always execute, and the force also a
target, but both it's prerequisites and commands are empty.

     clean: FORCE
             rm $(objects)
     FORCE:

it was the same as .PHONY, but not all makefiles can read the special
target, GNUmake can read.

thanks all for help me.

2010/7/5 Sam Ravnborg <address@hidden>:
> 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
>



-- 
Best regards!
Thanks
Jiongliang Zhang



reply via email to

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