[build] Allow for 32-bit and 64-bit versions of util/zbin

Parsing ELF data is simpler if we don't have to build a single binary
to handle both 32-bit and 64-bit ELF formats.

Allow for separate 32-bit and 64-bit binaries built from util/zbin.c
(as is already done for util/elf2efi.c).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2025-05-06 12:07:38 +01:00
parent 4c11737d5d
commit 98646b9f01
10 changed files with 40 additions and 5 deletions

View File

@@ -1449,10 +1449,15 @@ endif # defined(BIN)
ZBIN_LDFLAGS := -llzma
$(ZBIN) : util/zbin.c $(MAKEDEPS)
$(ZBIN32) : util/zbin.c $(MAKEDEPS)
$(QM)$(ECHO) " [HOSTCC] $@"
$(Q)$(HOST_CC) $(HOST_CFLAGS) $< $(ZBIN_LDFLAGS) -o $@
CLEANUP += $(ZBIN)
$(Q)$(HOST_CC) $(HOST_CFLAGS) $< $(ZBIN_LDFLAGS) -DELF32 -o $@
CLEANUP += $(ZBIN32)
$(ZBIN64) : util/zbin.c $(MAKEDEPS)
$(QM)$(ECHO) " [HOSTCC] $@"
$(Q)$(HOST_CC) $(HOST_CFLAGS) $< $(ZBIN_LDFLAGS) -DELF64 -o $@
CLEANUP += $(ZBIN64)
###############################################################################
#