Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] allow to pass the number of parallel jobs via command line
@ 2012-09-25 10:17 Jean-Christophe PLAGNIOL-VILLARD
  2012-09-25 20:36 ` Peter Korsgaard
  0 siblings, 1 reply; 8+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-09-25 10:17 UTC (permalink / raw)
  To: buildroot

use PARALLEL_JOBS=x for this

This will overwrite the value in BR2_JLEVEL

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 Makefile            |    2 ++
 package/Makefile.in |    2 ++
 2 files changed, 4 insertions(+)

diff --git a/Makefile b/Makefile
index 6536bca..13e8139 100644
--- a/Makefile
+++ b/Makefile
@@ -730,6 +730,8 @@ endif
 	@echo '  make V=0|1             - 0 => quiet build (default), 1 => verbose build'
 	@echo '  make O=dir             - Locate all output files in "dir", including .config'
 	@echo
+	@echo '  make PARALLEL_JOBS=x   - X => number of jobs for each package this overwrite the KConfig BR2_JLEVEL'
+	@echo
 	@$(foreach b, $(sort $(notdir $(wildcard $(TOPDIR)/configs/*_defconfig))), \
 	  printf "  %-35s - Build for %s\\n" $(b) $(b:_defconfig=);)
 	@echo
diff --git a/package/Makefile.in b/package/Makefile.in
index 64508b2..fcf5b13 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -9,12 +9,14 @@ HOSTMAKE :=$(shell which $(HOSTMAKE) || type -p $(HOSTMAKE) || echo make)
 # If BR2_LEVEL is 0, scale the maximum concurrency with the number of
 # CPUs.  A coefficient of 2 is used in order to keep processors busy
 # while waiting on I/O.
+ifeq ($(PARALLEL_JOBS),)
 ifeq ($(BR2_JLEVEL),0)
 PARALLEL_JOBS:=$(shell echo \
 	$$((2 * `getconf _NPROCESSORS_ONLN 2>/dev/null || echo 1`)))
 else
 PARALLEL_JOBS:=$(BR2_JLEVEL)
 endif
+endif
 
 MAKE1:=$(HOSTMAKE) -j1
 MAKE:=$(HOSTMAKE) -j$(PARALLEL_JOBS)
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH 1/1] allow to pass the number of parallel jobs via command line
  2012-09-25 10:17 [Buildroot] [PATCH 1/1] allow to pass the number of parallel jobs via command line Jean-Christophe PLAGNIOL-VILLARD
@ 2012-09-25 20:36 ` Peter Korsgaard
  2012-09-26  6:23   ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 1 reply; 8+ messages in thread
From: Peter Korsgaard @ 2012-09-25 20:36 UTC (permalink / raw)
  To: buildroot

>>>>> "Jean-Christophe" == Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> writes:

 Jean-Christophe> use PARALLEL_JOBS=x for this
 Jean-Christophe> This will overwrite the value in BR2_JLEVEL

why not just use make BR2_JLEVEL=x ?

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH 1/1] allow to pass the number of parallel jobs via command line
  2012-09-25 20:36 ` Peter Korsgaard
@ 2012-09-26  6:23   ` Jean-Christophe PLAGNIOL-VILLARD
  2012-09-26 10:42     ` Peter Korsgaard
  0 siblings, 1 reply; 8+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-09-26  6:23 UTC (permalink / raw)
  To: buildroot

On 22:36 Tue 25 Sep     , Peter Korsgaard wrote:
> >>>>> "Jean-Christophe" == Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> writes:
> 
>  Jean-Christophe> use PARALLEL_JOBS=x for this
>  Jean-Christophe> This will overwrite the value in BR2_JLEVEL
> 
> why not just use make BR2_JLEVEL=x ?
> 
kconfig overwrite and you can not optarg env as BR2_JLEVEL is a int

so need to use PARALLEL_JOBS

Best Regards,
J.
> -- 
> Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH 1/1] allow to pass the number of parallel jobs via command line
  2012-09-26  6:23   ` Jean-Christophe PLAGNIOL-VILLARD
