A further note: it's version 4.3 of make

On 10/4/22 14:57, Mikhail Pomaznoy wrote:

Greetings,

I have encountered weird behavior in make and tried to isolate it.  The software was built from source.

I have the following Makefile:

|RECIPE = echo "Making $@ from $^" > $@||
||T.1 : A.4 A.4.ind; $(RECIPE)||
||A.4 : A.3 A.3.ind ||
||    $(RECIPE)||
||A.2 :||
||    $(RECIPE)||
||A.3 : A.2||
||    $(RECIPE)||
||A.3.ind A.4.ind : %.ind : %||
||    $(RECIPE)||
||.SECONDARY:|

And the current directory contains///A.3.in//d///and /A.4.ind/ .

I want to make target /T.1//. /If I run

|make T.1|

Then the following commands are executed:

|echo "Making A.2 from " > A.2||
||echo "Making A.3 from A.2" > A.3||
||echo "Making A.4 from A.3 A.3.ind" > A.4||
||echo "Making T.1 from A.4 A.4.ind" > T.1|

I.e. /A.4.ind/ and /A.3.ind /are never updated, while /A.4/ was updated. It means the very last command will use invalid A.4.ind file. This is a bit unexpected to me already. Moreover, if I remove .SECONDARY,/A.4.ind/ or /A.3.ind/ ARE updated while preparing /T.1./

Could you please clarify or investigate ?

-Mikhail

Reply via email to