help-make
[Top][All Lists]
Advanced

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

RE: $(MAKEFLAGS) and -j


From: Warlich, Christof
Subject: RE: $(MAKEFLAGS) and -j
Date: Wed, 29 Feb 2012 08:51:41 +0100

Hi,

is there really no way to find out from within a Makefile whether the -j option 
was set?
And if so, shouldn't at least the documentation be updated accordingly?

Cheers,

Chris

________________________________
From: Warlich, Christof
Sent: Montag, 27. Februar 2012 16:46
To: address@hidden
Subject: $(MAKEFLAGS) and -j

Hi,

from the manual:

> The ‘-j’ option is a special case (see Parallel 
> Execution<http://www.gnu.org/software/make/manual/make.html#Parallel>). If 
> you set it to some numeric value ‘N’
> and your operating system supports it (most any UNIX system will; others 
> typically won't), the
> parent make and all the sub-makes will communicate to ensure that there are 
> only ‘N’ jobs running
> at the same time between them all. Note that any job that is marked recursive 
> (see Instead 
> of<http://www.gnu.org/software/make/manual/make.html#Instead-of-Execution>
> Executing Recipes) doesn't count against the total jobs (otherwise we could 
> get ‘N’ sub-makes
> running and have no slots left over for any real work!)
>
> If your operating system doesn't support the above communication, then ‘-j 1’ 
> is always put into
> MAKEFLAGS instead of the value you specified. This is because if the ‘-j’ 
> option were passed down
> t o sub-makes, you would get many more jobs running in parallel than you 
> asked for. If you give ‘-j’
> with no numeric argument, meaning to run as many jobs as possible in 
> parallel, this is passed
> down, since multiple infinities are no more than one.

But with this Makefile:

all:
$(info MAKEFLAGS:$(MAKEFLAGS))

the -j Option is never included into $(MAKEFLAGS):

$ make -j
MAKEFLAGS:
make: F�r das Ziel �all� ist nichts zu tun.

$ make --jobs
MAKEFLAGS:
make: F�r das Ziel �all� ist nichts zu tun.

But:
$ make -k
MAKEFLAGS:k
make: F�r das Ziel �all� ist nichts zu tun.

I tried this with V3.81 and V3.82.90. How can I find out if a parent make had 
the -j option set?

Cheers,

Chris






reply via email to

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