help-make
[Top][All Lists]
Advanced

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

Re: MAKEFLAGS var does not show "-j" param ???


From: David Wuertele
Subject: Re: MAKEFLAGS var does not show "-j" param ???
Date: Wed, 12 Mar 2008 19:27:26 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Paul Smith <psmith <at> gnu.org> writes:

> This is the expected result on a system that does support parallel jobs
> via the jobserver.  The special --jobserver-fds option is an
> internal-only option that parent makes pass to child makes so they can
> participate in the jobserver.  For details on the jobserver see my site
> below.
> 
> For a bit more info see this other recent thread:
> 
> http://lists.gnu.org/archive/html/help-make/2008-01/msg00087.html

I was the OP for that recent thread.  I went and read your article about
jobserver, it was very instructive.  Thank you for that.

I still have a problem.  My makefile builds cross-compiling toolchains.  Lots of
them.  But when my "make -j LARGENUMBER" does a submake in glibc ("$(MAKE) -C
/path/to/glibc-build"), the glibc build fails to parallelize, even though there
are definitely jobs available.

The glibc makefiles have a variable called PARALLELMFLAGS.  When I call $(MAKE)
-C /path/to/glibc-build PARALLELMFLAGS="-j X", glibc parallelizes as I wish.

I want my makefile to behave as follows:
1.  if I type "make" with no "-j", I want all builds to be sequential, including
the glibc submake

2.  if I type "make -j N", I want the total number of parallel jobs to be at
least N, but I can tolerate it being larger than N.

My idea is to do something like this in my recursive call to glibc build:

build-glibc:
        $(MAKE) -C /path/to/glibc/build $($(if $(filter -j,$(info
MAKEFLAGS_in_cmd=$(MAKEFLAGS))),PARALLELMFLAGS="-j 4")

That will get me most of the way there.  It hardcodes the glibc parallelism to
either one or four, according to whether the top-level make was parallel or not.

Any better suggestions?

Dave





reply via email to

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