]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
make.sh: Introduce MAX_PARALLELISM
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 4 Mar 2019 11:51:08 +0000 (11:51 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 4 Mar 2019 11:51:08 +0000 (11:51 +0000)
This will now adjust MAKETUNING to not launch more processes
than MAX_PARALLELISM. Handy to limit builds that use a lot of memory.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
lfs/Config
lfs/boost

index be6725bc846177efd639d26ae13a6bb90b8e0592..2bb0f283542b6da48ba64e40c693d5361bfd1c06 100644 (file)
 # Cleanup environment from any variables
 unexport BUILD_ARCH BUILD_PLATFORM BUILDTARGET CROSSTARGET TOOLCHAIN TOOLS_DIR
 
 # Cleanup environment from any variables
 unexport BUILD_ARCH BUILD_PLATFORM BUILDTARGET CROSSTARGET TOOLCHAIN TOOLS_DIR
 
-MAKETUNING = -j $(DEFAULT_PARALLELISM)
+PARALLELISM = $(shell echo $$( \
+       if [ -n "$(MAX_PARALLELISM)" ] && [ $(MAX_PARALLELISM) -lt $(DEFAULT_PARALLELISM) ]; then \
+               echo $(MAX_PARALLELISM); \
+       else \
+               echo $(DEFAULT_PARALLELISM); \
+       fi) \
+)
+
+MAKETUNING = -j $(PARALLELISM)
 
 ifeq "$(BUILD_ARCH)" "aarch64"
        IS_64BIT = 1
 
 ifeq "$(BUILD_ARCH)" "aarch64"
        IS_64BIT = 1
index e0b550c30eeb56aeb8e9d92673a4ca7dac869d44..50a3a46746cb0fb157f030a46c1b11e165129fa5 100644 (file)
--- a/lfs/boost
+++ b/lfs/boost
@@ -38,7 +38,7 @@ CXXFLAGS  += -O3 -fno-strict-aliasing
 # The compiler uses a lot of memory to compile boost, hence we reduce
 # the total number of processes a little bit to be able to build on
 # smaller machines
 # The compiler uses a lot of memory to compile boost, hence we reduce
 # the total number of processes a little bit to be able to build on
 # smaller machines
-override MAKETUNING = -j$(shell echo $$(( $(SYSTEM_MEMORY) / 512)))
+MAX_PARALLELISM = $(shell echo $$(( $(SYSTEM_MEMORY) / 512)))
 
 CONFIGURE_OPTIONS = \
        --prefix=/usr \
 
 CONFIGURE_OPTIONS = \
        --prefix=/usr \