Buildsystem: permit to pass CPUS=X to make to force a number of CPUS to be used if desired, else the default is detected in Makefile and pushed to submodules. If nothing specified, uses nproc and pass it to submodules. CircleCI forced to CPUS=2

This commit is contained in:
Thierry Laurion 2020-09-25 15:52:31 -04:00
parent 0eb1f69216
commit c74564086c
No known key found for this signature in database
GPG Key ID: E7B4A71658E36A93
4 changed files with 12 additions and 12 deletions

View File

@ -50,7 +50,7 @@ jobs:
# command: |
# ./build/make-4.2.1/make \
# CROSS=/cross/bin/x86_64-linux-musl- \
# --load 2 \
# CPUS=2 \
# V=1 \
# BOARD=qemu-linuxboot \
#
@ -63,7 +63,7 @@ jobs:
name: x230-flash
#We delete build/make-4.2.1/ directory until issue #799 is fixed.
command: |
rm -rf build/x230-flash/* build/log/* && make --load 2 \
rm -rf build/x230-flash/* build/log/* && make CPUS=2 \
V=1 \
BOARD=x230-flash || (find ./build/ -name "*.log" -type f -mmin -1|while read log; do echo ""; echo '==>' "$log" '<=='; echo ""; cat $log;done; exit 1) \
no_output_timeout: 3h
@ -81,7 +81,7 @@ jobs:
- run:
name: t430-flash
command: |
rm -rf build/t430-flash/* build/log/* && make --load 2 \
rm -rf build/t430-flash/* build/log/* && make CPUS=2 \
V=1 \
BOARD=t430-flash || (find ./build/ -name "*.log" -type f -mmin -1|while read log; do echo ""; echo '==>' "$log" '<=='; echo ""; cat $log;done; exit 1) \
no_output_timeout: 3h
@ -99,7 +99,7 @@ jobs:
- run:
name: t430
command: |
rm -rf build/t430/* build/log/* && make --load 2 \
rm -rf build/t430/* build/log/* && make CPUS=2 \
V=1 \
BOARD=t430 || (find ./build/ -name "*.log" -type f -mmin -1|while read log; do echo ""; echo '==>' "$log" '<=='; echo ""; cat $log;done; exit 1) \
no_output_timeout: 3h
@ -117,7 +117,7 @@ jobs:
- run:
name: x230
command: |
rm -rf build/x230/* build/log/* && make --load 2 \
rm -rf build/x230/* build/log/* && make CPUS=2 \
V=1 \
BOARD=x230 || (find ./build/ -name "*.log" -type f -mmin -1|while read log; do echo ""; echo '==>' "$log" '<=='; echo ""; cat $log;done; exit 1) \
no_output_timeout: 3h
@ -135,7 +135,7 @@ jobs:
- run:
name: x230-hotp-verification
command: |
rm -rf build/x230-hotp-verification/* build/log/* && make --load 2 \
rm -rf build/x230-hotp-verification/* build/log/* && make CPUS=2 \
V=1 \
BOARD=x230-hotp-verification || (find ./build/ -name "*.log" -type f -mmin -1|while read log; do echo ""; echo '==>' "$log" '<=='; echo ""; cat $log;done; exit 1) \
no_output_timeout: 3h
@ -153,7 +153,7 @@ jobs:
- run:
name: librem_mini-NoTPM
command: |
rm -rf build/librem_mini-NoTPM/* build/log/* && make --load 2 \
rm -rf build/librem_mini-NoTPM/* build/log/* && make CPUS=2 \
V=1 \
BOARD=librem_mini-NoTPM || (find ./build/ -name "*.log" -type f -mmin -1|while read log; do echo ""; echo '==>' "$log" '<=='; echo ""; cat $log;done; exit 1) \
no_output_timeout: 3h
@ -171,7 +171,7 @@ jobs:
- run:
name: qemu-coreboot
command: |
rm -rf build/qemu-coreboot/* build/log/* && make --load 2 \
rm -rf build/qemu-coreboot/* build/log/* && make CPUS=2 \
V=1 \
BOARD=qemu-coreboot || (find ./build/ -name "*.log" -type f -mmin -1|while read log; do echo ""; echo '==>' "$log" '<=='; echo ""; cat $log;done; exit 1) \
no_output_timeout: 3h

View File

@ -16,7 +16,7 @@ INSTALL := $(pwd)/install
log_dir := $(build)/log
# Controls how many parallel jobs are invoked in subshells
CPUS := $(shell nproc)
CPUS ?= $(shell nproc)
#MAKE_JOBS ?= -j$(CPUS) --max-load 16
# Create the log directory if it doesn't already exist

View File

@ -67,12 +67,12 @@ $(COREBOOT_TOOLCHAIN):
else
COREBOOT_TOOLCHAIN="$(build)/$(coreboot_base_dir)/.xcompile"
$(COREBOOT_TOOLCHAIN): $(build)/$(coreboot_base_dir)/.canary
$(MAKE) -C "$(build)/$(coreboot_base_dir)" CPUS=`nproc` crossgcc-i386
$(MAKE) -C "$(build)/$(coreboot_base_dir)" CPUS=$$CPUS crossgcc-i386
endif
$(build)/$(coreboot_dir)/.configured: $(COREBOOT_IASL) $(COREBOOT_TOOLCHAIN)
$(COREBOOT_IASL): $(build)/$(coreboot_base_dir)/.canary
$(MAKE) -C "$(build)/$(coreboot_base_dir)" CPUS=`nproc` iasl
$(MAKE) -C "$(build)/$(coreboot_base_dir)" CPUS=$$CPUS iasl
# Force a rebuild if the inputs have changed
$(build)/$(coreboot_dir)/.build: \

View File

@ -21,7 +21,7 @@ linuxboot_configure := \
if [ "$(linuxboot_board)" = "qemu" ]; then \
echo >&2 "Pre-building edk2 OVMF" ; \
( cd $(build)/$(linuxboot_base_dir)/edk2/OvmfPkg ; \
./build.sh -n `nproc` \
./build.sh -n $$CPUS \
) || exit 1 ; \
fi ; \
touch .config ; \