Follow-up Comment #3, bug #27714 (project make): Hi Mike; no, sorry, I should have given an explicit example. Your new test case is not correct and doesn't prove anything. I explicitly said do NOT put the sleep inside the $(shell). It's important to understand that make itself is single threaded (it doesn't use pthread() etc.). Its parallelism is gained by having the recipes it invokes be run in parallel. But before it can invoke the recipe it has to expand all the variables and functions. That includes $(shell ...) functions. Variables and functions (including $(shell ...) functions) are NOT expanded "in parallel"; they are expanded one at a time as they are seen in the recipe.
After the entire recipe is expanded, THEN make invokes the command, then it leaves the command running in the background while it locates the next possible recipe to start, evaluates it, then runs it in the background, etc. So, causing the recipe expansion to take a long time (which is what you're doing by adding the sleep to the $(shell ...) function) actually _decreases_ the amount of parallelism. Hopefully that's clear. What you need to do to show the make is working correctly is increase the time it takes the recipe itself to run: that is, add the sleep OUTSIDE the $(shell ...). Something like: $(t): ; @printf $@ $(shell :); sleep 5; printf $@ You should see the recipes all run in parallel (the first printf's all run, then a pause, then the second printfs all run). _______________________________________________________ Reply to this item at: <http://savannah.gnu.org/bugs/?27714> _______________________________________________ Message sent via/by Savannah http://savannah.gnu.org/ _______________________________________________ Bug-make mailing list Bug-make@gnu.org http://lists.gnu.org/mailman/listinfo/bug-make