[Concept,04/12] x86: Move 16-bit binary rules to arch/x86/Makefile

Message ID 20260211143309.1183113-5-sjg@u-boot.org
State New
Headers
Series x86: Add single 64-bit U-Boot without SPL for QEMU |

Commit Message

Simon Glass Feb. 11, 2026, 2:32 p.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

The rules for extracting u-boot-x86-start16.bin and
u-boot-x86-reset16.bin are x86-specific but live in the
top-level Makefile.

Move them to arch/x86/Makefile where they belong, dropping the
outer ifdef CONFIG_X86 guard since that file is only included
for x86 builds.

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---

 Makefile          | 10 ----------
 arch/x86/Makefile |  8 ++++++++
 2 files changed, 8 insertions(+), 10 deletions(-)
  

Patch

diff --git a/Makefile b/Makefile
index f9a24cf21a0..ee5b54c4c51 100644
--- a/Makefile
+++ b/Makefile
@@ -1694,16 +1694,6 @@  quiet_cmd_ldr = LD      $@
 cmd_ldr = $(LD) $(LDFLAGS_$(@F)) \
 	       $(filter-out FORCE,$^) -o $@
 
-ifdef CONFIG_X86
-OBJCOPYFLAGS_u-boot-x86-start16.bin := -O binary -j .start16
-u-boot-x86-start16.bin: u-boot FORCE
-	$(call if_changed,objcopy)
-
-OBJCOPYFLAGS_u-boot-x86-reset16.bin := -O binary -j .resetvec
-u-boot-x86-reset16.bin: u-boot FORCE
-	$(call if_changed,objcopy)
-
-endif # CONFIG_X86
 
 OBJCOPYFLAGS_u-boot-app.efi := $(OBJCOPYFLAGS_EFI)
 u-boot-app.efi: u-boot dts/dt.dtb FORCE
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 7dc3171cebf..07e8df15afb 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -25,3 +25,11 @@  head-$(CONFIG_$(PHASE_)X86_16BIT_INIT) += arch/x86/cpu/resetvec.o
 
 libs-y += arch/x86/cpu/
 libs-y += arch/x86/lib/
+
+OBJCOPYFLAGS_u-boot-x86-start16.bin := -O binary -j .start16
+u-boot-x86-start16.bin: u-boot FORCE
+	$(call if_changed,objcopy)
+
+OBJCOPYFLAGS_u-boot-x86-reset16.bin := -O binary -j .resetvec
+u-boot-x86-reset16.bin: u-boot FORCE
+	$(call if_changed,objcopy)