On Feb 5, 2008, at 11:45 AM, Mike Shal wrote:
Pattern rules are treated a little differently. Specifically, see
section 10.5.1 "Introduction to Pattern Rules" in the make info pages:
The order in which pattern rules appear in the makefile is important
since this is the order in which they are considered. Of equally
applicable rules, only the first one found is used.
In your example, only the first pattern rule will apply, and the foo.h
dependency will be ignored.
I'm not sure this is correct. If it were, as you point out:
You could move foo.h to the line above and have a single pattern
rule to get your expected behavior in this case.
I tried this, and the behavior is unchanged. Unless there's a bug,
this implies that I have a single pattern rule:
dir/%.c: %.c | dir ; cp $< $@
The rule
dir/%.c: foo.h
does not appear to be treated as a pattern rule. (Otherwise, putting
it first would have changed the behavior.)
Derek
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make