help-make
[Top][All Lists]
Advanced

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

Re: Finding second route through rules


From: Steven Simpson
Subject: Re: Finding second route through rules
Date: Wed, 20 Jan 2016 18:08:29 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1

Hi!

Did this slip under the radar?

Thanks!

On 09/12/15 17:25, Steven Simpson wrote:
Just noticed a change in behaviour between 3.81 and 4.1:

%.foo: %.bar
    @echo from bar

%.foo: %.baz
    @echo from baz

%.baz: %.qux
    @echo from qux

%.bar: %.quux
    @echo from quux

gwonk: a.bar


So there is a route from a.quux -> a.bar -> a.foo, and from a.qux -> a.baz -> a.foo. The first is preferred, as implied by the ordering of the first two rules, AIUI.

Create a.qux, and ensure no other a.* files exist, so the second route ought to be chosen. Then [make a.foo].

$ ls
a.qux  Makefile
$ make a.foo
from qux
from baz
$ make -v
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for x86_64-pc-linux-gnu


So Make has chosen the second route, because the first is incomplete.



$ ls
a.qux  Makefile
$ make a.foo
make: *** No rule to make target 'a.bar', needed by 'a.foo'. Stop.
$ make -v
GNU Make 4.1
Built for x86_64-unknown-linux-gnu
Copyright (C) 1988-2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.


It seems that Make 4.1 is fixated on the first route, just because the intermediate step a.bar is mentioned as a prerequisite. Disable the gwonk line, and it's fine again.

Just tried on the latest in git, and it is there too.

Is this intended?



reply via email to

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