bug-make
[Top][All Lists]
Advanced

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

Re: Question about pattern rule with multiple targets


From: Philip Guenther
Subject: Re: Question about pattern rule with multiple targets
Date: Fri, 27 Jun 2014 14:34:38 -0700

On Fri, Jun 27, 2014 at 11:24 AM, Tom Varga <address@hidden> wrote:
On page 120 of the gnumake manual, it mentions support for pattern
rules with multiple targets.

This pattern rule has two targets:
%.tab.c %.tab.h: %.y
bison -d $<

So, if I have a simple rule that looks like:

%.bar1 %.bar2 : %.foo
touch $(*F).bar1
touch $(*F).bar2

and then do:

> touch a.foo
> make a.bar1
touch a.bar1
touch a.bar2
> make a.bar1
make: 'a.bar1' is up to date.
> rm a.bar2
> make a.bar1
make: 'a.bar1' is up to date.
> make a.bar2
touch a.bar1
touch a.bar2

What I was really hoping is that make would consider both a.bar1 and
a.bar2 to be required outputs of the rule and if one of them is
deleted, then both the .bar1 and .bar2 targets should be considered
out-of-date.  But when I manually remove the a.bar2 file, the a.bar1
file is still considered to be up-to-date.  Yet, when I then ask to
build the a.bar2 target, both the a.bar1 and a.bar2 targets are
re-built.

Umm, why isn't this solved by having a correct dependency on a.bar2 where necessary?


Philip Guenther


reply via email to

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