%% Simon Liddington <[EMAIL PROTECTED]> writes:
sl> %.ot: %.dependency
sl> cat $< > $@
sl> goal:
sl> $(MAKE) timestamp module.ot
sl> .PHONY: timestamp module.ot
sl> timestamp:
sl> date > module.dependency
sl> I get this:
sl> sjl@faraday:~/make% make
sl> make timestamp module.ot
sl> make[1]: Entering directory `/mnt/home/sjl/make'
sl> date > module.dependency
sl> make[1]: Nothing to be done for `module.ot'.
sl> make[1]: Leaving directory `/mnt/home/sjl/make'
sl> Why isn't module.ot rebuilt?
sl> It only seems to be a problem for targets with implicit patterns.
I can see where you might feel this behavior is surprising, but it's
documented to work like this.
>From the GNU make manual, section "Phony Targets":
Since it knows that phony targets do not name actual files that
could be remade from other files, `make' skips the implicit rule search
for phony targets (*note Implicit Rules::.). This is why declaring a
target phony is good for performance, even if you are not worried about
the actual file existing.
So, no implicit rule search is done on module.ot since you declared it
to be phony. Since no implicit rule search is done, make has no
commands to use to build module.ot, so it just assumes that it was
rebuilt without actually doing anything... exactly the behavior you're
seeing.
Using FORCE rules or making module.ot an explicit instead of an implicit
target will solve this problem.
--
-------------------------------------------------------------------------------
Paul D. Smith <[EMAIL PROTECTED]> Find some GNU make tips at:
http://www.gnu.org http://www.ultranet.com/~pauld/gmake/
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist