On Tue, Jul 5, 2022 at 5:19 AM Edward Welbourne <edward.welbou...@qt.io> wrote:
>  I would have expected the order to be the exact reverse of the
> order of building:

i guess, an example will make it more clear.

$ cat makefile
.SECONDEXPANSION:
all: hello.tsk bye.tsk
hello.tsk: $$(info 2nd expansion of prereqs of $$@); $(info $@)
bye.tsk: $$(info 2nd expansion of prereqs of $$@); $(info $@)
$ # this is patched make
$ ~/src/make/l64/make
2nd expansion of prereqs of hello.tsk
hello.tsk
2nd expansion of prereqs of bye.tsk
bye.tsk
make: Nothing to be done for 'all'.
$ # this is make-4.3
$ make
2nd expansion of prereqs of bye.tsk
2nd expansion of prereqs of hello.tsk
hello.tsk
bye.tsk
make: Nothing to be done for `all'.
$


You can see that make-4.3 builds 'hello.tsk' before building
'bye.tsk'. The order of secondary expanding prerequisites is the
opposite, first the prerequisites of 'bye.tsk' are expanded, then the
prerequisites of 'hello.tsk'.

The proposed behavior is to secondary expand the prerequisites of
'hello.tsk", build 'hello.tsk', secondary expand the prerequisites of
'bye.tsk', build 'bye.tsk'.

regards, Dmitry

Reply via email to