diff mbox series

[v3,29/40] efi_loader: Shorten the app rules

Message ID 20240811145209.4191404-30-sjg@chromium.org
State Changes Requested
Delegated to: Tom Rini
Headers show
Series efi: Add a test for EFI bootmeth | expand

Commit Message

Simon Glass Aug. 11, 2024, 2:51 p.m. UTC
We have quite a few apps now, so create a way to specify them as a list
rather than repeating the same rules again and again.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---

(no changes since v1)

 lib/efi_loader/Makefile | 31 +++++++++----------------------
 1 file changed, 9 insertions(+), 22 deletions(-)

Comments

Ilias Apalodimas Aug. 12, 2024, 6:43 a.m. UTC | #1
On Sun, 11 Aug 2024 at 17:52, Simon Glass <sjg@chromium.org> wrote:
>
> We have quite a few apps now, so create a way to specify them as a list
> rather than repeating the same rules again and again.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
>
> (no changes since v1)
>
>  lib/efi_loader/Makefile | 31 +++++++++----------------------
>  1 file changed, 9 insertions(+), 22 deletions(-)
>
> diff --git a/lib/efi_loader/Makefile b/lib/efi_loader/Makefile
> index 27dbd9e760d..660368b9d8f 100644
> --- a/lib/efi_loader/Makefile
> +++ b/lib/efi_loader/Makefile
> @@ -22,29 +22,13 @@ CFLAGS_REMOVE_dtbdump.o := $(CFLAGS_NON_EFI)
>  CFLAGS_initrddump.o := $(CFLAGS_EFI) -Os -ffreestanding
>  CFLAGS_REMOVE_initrddump.o := $(CFLAGS_NON_EFI)
>
> -ifdef CONFIG_RISCV
> -always += boothart.efi
> -targets += boothart.o
> -endif
> -
> -ifneq ($(CONFIG_BOOTEFI_HELLO_COMPILE),)
> -always += helloworld.efi
> -targets += helloworld.o
> -endif
> -
> -ifneq ($(CONFIG_GENERATE_SMBIOS_TABLE),)
> -always += smbiosdump.efi
> -targets += smbiosdump.o
> -endif
> -
> +# These are the apps that are built
> +apps-$(CONFIG_RISCV) += boothart
> +apps-$(CONFIG_BOOTEFI_HELLO_COMPILE) += helloworld
> +apps-$(CONFIG_GENERATE_SMBIOS_TABLE) += smbiosdump
> +apps-$(CONFIG_EFI_LOAD_FILE2_INITRD) += initrddump
>  ifeq ($(CONFIG_GENERATE_ACPI_TABLE),)
> -always += dtbdump.efi
> -targets += dtbdump.o
> -endif
> -
> -ifdef CONFIG_EFI_LOAD_FILE2_INITRD
> -always += initrddump.efi
> -targets += initrddump.o
> +apps-y += dtbdump
>  endif
>
>  obj-$(CONFIG_CMD_BOOTEFI_HELLO) += helloworld_efi.o
> @@ -95,3 +79,6 @@ obj-$(CONFIG_EFI_ECPT) += efi_conformance.o
>
>  EFI_VAR_SEED_FILE := $(subst $\",,$(CONFIG_EFI_VAR_SEED_FILE))
>  $(obj)/efi_var_seed.o: $(srctree)/$(EFI_VAR_SEED_FILE)
> +
> +always += $(foreach f,$(apps-y),$(f).efi)
> +targets += $(foreach f,$(apps-y),$(f).o)
> --
> 2.34.1
>

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
diff mbox series

Patch

diff --git a/lib/efi_loader/Makefile b/lib/efi_loader/Makefile
index 27dbd9e760d..660368b9d8f 100644
--- a/lib/efi_loader/Makefile
+++ b/lib/efi_loader/Makefile
@@ -22,29 +22,13 @@  CFLAGS_REMOVE_dtbdump.o := $(CFLAGS_NON_EFI)
 CFLAGS_initrddump.o := $(CFLAGS_EFI) -Os -ffreestanding
 CFLAGS_REMOVE_initrddump.o := $(CFLAGS_NON_EFI)
 
-ifdef CONFIG_RISCV
-always += boothart.efi
-targets += boothart.o
-endif
-
-ifneq ($(CONFIG_BOOTEFI_HELLO_COMPILE),)
-always += helloworld.efi
-targets += helloworld.o
-endif
-
-ifneq ($(CONFIG_GENERATE_SMBIOS_TABLE),)
-always += smbiosdump.efi
-targets += smbiosdump.o
-endif
-
+# These are the apps that are built
+apps-$(CONFIG_RISCV) += boothart
+apps-$(CONFIG_BOOTEFI_HELLO_COMPILE) += helloworld
+apps-$(CONFIG_GENERATE_SMBIOS_TABLE) += smbiosdump
+apps-$(CONFIG_EFI_LOAD_FILE2_INITRD) += initrddump
 ifeq ($(CONFIG_GENERATE_ACPI_TABLE),)
-always += dtbdump.efi
-targets += dtbdump.o
-endif
-
-ifdef CONFIG_EFI_LOAD_FILE2_INITRD
-always += initrddump.efi
-targets += initrddump.o
+apps-y += dtbdump
 endif
 
 obj-$(CONFIG_CMD_BOOTEFI_HELLO) += helloworld_efi.o
@@ -95,3 +79,6 @@  obj-$(CONFIG_EFI_ECPT) += efi_conformance.o
 
 EFI_VAR_SEED_FILE := $(subst $\",,$(CONFIG_EFI_VAR_SEED_FILE))
 $(obj)/efi_var_seed.o: $(srctree)/$(EFI_VAR_SEED_FILE)
+
+always += $(foreach f,$(apps-y),$(f).efi)
+targets += $(foreach f,$(apps-y),$(f).o)