From fda545d5dd408c6ae2bfdec501e9b7a7ea24bbbc Mon Sep 17 00:00:00 2001 From: Martin Roth Date: Wed, 10 May 2023 12:43:24 -0600 Subject: [PATCH] Makefile.inc: Create function to add a file to CBFS This function can be called to more easily add a file to CBFS. Additional file attributes can be added later: cbfs-files-y += pagetables pagetables-file := $(objcbfs)/pt pagetables-type := raw pagetables-compression := none pagetables-COREBOOT-position := $(CONFIG_ARCH_X86_64_PGTBL_LOC) becomes $(call add-cbfs-file-simple, pagetables, $(objcbfs)/pt, raw, none ) pagetables-COREBOOT-position := $(CONFIG_ARCH_X86_64_PGTBL_LOC) This is especially useful inside macros where you may want to add an unknown number of entries. Signed-off-by: Martin Roth Change-Id: I72bb2f21fb22f650b7970c7a37a48c10a4af0ed5 Reviewed-on: https://review.coreboot.org/c/coreboot/+/75108 Tested-by: build bot (Jenkins) Reviewed-by: Felix Singer --- Makefile.inc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Makefile.inc b/Makefile.inc index 808c0d916a..abf47d4fae 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -326,6 +326,19 @@ define cbfs-files-processor-config mv -f $(2).tmp $(2)) endef +####################################################################### +# Add a file to CBFS with just type and compression values +# arg1: name in CBFS +# arg2: filename and path +# arg3: type in CBFS +# arg4: compression type +define add-cbfs-file-simple + $(eval cbfs-files-y += $(1)) + $(eval $(1)-file := $(2)) + $(eval $(1)-type := $(3)) + $(eval $(1)-compression := $(4)) +endef + ####################################################################### # Compile a C file with a bare struct definition into binary # arg1: C source file