help-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why does this pattern rule fail?


From: Darren Hiebert
Subject: Re: Why does this pattern rule fail?
Date: 24 Jan 2005 12:33:12 -0800
User-agent: G2/0.2

Of course, this suggestion requires that I write lots of rules, rather
than letting one pattern rule handle them all.

But, as a counterpoint to your suggestion, consider this passage from
the make info doc (info:/make/Pattern Match):

----- begin quote -----
"When the target pattern does not contain a slash (and it usually
does not), directory names in the file names are removed from the file
name before it is compared with the target prefix and suffix. After the
comparison of the file name to the target pattern, the directory names,
along with the slash that ends them, are added on to the prerequisite
file names generated from the pattern rule's prerequisite patterns and
the file name. The directories are ignored only for the purpose of
finding an implicit rule to use, not in the application of that rule.
Thus, `e%t' matches the file name `src/eat', with `src/a' as the stem.
When prerequisites are turned into file names, the directories from the
stem are added at the front, while the rest of the stem is substituted
for the `%'. The stem `src/a' with a prerequisite pattern `c%r' gives
the file name `src/car'."
----- end quote -----

This implies that the fact that the target and its dependency have
subdirectory portions should not affect the application of the rule.
And if that isn't sufficiently convincing, then consider that the VPATH
is supposed to find where a source file is so that an implicit rule can
still work.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]