@ 2012-09-26 10:42     ` Peter Korsgaard
  2012-09-26 16:57       ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 1 reply; 8+ messages in thread
From: Peter Korsgaard @ 2012-09-26 10:42 UTC (permalink / raw)
  To: buildroot

>>>>> "Jean-Christophe" == Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> writes:

Hi,

 >> why not just use make BR2_JLEVEL=x ?

 JC> kconfig overwrite and you can not optarg env as
 JC> BR2_JLEVEL is a int so need to use PARALLEL_JOBS

Sorry, I don't understand what you are saying here. BR2_JLEVEL works
fine:

make BR2_LEVEL=42
...
/usr/bin/make -j42 CC="/home/peko/source/buildroot/output/host/usr/bin/arm-linux-gcc" ..

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH 1/1] allow to pass the number of parallel jobs via command line
  2012-09-26 10:42     ` Peter Korsgaard
@ 2012-09-26 16:57       ` Jean-Christophe PLAGNIOL-VILLARD
  2012-09-26 19:23         ` Nathan Lynch
  2012-10-01 19:46         ` Peter Korsgaard
  0 siblings, 2 replies; 8+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-09-26 16:57 UTC (permalink / raw)
  To: buildroot

On 12:42 Wed 26 Sep     , Peter Korsgaard wrote:
> >>>>> "Jean-Christophe" == Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> writes:
> 
> Hi,
> 
>  >> why not just use make BR2_JLEVEL=x ?
> 
>  JC> kconfig overwrite and you can not optarg env as
>  JC> BR2_JLEVEL is a int so need to use PARALLEL_JOBS
> 
> Sorry, I don't understand what you are saying here. BR2_JLEVEL works
> fine:
> 
> make BR2_LEVEL=42
> ...
> /usr/bin/make -j42 CC="/home/peko/source/buildroot/output/host/usr/bin/arm-linux-gcc" ..
here does not work

I try this

with a value of BR2_JLEVEL at 4

BR2_JLEVEL=13 make

...
/usr/bin/make -j2 -C /opt/work/buildroot/build/test/toolchain/gcc-4.6.3-initial all-gcc

I want to pass the JLEVEL via env not make option

Best Regards,
J.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH 1/1] allow to pass the number of parallel jobs via command line
  2012-09-26 16:57       ` Jean-Christophe PLAGNIOL-VILLARD
@ 2012-09-26 19:23         ` Nathan Lynch
  2012-10-01 19:46         ` Peter Korsgaard
  1 sibling, 0 replies; 8+ messages in thread
From: Nathan Lynch @ 2012-09-26 19:23 UTC (permalink / raw)
  To: buildroot

On Wed, 2012-09-26 at 18:57 +0200, Jean-Christophe PLAGNIOL-VILLARD
wrote:
> On 12:42 Wed 26 Sep     , Peter Korsgaard wrote:
> > >>>>> "Jean-Christophe" == Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> writes:
> > 
> > Hi,
> > 
> >  >> why not just use make BR2_JLEVEL=x ?
> > 
> >  JC> kconfig overwrite and you can not optarg env as
> >  JC> BR2_JLEVEL is a int so need to use PARALLEL_JOBS
> > 
> > Sorry, I don't understand what you are saying here. BR2_JLEVEL works
> > fine:
> > 
> > make BR2_LEVEL=42
> > ...
> > /usr/bin/make -j42 CC="/home/peko/source/buildroot/output/host/usr/bin/arm-linux-gcc" ..
> here does not work
> 
> I try this
> 
> with a value of BR2_JLEVEL at 4
> 
> BR2_JLEVEL=13 make
> 
> ...
> /usr/bin/make -j2 -C /opt/work/buildroot/build/test/toolchain/gcc-4.6.3-initial all-gcc
> 
> I want to pass the JLEVEL via env not make option

