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: Boris Kolpackov
Subject: Re: Why does this pattern rule fail?
Date: 25 Jan 2005 21:42:52 GMT
User-agent: nn/6.6.5+RFC1522

"Darren Hiebert" <address@hidden> writes:

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

If you cannot write such a rule what other options do you have?

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

I don't see how it is a counterpoint to my suggestion? Nothing would
change for your example if GNU make weren't doing all this jumping
through the hoops.

> This implies that the fact that the target and its dependency have
> subdirectory portions should not affect the application of the rule.

What you don't realize is that in order to "declare" an implicit rule
usable, two criteria should be met:

1. The target patter should match (%.o in your case).

2. All (implicit) prerequisites should either exist or there should
   be rules to build them.

You rule fails because the second criterion is not met. The quote
you presented above has no effect on 2 whatsoever.


> 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.

I can't see how make should find subdir1/file.c with the following
vpath:

VPATH = subdir2
vpath %.c subdir2

Unless, of course, subdir2/subdir1/file.c exits. Does it?

-boris



reply via email to

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