[PATCH 4/5] x86: reuse cmd_objcopy to generate barebox.efi

Masahiro Yamada masahiroy at kernel.org
Tue Nov 16 19:49:17 PST 2021


The objcopy rule is defined in scripts/Makefile.lib

Reuse it.

Signed-off-by: Masahiro Yamada <masahiroy at kernel.org>
---

 arch/x86/Makefile | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 5623b2cea..53cbd5088 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -54,17 +54,16 @@ common-y += arch/x86/lib/
 lds-$(CONFIG_X86_32)   := arch/x86/mach-efi/elf_ia32_efi.lds
 lds-$(CONFIG_X86_64)   := arch/x86/mach-efi/elf_x86_64_efi.lds
 
-quiet_cmd_efi_image = EFI-IMG $@
-      cmd_efi_image = $(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic \
-		      -j .dynsym -j .rel -j .rela -j .reloc \
-		      -j .bbenv.* -j .bblogo.* --target=$(TARGET) $< $@
-
 KBUILD_BINARY := barebox
 
 KBUILD_LDFLAGS := --no-undefined
 
+OBJCOPYFLAGS_barebox.efi = \
+	-j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rel -j .rela \
+	-j .reloc -j .bbenv.* -j .bblogo.* --target=$(TARGET)
+
 barebox.efi: $(KBUILD_BINARY) FORCE
-	$(call if_changed,efi_image)
+	$(call if_changed,objcopy)
 
 KBUILD_IMAGE := barebox.efi
 
-- 
2.30.2




More information about the barebox mailing list