From e47d9fd3b6cf23b0d98bdcd2a8176cefa4c5f089 Mon Sep 17 00:00:00 2001 From: Maximilian Brune Date: Thu, 2 Feb 2023 01:50:51 +0100 Subject: src/sbom/Makefile.inc: Fix variable expansion Make does its work in two distinct phases. The first one basically initializes and expands all variables, which are not in a recipe and the second expands all variables inside recipes and then executes the recipes if necessary. Currently on some mainboards it can happen that cpu_microcode_bins variable is filled with microcode paths AFTER swid-files-y is expanded in the prerequisite for the sbom rule. That causes the "$(build-dir)/intel-microcode-%.json pattern matching rule not to be invoked. At the time, when the recipe is executed however (second phase of make), swid-files-y will now contain the cpu microcode paths from cpu_microcode_bins. That causes the goswid tooling to fail since the necessary files were never created, since "(build-dir)/intel-microcode-%.json" target was never executed. In order to trigger the expansion of swid-files-y at the second make phase (after cpu_microcode_bins is fully filled), this patch makes use of make's secondary expansion feature. Before on some boards (including samsung/lumpy) the goswid tool complained about not finding the microcode sbom files. Test: build samsung/lumpy with CONFIG_SBOM_MICROCODE=y Signed-off-by: Maximilian Brune Change-Id: I884469a388fd48be89d74ccda686dd8f299d63eb Reviewed-on: https://review.coreboot.org/c/coreboot/+/72660 Tested-by: build bot (Jenkins) Reviewed-by: Elyes Haouas --- src/sbom/Makefile.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/sbom') diff --git a/src/sbom/Makefile.inc b/src/sbom/Makefile.inc index b99420e44d8e..21e2fa4e185a 100644 --- a/src/sbom/Makefile.inc +++ b/src/sbom/Makefile.inc @@ -85,7 +85,7 @@ endif ## Build final SBOM (Software Bill of Materials) file in uswid format -$(build-dir)/sbom.uswid: $(build-dir)/coreboot.json $(swid-files-y) $(swid-files-compiler) | $(build-dir)/goswid $(build-dir) +$(build-dir)/sbom.uswid: $(build-dir)/coreboot.json $$(swid-files-y) $(swid-files-compiler) | $(build-dir)/goswid $(build-dir) echo " SBOM " $^ $(build-dir)/goswid convert -o $@ \ --parent $(build-dir)/coreboot.json \ -- cgit v1.2.3