diff options
author | Reka Norman <rekanorman@google.com> | 2021-09-16 14:11:34 +1000 |
---|---|---|
committer | Furquan Shaikh <furquan@google.com> | 2021-09-21 17:22:16 +0000 |
commit | 16612c483515bb09796ea2dad0e8ba24cd425069 (patch) | |
tree | 027a5bbfeff9c0ef1ee17d45cffb4c8d674989db | |
parent | 6a68482bd6154dd4a710ce4c7fb52a97b5800b05 (diff) |
lib/Makefile.inc: Fail build if SPD file doesn't exist
Currently, if LIB_SPD_DEPS contains an SPD file which doesn't exist, the
file is silently skipped when creating spd.bin. Instead, fail the build.
BUG=b:191776301
TEST=Build test on brya. Build fails if a non-existent file is included
in LIB_SPD_DEPS.
Change-Id: I1bdadb72e087c2ee7a88fbab2f3607bd400fa2e4
Signed-off-by: Reka Norman <rekanorman@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/57697
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
-rw-r--r-- | src/lib/Makefile.inc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/lib/Makefile.inc b/src/lib/Makefile.inc index bb3cf6a080..7b21c80dc7 100644 --- a/src/lib/Makefile.inc +++ b/src/lib/Makefile.inc @@ -366,10 +366,14 @@ $(LIB_SPD_BIN): $(LIB_SPD_DEPS) (echo "HAVE_SPD_IN_CBFS is set but SPD_SOURCES is empty" && exit 1) test -n "$(LIB_SPD_DEPS)" || \ (echo "SPD_SOURCES is set but no SPD file was found" && exit 1) - for f in $(LIB_SPD_DEPS); \ - do for c in $$(cat $$f | grep --binary-files=text -v ^#); \ - do printf $$(printf '\\%o' 0x$$c); \ - done; \ + for f in $(LIB_SPD_DEPS); do \ + if [ ! -f $$f ]; then \ + echo "File not found: $$f" >&2; \ + exit 1; \ + fi; \ + for c in $$(cat $$f | grep --binary-files=text -v ^#); \ + do printf $$(printf '\\%o' 0x$$c); \ + done; \ done > $@ cbfs-files-y += spd.bin |