> I think this is correct behavior.  Why do you think the rules for the 'all'
> target should not be executed?  The else part states that all targets matching
> % depend on all, so its rules get run first.

I'm just puzzled because of the _different_ behaviour in ifeq- and else clause:
They only differ in that the match anything rule of the ifeq clause has no
dependency, while the match anything rule in the else clause depends on "all".
And due to that difference, only the recipe for the specific rule for target
t1 is executed in the ifeq clause (ok! :-)), while both the recipes for the 
specific
_and_ the match anything rules are executed for the else clause (why? :-().

The following, slightly modified example makes my point even clearer.
Furthermore, it shows that something is going wrong with putting the right
target into $@:

t1: ; @echo 'specific rule for target $@'
ifeq (,$(UNEXPECTED))
   %: ; @echo 'expected match anything rule for target $@'
else
   %: all ; @echo 'unexpected match anything rule target $@? - $$@ should 
contain $(MAKECMDGOALS)!'
endif
all: ; @echo 'rule for target $@'

$ make t1
specific rule for target t1

$ make UNEXPECTED=true t1
rule for target all
unexpected match anything rule target Makefile? - $@ should contain t1!
specific rule for target t1


_______________________________________________
Help-make mailing list
Help-make@gnu.org
https://lists.gnu.org/mailman/listinfo/help-make

Reply via email to