mirror of https://github.com/ipxe/ipxe.git
[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>pull/1330/head
parent
d9c0d26e17
commit
7ccd08dbf4
|
@ -284,7 +284,7 @@ ifeq ($(wildcard $(BIN)),)
|
||||||
$(shell $(MKDIR) -p $(BIN))
|
$(shell $(MKDIR) -p $(BIN))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Target to allow e.g. "make bin-efi arch"
|
# Target to allow e.g. "make bin-x86_64-efi arch"
|
||||||
#
|
#
|
||||||
$(BIN) :
|
$(BIN) :
|
||||||
@# Do nothing, silently
|
@# Do nothing, silently
|
||||||
|
@ -333,8 +333,13 @@ else
|
||||||
BIN_AP := $(BIN_APS)
|
BIN_AP := $(BIN_APS)
|
||||||
BIN_SECUREBOOT := 0
|
BIN_SECUREBOOT := 0
|
||||||
endif
|
endif
|
||||||
BIN_PLATFORM := $(lastword $(BIN_AP))
|
ifeq ($(BIN_AP),efi)
|
||||||
BIN_ARCH := $(wordlist 2,$(words $(BIN_AP)),discard $(BIN_AP))
|
BIN_ARCH := i386
|
||||||
|
BIN_PLATFORM := efi
|
||||||
|
else
|
||||||
|
BIN_ARCH := $(word 1,$(BIN_AP))
|
||||||
|
BIN_PLATFORM := $(word 2,$(BIN_AP))
|
||||||
|
endif
|
||||||
|
|
||||||
# Determine build architecture
|
# Determine build architecture
|
||||||
DEFAULT_ARCH := i386
|
DEFAULT_ARCH := i386
|
||||||
|
@ -345,8 +350,10 @@ arch :
|
||||||
.PHONY : arch
|
.PHONY : arch
|
||||||
|
|
||||||
# Determine build platform
|
# Determine build platform
|
||||||
DEFAULT_PLATFORM := pcbios
|
DEFAULT_PLATFORM_i386 := pcbios
|
||||||
PLATFORM := $(firstword $(BIN_PLATFORM) $(DEFAULT_PLATFORM))
|
DEFAULT_PLATFORM_x86_64 := pcbios
|
||||||
|
DEFAULT_PLATFORM := $(DEFAULT_PLATFORM_$(ARCH))
|
||||||
|
PLATFORM := $(firstword $(BIN_PLATFORM) $(DEFAULT_PLATFORM) none)
|
||||||
CFLAGS += -DPLATFORM=$(PLATFORM) -DPLATFORM_$(PLATFORM)
|
CFLAGS += -DPLATFORM=$(PLATFORM) -DPLATFORM_$(PLATFORM)
|
||||||
platform :
|
platform :
|
||||||
@$(ECHO) $(PLATFORM)
|
@$(ECHO) $(PLATFORM)
|
||||||
|
|
Loading…
Reference in New Issue