help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Passing -j (parallel processing) option to sub-makes


From: Paul D. Smith
Subject: Re: Passing -j (parallel processing) option to sub-makes
Date: Fri, 1 Mar 2002 16:29:53 -0500

%% Nestor Amaya <address@hidden> writes:

  na> Is there a way to get gmake to distribute parallel jobs between
  na> sub-makes?  For example, given:

  na>           all : a b c

  na>           a b c:
  na>                   $(MAKE) -C $@

You need to say:

  .PHONY: a b c

here as well.

  na> Now assume that each sub-make (a b c) can at most run 4 parallel
  na> jobs at once. Would running "make -j 10 all" with the above
  na> makefile still manage to run 10 jobs in parallel? Or only 3? What
  na> is the entended behaviour of make here?

It depends on what version of GNU make you're using, and the platform
you're using it on.  If you're using something near to the latest
version, then it will run 10 jobs: all the submakes will communicate and
ensure that no more than 10 jobs between them all.

This will only work on POSIX-like systems; there's a set of POSIX
features that the configure script checks for to decide whether make can
do this or not.


Earlier versions of GNU make will run up to 10 jobs in the top-level
make, but will invoke all submakes with, essentially, -j1.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://www.paulandlesley.org/gmake/
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist



reply via email to

[Prev in Thread] Current Thread [Next in Thread]