make: Allow users to specify the target build architecture
make TARGET_ARCHICTECTURE=broadwell Change-Id: I868c2f5c203dfc1a4e6cf48c39b391e174d5d33b Signed-off-by: Ben Walker <benjamin.walker@intel.com> Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/461601 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
This commit is contained in:
parent
8f12bc5b69
commit
7dbdf87f63
@ -72,19 +72,18 @@ ifneq ($(filter freebsd%,$(TARGET_TRIPLET_WORDS)),)
|
|||||||
OS = FreeBSD
|
OS = FreeBSD
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
TARGET_ARCHITECTURE ?= native
|
||||||
TARGET_MACHINE := $(firstword $(TARGET_TRIPLET_WORDS))
|
TARGET_MACHINE := $(firstword $(TARGET_TRIPLET_WORDS))
|
||||||
|
|
||||||
COMMON_CFLAGS = -g $(C_OPT) -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wmissing-declarations -fno-strict-aliasing -I$(SPDK_ROOT_DIR)/include
|
COMMON_CFLAGS = -g $(C_OPT) -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wmissing-declarations -fno-strict-aliasing -I$(SPDK_ROOT_DIR)/include
|
||||||
|
|
||||||
ifneq ($(filter powerpc%,$(TARGET_MACHINE)),)
|
ifneq ($(filter powerpc%,$(TARGET_MACHINE)),)
|
||||||
COMMON_CFLAGS += -mcpu=native
|
COMMON_CFLAGS += -mcpu=$(TARGET_ARCHITECTURE)
|
||||||
endif
|
else ifeq ($(TARGET_MACHINE),aarch64)
|
||||||
ifeq ($(TARGET_MACHINE),x86_64)
|
|
||||||
COMMON_CFLAGS += -march=native
|
|
||||||
endif
|
|
||||||
ifeq ($(TARGET_MACHINE),aarch64)
|
|
||||||
COMMON_CFLAGS += -march=armv8-a+crc
|
COMMON_CFLAGS += -march=armv8-a+crc
|
||||||
COMMON_CFLAGS += -DPAGE_SIZE=$(shell getconf PAGESIZE)
|
COMMON_CFLAGS += -DPAGE_SIZE=$(shell getconf PAGESIZE)
|
||||||
|
else
|
||||||
|
COMMON_CFLAGS += -march=$(TARGET_ARCHITECTURE)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_WERROR), y)
|
ifeq ($(CONFIG_WERROR), y)
|
||||||
|
Loading…
Reference in New Issue
Block a user