%% Bertrand Petit <[EMAIL PROTECTED]> writes:
bp> I use pattern rules with no dependency to perform some generic
bp> actions such as:
bp> %-clean:
bp> cd $* ; $(MAKE) clean
bp> this works well if there is no .PHONY target related to the pattern
bp> rule.
bp> Now prepend this with a .PHONY target as follows:
bp> .PHONY: src-clean
I was mistaken in my initial impression; this actually isn't a bug. In
fact, it's documented behavior. The GNU make manual says:
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, you cannot mark a target as .PHONY if you want to use it in an
implicit rule search; make won't do implicit rule searches on .PHONY
targets.
You can use the FORCE alternative to .PHONY, or you can use static
pattern rules instead of implicit rules.
HTH...
--
-------------------------------------------------------------------------------
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