Does anyone understand the nitty gritty of .NOTPARALLEL and whether it can do what I want?

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

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.

make --version
GNU Make 4.3
Built for x86_64-pc-linux-gnu

(removing it completely and all six targets run in parallel so I'm clearly giving make the correct -j option for parallel running)

Tim.

Reply via email to