Use make -e (--environment-overrides)?  I dunno, things might break
depending on what's in your environment.  But if your use case has this
constraint hopefully you are able to sanitize your environment before
invoking Buildroot.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH 1/1] allow to pass the number of parallel jobs via command line
  2012-09-26 16:57       ` Jean-Christophe PLAGNIOL-VILLARD
  2012-09-26 19:23         ` Nathan Lynch
@ 2012-10-01 19:46         ` Peter Korsgaard
  2012-10-04  6:57           ` Jean-Christophe PLAGNIOL-VILLARD
  1 sibling, 1 reply; 8+ messages in thread
From: Peter Korsgaard @ 2012-10-01 19:46 UTC (permalink / raw)
  To: buildroot

>>>>> "Jean-Christophe" == Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> writes:

Hi,

 JC> kconfig overwrite and you can not optarg env as
 JC> BR2_JLEVEL is a int so need to use PARALLEL_JOBS
 >> 
 >> Sorry, I don't understand what you are saying here. BR2_JLEVEL works
 >> fine:
 >> 
 >> make BR2_LEVEL=42
 >> ...
 >> /usr/bin/make -j42 CC="/home/peko/source/buildroot/output/host/usr/bin/arm-linux-gcc" ..
 Jean-Christophe> here does not work

 Jean-Christophe> I try this

 Jean-Christophe> with a value of BR2_JLEVEL at 4

 Jean-Christophe> BR2_JLEVEL=13 make

That doesn't work. Variables defined on the make commandline take
precedence over definitions in makefiles, but environment variables
don't (and should not, stuff would break all the time).

Just use make BR2_JLEVEL=$BR2_JLEVEL to get your shell to expand the
variable for you.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Buildroot] [PATCH 1/1] allow to pass the number of parallel jobs via command line
  2012-10-01 19:46         ` Peter Korsgaard
@ 2012-10-04  6:57           ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 0 replies; 8+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-10-04  6:57 UTC (permalink / raw)
  To: buildroot

On 21:46 Mon 01 Oct     , Peter Korsgaard wrote:
> >>>>> "Jean-Christophe" == Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> writes:
> 
> Hi,
> 
>  JC> kconfig overwrite and you can not optarg env as
>  JC> BR2_JLEVEL is a int so need to use PARALLEL_JOBS
>  >> 
>  >> Sorry, I don't understand what you are saying here. BR2_JLEVEL works
>  >> fine:
>  >> 
>  >> make BR2_LEVEL=42
>  >> ...
>  >> /usr/bin/make -j42 CC="/home/peko/source/buildroot/output/host/usr/bin/arm-linux-gcc" ..
>  Jean-Christophe> here does not work
> 
>  Jean-Christophe> I try this
> 
>  Jean-Christophe> with a value of BR2_JLEVEL at 4
> 
>  Jean-Christophe> BR2_JLEVEL=13 make
> 
> That doesn't work. Variables defined on the make commandline take
> precedence over definitions in makefiles, but environment variables
> don't (and should not, stuff would break all the time).
> 
> Just use make BR2_JLEVEL=$BR2_JLEVEL to get your shell to expand the
> variable for you.
issue I can not do so

and env var are use commonly linux/barebox I expect this on buildroot too

Best Regards,
J.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-10-04  6:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-25 10:17 [Buildroot] [PATCH 1/1] allow to pass the number of parallel jobs via command line Jean-Christophe PLAGNIOL-VILLARD
2012-09-25 20:36 ` Peter Korsgaard
2012-09-26  6:23   ` Jean-Christophe PLAGNIOL-VILLARD
2012-09-26 10:42     ` Peter Korsgaard
2012-09-26 16:57       ` Jean-Christophe PLAGNIOL-VILLARD
2012-09-26 19:23         ` Nathan Lynch
2012-10-01 19:46         ` Peter Korsgaard
2012-10-04  6:57           ` Jean-Christophe PLAGNIOL-VILLARD

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox