It appears that rule chaining only works one level deep.
Can anyone explain what I'm doing wrong here?

I was under the impression that the way make works in deciding if a pattern rule applies is:
* if all prerequisites exist or can be made, then the rule applies
* if several rules 'can' apply, the one used is the first appearing in the makefile order

If the above is a correct understanding, then I expect make to use my explicit rule for 'foo.b' instead of the match-anything rule which comes later.

I am unable to build target 'foo' in the makefile below.

#makefile
%: %.a
touch $@

%.a: %.b
touch $@

foo.b:
touch $@

%:
$(error No rule for target: $@))
#eof

[greg@p3 src]$ make foo
Makefile:12: *** No rule for target: foo. Stop.

If I eliminate the middle pattern rule, it works fine.

#makefile
%: %.a
touch $@

foo.a:
touch $@

%:
$(error No rule for target: $@))
#eof

[greg@p3 src]$ make foo
touch foo.a
touch foo



- Greg Keraunen
http://www.xmake.org
http://www.xmlmake.com



_______________________________________________
Help-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-make

Reply via email to