Thank you, I got valuable feedback: The 't2' prerequisite of 't4' considers 
differently the timing internals of the 'make' execution and re-executions. 
Practically 'make' refers to prerequisites in case of include file remakes in 
regards to pre and post update differently than I thought. Could imagine some 
syntax extension in 'makefile' for finer control of re-executions.

Nevertheless, this got good enough for now with forcing a re-execution:

$ diff t1.bak t1
1c1
< t2: t1 t3; m4 -D n=t7 t3 > $@
---
> t2: t1 t3; m4 -D n=t7 t3 > $@; exit 129

$ make -d -r -R t10
GNU Make 4.4.1
Built for x86_64-pc-cygwin
Copyright (C) 1988-2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://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.
Reading makefiles...
Reading makefile 'makefile'...
Reading makefile 't1' (search path) (no ~ expansion)...
Reading makefile 't2' (search path) (no ~ expansion)...
Reading makefile 't8' (search path) (no ~ expansion)...
Reading makefile 't9' (search path) (no ~ expansion)...
Updating makefiles....
 Considering target file 'makefile'.
  Looking for an implicit rule for 'makefile'.
  No implicit rule found for 'makefile'.
 Finished prerequisites of target file 'makefile'.
 No need to remake target 'makefile'.
 Considering target file 't1'.
  Looking for an implicit rule for 't1'.
  No implicit rule found for 't1'.
 Finished prerequisites of target file 't1'.
 No need to remake target 't1'.
 Considering target file 't2'.
  Pruning file 't1'.
  Considering target file 't3'.
   Looking for an implicit rule for 't3'.
   No implicit rule found for 't3'.
  Finished prerequisites of target file 't3'.
  No need to remake target 't3'.
 Finished prerequisites of target file 't2'.
  Prerequisite 't1' is newer than target 't2'.
  Prerequisite 't3' is older than target 't2'.
 Must remake target 't2'.
t1:1: update target 't2' due to: t1
m4 -D n=t7 t3 > t2; exit 129
Putting child 0xa0001e140 (t2) PID 3180 on the chain.
Live child 0xa0001e140 (t2) PID 3180
Reaping losing child 0xa0001e140 PID 3180
make: *** [t1:1: t2] Error 129
Removing child 0xa0001e140 PID 3180 from chain.

$ make -d -r -R t10
GNU Make 4.4.1
Built for x86_64-pc-cygwin
Copyright (C) 1988-2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://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.
Reading makefiles...
Reading makefile 'makefile'...
Reading makefile 't1' (search path) (no ~ expansion)...
Reading makefile 't2' (search path) (no ~ expansion)...
Reading makefile 't8' (search path) (no ~ expansion)...
Reading makefile 't9' (search path) (no ~ expansion)...
Updating makefiles....
 Considering target file 'makefile'.
  Looking for an implicit rule for 'makefile'.
  No implicit rule found for 'makefile'.
 Finished prerequisites of target file 'makefile'.
 No need to remake target 'makefile'.
 Considering target file 't1'.
  Looking for an implicit rule for 't1'.
  No implicit rule found for 't1'.
 Finished prerequisites of target file 't1'.
 No need to remake target 't1'.
 Considering target file 't2'.
  Pruning file 't1'.
  Considering target file 't3'.
   Looking for an implicit rule for 't3'.
   No implicit rule found for 't3'.
  Finished prerequisites of target file 't3'.
  No need to remake target 't3'.
 Finished prerequisites of target file 't2'.
  Prerequisite 't1' is older than target 't2'.
  Prerequisite 't3' is older than target 't2'.
 No need to remake target 't2'.
 Considering target file 't8'.
  Looking for an implicit rule for 't8'.
  No implicit rule found for 't8'.
 Finished prerequisites of target file 't8'.
 No need to remake target 't8'.
 Considering target file 't9'.
  Considering target file 't4'.
   Considering target file 't5'.
    Looking for an implicit rule for 't5'.
    No implicit rule found for 't5'.
   Finished prerequisites of target file 't5'.
   No need to remake target 't5'.
   Pruning file 't2'.
   Considering target file 't7'.
    Looking for an implicit rule for 't7'.
    No implicit rule found for 't7'.
   Finished prerequisites of target file 't7'.
   No need to remake target 't7'.
  Finished prerequisites of target file 't4'.
   Prerequisite 't5' is older than target 't4'.
   Prerequisite 't2' is newer than target 't4'.
   Prerequisite 't7' is older than target 't4'.
  Must remake target 't4'.
t2:1: update target 't4' due to: t2
m4 -D n=t7 t5 > t4
Putting child 0xa0001e1b0 (t4) PID 3183 on the chain.
Live child 0xa0001e1b0 (t4) PID 3183
Reaping winning child 0xa0001e1b0 PID 3183
Removing child 0xa0001e1b0 PID 3183 from chain.
  Successfully remade target file 't4'.
  Pruning file 't8'.
 Finished prerequisites of target file 't9'.
  Prerequisite 't4' is newer than target 't9'.
  Prerequisite 't8' is older than target 't9'.
 Must remake target 't9'.
t8:1: update target 't9' due to: t4
m4 t4 > t9
Putting child 0xa000214e0 (t9) PID 3185 on the chain.
Live child 0xa000214e0 (t9) PID 3185
Reaping winning child 0xa000214e0 PID 3185
Removing child 0xa000214e0 PID 3185 from chain.
 Successfully remade target file 't9'.
