Subrata Banik has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/86368?usp=email )
Change subject: lib: Refactor logo.bmp inclusion with helper macro ......................................................................
lib: Refactor logo.bmp inclusion with helper macro
This commit refactors the logo.bmp inclusion logic to use a helper macro, `add_bmp_logo_file_to_cbfs`. This centralizes the logic for adding BMP logo files to the CBFS image and improves code readability.
Change-Id: I135c1f2af02064b72bc1f747336ac98ffdb20842 Signed-off-by: Subrata Banik subratabanik@google.com --- M src/lib/Makefile.mk 1 file changed, 14 insertions(+), 6 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/68/86368/1
diff --git a/src/lib/Makefile.mk b/src/lib/Makefile.mk index 292f5d2..93e76d4 100644 --- a/src/lib/Makefile.mk +++ b/src/lib/Makefile.mk @@ -422,13 +422,21 @@ romstage-y += ux_locales.c
# Add logo to the cbfs image -ifneq ($(CONFIG_HAVE_CUSTOM_BMP_LOGO),y) -cbfs-files-$(CONFIG_BMP_LOGO) += logo.bmp -logo.bmp-file := $(call strip_quotes,$(CONFIG_FSP2_0_LOGO_FILE_NAME)) -logo.bmp-type := raw +BMP_LOGO_COMPRESS_FLAG := $(CBFS_COMPRESS_FLAG) ifeq ($(CONFIG_BMP_LOGO_COMPRESS_LZMA),y) -logo.bmp-compression := LZMA + BMP_LOGO_COMPRESS_FLAG := LZMA else ifeq ($(CONFIG_BMP_LOGO_COMPRESS_LZ4),y) -logo.bmp-compression := LZ4 + BMP_LOGO_COMPRESS_FLAG := LZ4 endif + +define add_bmp_logo_file_to_cbfs +cbfs-files-$$($(1)) += $(2) +$(2)-file := $$(call strip_quotes,$$($(3))) +$(2)-type := raw +$(2)-compression := $$(BMP_LOGO_COMPRESS_FLAG) +endef + +ifneq ($(CONFIG_HAVE_CUSTOM_BMP_LOGO),y) +$(eval $(call add_bmp_logo_file_to_cbfs,CONFIG_BMP_LOGO, logo.bmp,\ + CONFIG_FSP2_0_LOGO_FILE_NAME)) endif