diff options
author | Michael Brown <mcb30@ipxe.org> | 2024-10-28 18:22:14 +0000 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2024-10-28 18:34:55 +0000 |
commit | 7ccd08dbf4e257cadb3a9e61fec1f37afb19949e (patch) | |
tree | 8fa2d33f64ed76914c8dd7e512bd2bf8459b723a | |
parent | d9c0d26e1775cb0e45b30ad6b36bae90abb1fc78 (diff) | |
download | ipxe-7ccd08dbf4e257cadb3a9e61fec1f37afb19949e.tar.gz |
[build] Allow default platform to vary by architecture
Restructure the parsing of the build directory name from
bin[[-<arch>]-<platform>]
to
bin[-<arch>[-<platform>]]
and allow for a per-architecture default build platform.
For the sake of backwards compatibility, handle "bin-efi" as a special
case equivalent to "bin-i386-efi".
Signed-off-by: Michael Brown <mcb30@ipxe.org>
-rw-r--r-- | src/Makefile.housekeeping | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/Makefile.housekeeping b/src/Makefile.housekeeping index 5d9c03930..ba61e2166 100644 --- a/src/Makefile.housekeeping +++ b/src/Makefile.housekeeping @@ -284,7 +284,7 @@ ifeq ($(wildcard $(BIN)),) $(shell $(MKDIR) -p $(BIN)) endif -# Target to allow e.g. "make bin-efi arch" +# Target to allow e.g. "make bin-x86_64-efi arch" # $(BIN) : @# Do nothing, silently @@ -333,8 +333,13 @@ else BIN_AP := $(BIN_APS) BIN_SECUREBOOT := 0 endif -BIN_PLATFORM := $(lastword $(BIN_AP)) -BIN_ARCH := $(wordlist 2,$(words $(BIN_AP)),discard $(BIN_AP)) +ifeq ($(BIN_AP),efi) +BIN_ARCH := i386 +BIN_PLATFORM := efi +else +BIN_ARCH := $(word 1,$(BIN_AP)) +BIN_PLATFORM := $(word 2,$(BIN_AP)) +endif # Determine build architecture DEFAULT_ARCH := i386 @@ -345,8 +350,10 @@ arch : .PHONY : arch # Determine build platform -DEFAULT_PLATFORM := pcbios -PLATFORM := $(firstword $(BIN_PLATFORM) $(DEFAULT_PLATFORM)) +DEFAULT_PLATFORM_i386 := pcbios +DEFAULT_PLATFORM_x86_64 := pcbios +DEFAULT_PLATFORM := $(DEFAULT_PLATFORM_$(ARCH)) +PLATFORM := $(firstword $(BIN_PLATFORM) $(DEFAULT_PLATFORM) none) CFLAGS += -DPLATFORM=$(PLATFORM) -DPLATFORM_$(PLATFORM) platform : @$(ECHO) $(PLATFORM) |