[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: is "force" a keyword in prerequisites
From: |
Paul Smith |
Subject: |
Re: is "force" a keyword in prerequisites |
Date: |
Tue, 06 Jul 2010 02:35:30 -0400 |
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