Re-executing[1]: make -d -r -R t10
GNU Make 4.4.1
Built for x86_64-pc-cygwin
Copyright (C) 1988-2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://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.
Reading makefiles...
Reading makefile 'makefile'...
Reading makefile 't1' (search path) (no ~ expansion)...
Reading makefile 't2' (search path) (no ~ expansion)...
Reading makefile 't8' (search path) (no ~ expansion)...
Reading makefile 't9' (search path) (no ~ expansion)...
Updating makefiles....
 Considering target file 'makefile'.
  Looking for an implicit rule for 'makefile'.
  No implicit rule found for 'makefile'.
 Finished prerequisites of target file 'makefile'.
 No need to remake target 'makefile'.
 Considering target file 't1'.
  Looking for an implicit rule for 't1'.
  No implicit rule found for 't1'.
 Finished prerequisites of target file 't1'.
 No need to remake target 't1'.
 Considering target file 't2'.
  Pruning file 't1'.
  Considering target file 't3'.
   Looking for an implicit rule for 't3'.
   No implicit rule found for 't3'.
  Finished prerequisites of target file 't3'.
  No need to remake target 't3'.
 Finished prerequisites of target file 't2'.
  Prerequisite 't1' is older than target 't2'.
  Prerequisite 't3' is older than target 't2'.
 No need to remake target 't2'.
 Considering target file 't8'.
  Looking for an implicit rule for 't8'.
  No implicit rule found for 't8'.
 Finished prerequisites of target file 't8'.
 No need to remake target 't8'.
 Considering target file 't9'.
  Considering target file 't4'.
   Considering target file 't5'.
    Looking for an implicit rule for 't5'.
    No implicit rule found for 't5'.
   Finished prerequisites of target file 't5'.
   No need to remake target 't5'.
   Pruning file 't2'.
   Considering target file 't7'.
    Looking for an implicit rule for 't7'.
    No implicit rule found for 't7'.
   Finished prerequisites of target file 't7'.
   No need to remake target 't7'.
  Finished prerequisites of target file 't4'.
   Prerequisite 't5' is older than target 't4'.
   Prerequisite 't2' is older than target 't4'.
   Prerequisite 't7' is older than target 't4'.
  No need to remake target 't4'.
  Pruning file 't8'.
 Finished prerequisites of target file 't9'.
  Prerequisite 't4' is older than target 't9'.
  Prerequisite 't8' is older than target 't9'.
 No need to remake target 't9'.
Updating goal targets....
Considering target file 't10'.
 File 't10' does not exist.
 Considering target file 't9'.
 File 't9' was considered already.
Finished prerequisites of target file 't10'.
Must remake target 't10'.
t9:1: update target 't10' due to: target does not exist
echo a
Putting child 0xa0001e0b0 (t10) PID 3187 on the chain.
Live child 0xa0001e0b0 (t10) PID 3187
a
Reaping winning child 0xa0001e0b0 PID 3187
Removing child 0xa0001e0b0 PID 3187 from chain.
Successfully remade target file 't10'.

On Thursday, June 19th, 2025 at 11:50 PM, WaitronCharm <waitronch...@proton.me> 
wrote:

> 't4' is re-made in the 1st execution based on a -- by now -- outdated recipe.
> 
> And why 'make' does not wait with that for the 2nd execution?
> 
> I guess because 't9' is also included and 't9' has 't4' as prerequisite.
> 
> And how to resolve this without using recursive 'make' or '.PHONY' or such 
> exotic things?
> 
> 'noname.gv.png' attached now.
> 
> On Thursday, June 19th, 2025 at 10:59 PM, WaitronCharm waitronch...@proton.me 
> wrote:
> 
> > Yes, thank you. It looks like with the 1st execution not only included 
> > files are re-made and a 2nd execution started but also (still in the 1st 
> > execution) other targets (targets which are not included) also re-made by 
> > recipes now outdated.
> > 
> > Is this how 'make' works?
> > 
> > Thought that one execution only updates included files and once the whole 
> > 'makefile' is 'stable' will 'make' start working on non-included targets.
> > 
> > (Need to check what brings 'make' to re-make not included targets such 
> > early -- in the 1st execution. But so far I don't see that what.)
> > 
> > I believe this should be doable without recursive 'make' or '.PHONY' 
> > targets.
> > 
> > On Thursday, June 19th, 2025 at 9:05 PM, Paul Smith psm...@gnu.org wrote:
> > 
> > > On Thu, 2025-06-19 at 18:12 +0000, WaitronCharm via Bug reports and
> > > discussion for GNU make wrote:
> > > 
> > > > Story is the following. There is a 'makefile' which includes a couple
> > > > of others, some are itself generated by the same 'make' run (i.e. NO
> > > > recursive 'make' processes). Issue is that the 'make' re-run is not
> > > > triggered as ... I wished.
> > > 
> > > I'm not sure I understood exactly everything about your post but the
> > > rules for how things are remade are pretty simple and GNU Make has
> > > always worked like this:
> > > 
> > > First all makefiles are parsed. Then all makefiles are checked for out
> > > of date-ness and all of them that are out of date, are rebuilt. Then
> > > if any makefiles were updated, make re-execs itself and starts over.
> > > 
> > > --
> > > Paul D. Smith psm...@gnu.org Find some GNU Make tips at:
> > > 
> > > https://www.gnu.org http://make.mad-scientist.net
> > > "Please remain calm...I may be mad, but I am a professional." --Mad
> > > Scientist

Reply via email to