diff mbox series

[1/1] package/Makefile.in: add PARALLEL_JOBS to post-build/post-image scripts

Message ID 20231118181308.55690-1-brandon.maier@collins.com
State New
Headers show
Series [1/1] package/Makefile.in: add PARALLEL_JOBS to post-build/post-image scripts | expand

Commit Message

Brandon Maier Nov. 18, 2023, 6:13 p.m. UTC
Post-build, post-image, and other build scripts may run some commands in
parallel, for example to parallelize xargs, Makefiles, etc. Export
PARALLEL_JOBS to these scripts so they can enforce the same job limits
that other Buildroot packages use.

Signed-off-by: Brandon Maier <brandon.maier@collins.com>
---
 docs/manual/customize-post-image.adoc | 4 ++--
 docs/manual/customize-rootfs.adoc     | 1 +
 docs/manual/debugging-buildroot.adoc  | 1 +
 package/Makefile.in                   | 3 ++-
 4 files changed, 6 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/docs/manual/customize-post-image.adoc b/docs/manual/customize-post-image.adoc
index 5308093d06..4197cf6710 100644
--- a/docs/manual/customize-post-image.adoc
+++ b/docs/manual/customize-post-image.adoc
@@ -28,8 +28,8 @@  different sets of arguments to each script.
 
 Again just like for the post-build scripts, the scripts have access to
 the environment variables +BR2_CONFIG+, +HOST_DIR+, +STAGING_DIR+,
-+TARGET_DIR+, +BUILD_DIR+, +BINARIES_DIR+, +CONFIG_DIR+ and
-+BASE_DIR+.
++TARGET_DIR+, +BUILD_DIR+, +BINARIES_DIR+, +CONFIG_DIR+, +BASE_DIR+,
+and +PARALLEL_JOBS+.
 
 The post-image scripts will be executed as the user that executes
 Buildroot, which should normally _not_ be the root user. Therefore, any
diff --git a/docs/manual/customize-rootfs.adoc b/docs/manual/customize-rootfs.adoc
index d5d8b9288f..43ece5a332 100644
--- a/docs/manual/customize-rootfs.adoc
+++ b/docs/manual/customize-rootfs.adoc
@@ -69,6 +69,7 @@  In addition, you may also use these environment variables:
   - +BINARIES_DIR+: the place where all binary files (aka images) are
     stored
   - +BASE_DIR+: the base output directory
+  - +PARALLEL_JOBS+: the number of jobs to use when running parallel processes.
 
 Below three more methods of customizing the target filesystem are
 described, but they are not recommended.
diff --git a/docs/manual/debugging-buildroot.adoc b/docs/manual/debugging-buildroot.adoc
index f575fc48ee..b9068ead52 100644
--- a/docs/manual/debugging-buildroot.adoc
+++ b/docs/manual/debugging-buildroot.adoc
@@ -41,3 +41,4 @@  The script has access to the following variables:
   - +BINARIES_DIR+: the place where all binary files (aka images) are
     stored
   - +BASE_DIR+: the base output directory
+  - +PARALLEL_JOBS+: the number of jobs to use when running parallel processes.
diff --git a/package/Makefile.in b/package/Makefile.in
index 9fbe960759..796be6fda8 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -341,7 +341,8 @@  EXTRA_ENV = \
 	BR2_DL_DIR=$(BR2_DL_DIR) \
 	BUILD_DIR=$(BUILD_DIR) \
 	CONFIG_DIR=$(CONFIG_DIR) \
-	O=$(CANONICAL_O)
+	O=$(CANONICAL_O) \
+	PARALLEL_JOBS=$(PARALLEL_JOBS)
 
 ################################################################################
 # settings we need to pass to configure