tech-toolchain archive

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

Re: make -j max_jobs



On Sat, 24 Apr 2010 03:27:29 +0000, David Holland writes:
>On Thu, Apr 22, 2010 at 04:15:49PM -0700, Simon J. Gerraty wrote:
> >> Right. Shouldn't, therefore, MAKE_MODE be set to compat elsewhere
> >> (e.g. by default) and cleared in -j mode?

>Well, the easiest way would be to wrap assignments to compatMake in a
>function and update MAKE_MODE then too.

That's easy - MakeMode("compat"), 
I'm not yet sure if it is necessary though.

>Do you intend assigning .MAKE.MODE from the makefile to change the
>behavior?

Yes, that's the main purpose.  
To be able to force make into compatMake mode (as though -B had
been specified) and to add "meta" mode (I mentioned this the
other day).

Most places where comatMake is set, it is not a deliberate choice of the
user.  Using -B is a deliberate choice, as setting .MAKE.MODE in a
makefile (eg sys.mk).  The fact that make might run in compatMake mode
by default is not the same as the user specifying -B.

.MAKE.MODE is only looked at by make after all the makefiles have been
read btw, so that the makefiles can set it.

Right now, in sys.mk I might do

.MAKE.MODE ?= meta

if I want -B to prevent meta mode, but if I set .MAKE.MODE=compat
every place that compatMake is set, I'd have to

.if ${.MAKEFLAGS:M-B} == ""
.MAKE.MODE += meta
.endif

which I guess isn't that big a deal.

An individual makefile can still say

.MAKE.MODE = compat

if it is known not to work with -j1.

--sjg


Home | Main Index | Thread Index | Old Index