summaryrefslogtreecommitdiff
path: root/util/compare_build.sh
diff options
context:
space:
mode:
Diffstat (limited to 'util/compare_build.sh')
-rwxr-xr-xutil/compare_build.sh16
1 files changed, 14 insertions, 2 deletions
diff --git a/util/compare_build.sh b/util/compare_build.sh
index 1b6030453a..e70dcdbed2 100755
--- a/util/compare_build.sh
+++ b/util/compare_build.sh
@@ -1,6 +1,6 @@
#!/bin/bash
-# Copyright 2020 The Chromium OS Authors. All rights reserved.
+# Copyright 2020 The ChromiumOS Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
@@ -14,6 +14,7 @@
# * all - All boards that are built by the "buildall" target
# * fp - All relevant boards for fingerprint
# * stm32 - All boards that use an STM32 chip
+# * stm32f0 - All boards that use an STM32F0 family of chip
# * stm32f4 - All boards that use an STM32F4 family of chip
# * stm32h7 - All boards that use an STM32H7 family of chip
# * npcx - "
@@ -50,7 +51,7 @@ DEFINE_string 'ref2' "HEAD^" 'Git reference (commit, branch, etc)'
DEFINE_boolean 'keep' "${FLAGS_FALSE}" \
'Remove the temp directory after comparison.' 'k'
# Integer type can still be passed blank ("")
-DEFINE_integer 'jobs' "-1" 'Number of jobs to pass to make' 'j'
+DEFINE_integer 'jobs' "$(nproc)" 'Number of jobs to pass to make' 'j'
# When compiling both refs for all boards, mem usage was larger than 32GB.
# If you don't have more than 32GB, you probably don't want to build both
# refs at the same time. Use the -o flag.
@@ -61,6 +62,9 @@ DEFINE_boolean 'private' "${FLAGS_PRIVATE_DEFAULT}" \
# Usage: assoc-add-keys <associate_array_name> [item1 [item2...]]
assoc-add-keys() {
+ # Shellcheck doesn't seem to support nameref variables yet.
+ # See https://github.com/koalaman/shellcheck/issues/1544.
+ # shellcheck disable=SC2034,SC2178
local -n arr="${1}"
shift
@@ -71,6 +75,9 @@ assoc-add-keys() {
# Usage: assoc-rm-keys <associate_array_name> [item1 [item2...]
assoc-rm-keys() {
+ # Shellcheck doesn't seem to support nameref variables yet.
+ # See https://github.com/koalaman/shellcheck/issues/1544.
+ # shellcheck disable=SC2034,SC2178
local -n arr="${1}"
shift
@@ -102,6 +109,8 @@ boards-with() {
# Usage: parse-boards <associate_array_name> [board-grp1 [board-grp2...]]
parse-boards() {
+ # Shellcheck doesn't seem to support nameref variables yet.
+ # See https://github.com/koalaman/shellcheck/issues/1544.
# shellcheck disable=SC2034
local -n boards="$1"
shift
@@ -116,6 +125,7 @@ parse-boards() {
[all]="$(make-print-boards)"
[fp]="dartmonkey bloonchipper nucleo-dartmonkey nucleo-h743zi"
[stm32]="$(boards-with 'CHIP[[:space:]:=]*stm32')"
+ [stm32f0]="$(boards-with 'CHIP_VARIANT[[:space:]:=]*stm32f0')"
[stm32f4]="$(boards-with 'CHIP_VARIANT[[:space:]:=]*stm32f4')"
[stm32h7]="$(boards-with 'CHIP_VARIANT[[:space:]:=]*stm32h7')"
[npcx]="$(boards-with 'CHIP[[:space:]:=]*npcx')"
@@ -216,6 +226,7 @@ echo "# Preparing Makefile"
cat > "${TMP_DIR}/Makefile" <<HEREDOC
ORIGIN ?= $(realpath .)
CRYPTOC_DIR ?= $(realpath ../../third_party/cryptoc)
+ZEPHYR_BASE ?= $(realpath ../../../src/third_party/zephyr/main)
BOARDS ?= ${BOARDS[*]}
LINKS ?= ${LINKS[*]}
@@ -233,6 +244,7 @@ build-%: ec-%
\$(MAKE) --no-print-directory -C \$(@:build-%=ec-%) \\
STATIC_VERSION=1 \\
CRYPTOC_DIR=\$(CRYPTOC_DIR) \\
+ ZEPHYR_BASE=\$(ZEPHYR_BASE) \\
\$(addprefix proj-,\$(BOARDS))
@printf " MKDIR %s\n" "\$@"
@mkdir -p \$@