1

I've got a Makefile with targets like this:

all: a b

a: a_prereqs a_steps
b: b_prereqs b_steps

a and b take a while to run and have prerequisites. I'd like both a_prereqs and b_prereqs to run first (so that I don't have to wait for a_steps to complete before discovering that b_steps will fail.

But I don't want b_prereqs to run unless I'm running b.

How can I do this in GNU Make?

Roger Lipscombe
  • 89,048
  • 55
  • 235
  • 380

1 Answers1

0
all: a b

a: a_steps
b: b_steps

a_steps: a_prereqs
b_steps: b_prereqs

And then run make with more jobs

$ make -j X
Chnossos
  • 9,971
  • 4
  • 28
  • 40