|
From: | Martin Dorey |
Subject: | Re: .SECONDARY unexpectedly affects rule invocation |
Date: | Wed, 5 Oct 2022 01:48:45 +0000 |
> A
further note: it's version 4.3 of make
Behavior seems the same to me from (at least) 3.81 to 4.3.91 (inclusive). Isn't this slightly simplified example sufficient to demonstrate the same behavior...
RECIPE = echo "Making $@ from $^" > $@
T.1 : A.4 A.4.ind; $(RECIPE)
A.4 :; $(RECIPE)
A.4.ind : A.4; $(RECIPE)
.SECONDARY: A.4
martind@sirius:~/tmp/Pomaznoy-2022-10-04$ rm -f T.1 A.2 A.3 A.3.ind A.4 A.4.ind; touch A.4.ind; make
echo "Making A.4 from " > A.4
echo "Making T.1 from A.4 A.4.ind" > T.1
martind@sirius:~/tmp/Pomaznoy-2022-10-04$ make
echo "Making A.4.ind from A.4" > A.4.ind
echo "Making T.1 from A.4 A.4.ind" > T.1
martind@sirius:~/tmp/Pomaznoy-2022-10-04$
... whereby Make causes A.4.ind to become out of date by building non-existent A.4, yet doesn't seem to notice? With --debug=all, it seems to decide that there's no reason to remake A.4.ind before it causes such a reason:
Considering target file 'T.1'.
File 'T.1' does not exist.
Considering target file 'A.4.ind'.
Finished prerequisites of target file 'A.4.ind'.
Prerequisite 'A.4' of target 'A.4.ind' does not exist.
No need to remake target 'A.4.ind'.
Considering target file 'A.4'.
File 'A.4' does not exist.
Finished prerequisites of target file 'A.4'.
Must remake target 'A.4'.
The subsequent invocation of make causes it to realize that A.4.ind needs updating and hence T.1 does too.
I don't immediately see how this is documented by https://www.gnu.org/software/make/manual/html_node/Chained-Rules.html#Chained-Rules, though .SECONDARY is not
something I'm familiar with.
From: Bug-make <bug-make-bounces+martin.dorey=hds.com@gnu.org> on behalf of Mikhail Pomaznoy <mikpom@mikpom.ru>
Sent: Tuesday, October 4, 2022 17:16 To: bug-make@gnu.org <bug-make@gnu.org> Subject: Re: .SECONDARY unexpectedly affects rule invocation ***** EXTERNAL EMAIL *****
A further note: it's version 4.3 of make On 10/4/22 14:57, Mikhail Pomaznoy wrote:
|
[Prev in Thread] | Current Thread | [Next in Thread] |