3 ms·
This is just the “job server” which you can read about in the Gnu make documentation, which is excellent. https://www.gnu.org/software/make/manual/html_node/Jo
by mturmon 4y ago
This is just the “job server” which you can read about in the Gnu make documentation, which is excellent.
https://www.gnu.org/software/make/manual/html_node/Job-Slots.html https://www.gnu.org/software/make/manual/html_node/Job-Slots...
Basically you can specify a “-j 24” (e.g.) option to make, and it will run as many as 24 build steps in parallel. If your Makefile is correct, that’s all you need.
Because make knows the dependency graph, it can correctly handle cases where some build steps have to be done serially, while others can be fully parallelized. E.g.,
a: b;
b: c;
In which builds of b and c are serial, versus
x: y;
x: z;
for which builds of y and z are parallel.
It’s quite a powerful capability and it feels great to see 24 build-steps start in parallel from one simple command.
- Mister_Snuggles 4y agoThis was another thing that attracted me to `make` for this task. I figured that, as long as the dependencies were all declared properly, I should be able to run multiple jobs in parallel. I didn't pursue this very far as there were other problems with doing this, but I'd like to pursue it again. The problems are all with the target system, `make` does the parallel execution work perfectly.