[Top][All Lists]
[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: |
Wed, 7 Jul 2010 11:02:32 +0800 |
Hi psmith:
the force is in no way special to GUN make, but the .PHONY is special
to GNU make.
just like this sentence:
clean: force
rm $(objects)
force:
it's the same with:
.PHONY: clean
clean:
rm $(objects)
what's you think about?
Thanks.
---
Jiongliang
2010/7/6 Paul Smith <address@hidden>:
> On Tue, 2010-07-06 at 13:56 +0800, Jiongliang Zhang wrote:
>> 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.
>
> Please be aware that the target "FORCE" is _in no way special_ to GNU
> make.
>
> Any target, with any name, which has empty commands and prerequisites,
> will behave in exactly the same way as "FORCE" in your example above.
> You could have written:
>
> clean: FLUBBERBOTS
> rm $(objects)
> FLUBBERBOTS:
>
> and gotten the same results.
>
> "FORCE" in this context is nothing more than a common idiom among
> makefile authors, like the target name "clean"--it has no special
> meaning the the make program itself.
>
> --
> -------------------------------------------------------------------------------
> Paul D. Smith <address@hidden> Find some GNU make tips at:
> http://www.gnu.org http://make.mad-scientist.net
> "Please remain calm...I may be mad, but I am a professional." --Mad Scientist
>
>
--
Best regards!
Thanks
Jiongliang Zhang