Thanks, Noel
Paul D. Smith wrote:
%% Noel Yap <[EMAIL PROTECTED]> writes: ny> IIUC, make can use "%.mk: %.mk" to match "aoeu/aoeu.mk: aoeu.mk". ny> OTOH, IIUC, make should use "%.mk: %.mk" to match "aoeu/aoeu.mk: ny> aoeu.m" so I'm clearly missing something here.
Yes: you're missing that the string that replaces the pattern ("%") has to be THE IDENTICAL STRING in the target and the prerequisite. These are not globs, like shell wildcards or something, which are individually examined.
When make sees a rule like:
%.x : %.y
it does this: match the target pattern against the thing we're trying to build. If it doesn't match, go to the next one. If it does match, then take the string that matched the % in the target and substitute it into the % in the prerequisite (if any). Then try to see if _THAT_ target can be built.
What it does _NOT_ do is this: match the target pattern against the thing we're trying to build. If it doesn't match, go to the next one. If it does match, then try to find some file that might match the prerequisite pattern or some way to build some file that might match the prerequisite pattern. Even writing this out it's obvious that this is not a realistic algorithm.
ny> This rule is now not as generic as before; one would have to write ny> a new rule depending on where the target will be created.
Yes, you're correct. That's what you have to do.
_______________________________________________ Help-make mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/help-make
