On Thu, 2014-06-26 at 17:00 -0400, Patrick Donnelly wrote:
> This is a little inconvenient when you're relying on implicit rules.
> e.g.
> 
> %.o: %.c
>     cc -o $@ $<
> %: %.o
>     ld $@ $^
> 
> foo: bar.a
> 
> Even if foo.c is missing, Make still succeeds. This is actually what
> I'm dealing with and I'd like a method of catching a mistake like a
> missing .c file in the future.

Aha.  Now that we have a complete example we can discuss what's going on
here.

The problem--as you can actually see from the debug output you provided:

>  No implicit rule found for 'foo'.

is that because the .c file is not present, it means that make decides
that these implicit rules DO NOT MATCH.  Make checks the implicit rule
chain, but the chain fails because foo.c doesn't exist, so the %.o:%.c
rule cannot match, which means the %:%.o cannot match, so no implicit
rule matches.

Thus, there is no rule at all to build the target "foo" and make falls
back to the "no recipe provided" behavior.



_______________________________________________
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make

Reply via email to