Hi,

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?

Thanks,

Steven

_______________________________________________
Help-make mailing list
Help-make@gnu.org
https://lists.gnu.org/mailman/listinfo/help-make

Reply via email to