List Info

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




MAKEFLAGS var does not show "-j" param ???
user name
2008-03-11 09:26:28
Hi all.

It seems that the MAKEFLAGS variable does not always
show the "-j" option given to make on its command
line.

I'm using GNU make 3.81 built for Win32.
For information, the result is the same with GNU make 3.81
for i486-pc-linux-gnu.


Here is a tiny Makefile example that shows the problem :

-------------Makefile-------------------

$(info MAKEFLAGS=$(MAKEFLAGS))

.PHONY: all

all:
	echo $(info MAKEFLAGS_in_cmd=$(MAKEFLAGS)) 
         This is command for $

------------/Makefile-------------------


Some tests with this simple Makefile :


-----------------------------
C:some_dir> make
MAKEFLAGS=
MAKEFLAGS_in_cmd=
This is command for all
-----------------------------
C:some_dir> make -w
MAKEFLAGS=w
MAKEFLAGS_in_cmd=w
make: Entering directory `<dir>'
This is command for all
make: Leaving directory `<dir>'
-----------------------------
C:some_dir> make -j8
MAKEFLAGS=
MAKEFLAGS_in_cmd=j 1
This is command for all
-----------------------------
C:some_dir> make -w -j8
MAKEFLAGS=w
MAKEFLAGS_in_cmd=wj 1
gnumake: Entering directory `<dir>'
This is command for all
gnumake: Leaving directory `<dir>'
-----------------------------
And also a test on Ubuntu 7.10 :
$ make -j8
MAKEFLAGS=
MAKEFLAGS_in_cmd= --jobserver-fds=3,4 -j
This is command for all
-----------------------------


I've gone through all make's online documentation,
but I can't find why I get this result !

Any idea ?
Should I submit a bug ?


Regards.


-- 
Fabrice GIRARDOT




_______________________________________________
Help-make mailing list
Help-makegnu.org
http:
//lists.gnu.org/mailman/listinfo/help-make

Re: MAKEFLAGS var does not show "-j" param ???
user name
2008-03-11 09:35:25
On Tue, 2008-03-11 at 15:26 +0100, Fabrice GIRARDOT wrote:
> It seems that the MAKEFLAGS variable does not always
> show the "-j" option given to make on its
command line.

> I'm using GNU make 3.81 built for Win32.

As far as I recall, parallel make is not supported on MS
Windows
systems.  You should ask on the make-w32gnu.org
mailing list for more
explicit details: those folks know much more about the MS
Windows port
of GNU make.

> C:some_dir> make -j8
> MAKEFLAGS=
> MAKEFLAGS_in_cmd=j 1
> This is command for all

This is because the MS Windows port doesn't support parallel
jobs.  So,
it explicitly sets the -j flag argument to 1.

> And also a test on Ubuntu 7.10 :
> $ make -j8
> MAKEFLAGS=
> MAKEFLAGS_in_cmd= --jobserver-fds=3,4 -j
> This is command for all

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/200
8-01/msg00087.html

-- 
------------------------------------------------------------
-----------------
 Paul D. Smith <psmithgnu.org>                
http://make.mad-scientis
t.us
 "Please remain calm--I may be mad, but I am a
professional."--Mad Scientist




_______________________________________________
Help-make mailing list
Help-makegnu.org
http:
//lists.gnu.org/mailman/listinfo/help-make

Re: MAKEFLAGS var does not show "-j" param ???
country flaguser name
Israel
2008-03-11 14:40:17
> From: Paul Smith <psmithgnu.org>
> Date: Tue, 11 Mar 2008 10:35:25 -0400
> Cc: help-makegnu.org
> 
> On Tue, 2008-03-11 at 15:26 +0100, Fabrice GIRARDOT
wrote:
> > It seems that the MAKEFLAGS variable does not
always
> > show the "-j" option given to make on
its command line.
> 
> > I'm using GNU make 3.81 built for Win32.
> 
> As far as I recall, parallel make is not supported on
MS Windows
> systems.

Not entirely true: the MS-Windows port does support
parallel
execution, but it does not support the "job
server" method.
Therefore, Make invokes sub-Make's with the "-j 1"
switch.

To work around, invoke the sub-Make's with an explicit
"-j N" switch
(you will need to figure out the argument N yourself).

Alternatively, volunteer to make the job server work on
Windows 


_______________________________________________
Help-make mailing list
Help-makegnu.org
http:
//lists.gnu.org/mailman/listinfo/help-make

Re: MAKEFLAGS var does not show "-j" param ???
country flaguser name
United States
2008-03-12 14:27:26
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/200
8-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



_______________________________________________
Help-make mailing list
Help-makegnu.org
http:
//lists.gnu.org/mailman/listinfo/help-make

[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )