On 2026-03-14 18:29 +0000, Tim Woodall wrote:
> Does anyone understand the nitty gritty of .NOTPARALLEL and whether it
> can do what I want?
Yes, but not in GNU make 4.3.
> Please note, the example here is a very simple case and there are easy
> ways to do it without using .NOTPARALLEL but I'm specifically asking
> about how .NOTPARALLEL is supposed to work.
>
> ---
>
> .NOTPARALLEL: rule1 rule2
>
> rule: rule1 rule2
>
> rule1: A B C
>
> rule2: D E F
>
> A:
> sleep 2
> echo "A built"
>
> B:
> sleep 2
> echo "B built"
>
> C:.
> sleep 2
> echo "C built"
>
> D:
> sleep 2
> echo "D built"
>
> E:
> sleep 2
> echo "E built"
>
> F:.
> sleep 2
> echo "F built"
>
> ---
>
> What I want is for A, B and C to be executed serially and for D, E and
> F to be executed serially but that rule1 can be executed in parallel
> with rule2.
>
>>From the manual:
> If the .NOTPARALLEL special target has prerequisites, then each of
> those prerequisites will be considered a target and all prerequisites
> of these targets will be run serially. Note that only when building
> this target will the prerequisites be run serially
This is from the manual for GNU make 4.4 or later, apparently.
> No matter what I put for the prerequisites of .NOTPARALLEL (even if I
> put in a completely different target), it runs as if it has no
> prerequisites at all:
>
> If the .NOTPARALLEL special target with no prerequisites is specified
> anywhere then the entire instance of make will be run serially,
> regardless of the parallel setting.
This is the only way .NOTPARALLEL works in make 4.3, support for
prerequisites in this special target was added in version 4.4.
> make --version
> GNU Make 4.3
> Built for x86_64-pc-linux-gnu
$ make --version
GNU Make 4.4.1
That version does what you want. :-)
Cheers,
Sven