Merge pull request #3367 from wfly1998/main

build: always reset ARCH after getting it
This commit is contained in:
Bin Liu 2022-03-02 14:42:45 +08:00 committed by GitHub
commit 2ae8bd696a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,20 +8,19 @@ SKIP_GO_VERSION_CHECK=
include golang.mk include golang.mk
#Get ARCH. #Get ARCH.
ifneq (,$(golang_version_raw)) ifeq ($(ARCH),)
GOARCH=$(shell go env GOARCH) ifneq (,$(golang_version_raw))
ifeq ($(ARCH),) override ARCH = $(shell go env GOARCH)
ARCH = $(GOARCH) else
endif override ARCH = $(shell uname -m)
else
ARCH = $(shell uname -m)
ifeq ($(ARCH),x86_64)
ARCH = amd64
endif
ifeq ($(ARCH),aarch64)
ARCH = arm64
endif endif
endif endif
ifeq ($(ARCH),x86_64)
override ARCH = amd64
endif
ifeq ($(ARCH),aarch64)
override ARCH = arm64
endif
ARCH_DIR = arch ARCH_DIR = arch
ARCH_FILE_SUFFIX = -options.mk ARCH_FILE_SUFFIX = -options.mk
@ -29,8 +28,12 @@ ARCH_FILE = $(ARCH_DIR)/$(ARCH)$(ARCH_FILE_SUFFIX)
ARCH_FILES = $(wildcard arch/*$(ARCH_FILE_SUFFIX)) ARCH_FILES = $(wildcard arch/*$(ARCH_FILE_SUFFIX))
ALL_ARCHES = $(patsubst $(ARCH_DIR)/%$(ARCH_FILE_SUFFIX),%,$(ARCH_FILES)) ALL_ARCHES = $(patsubst $(ARCH_DIR)/%$(ARCH_FILE_SUFFIX),%,$(ARCH_FILES))
# Load architecture-dependent settings ifeq (,$(realpath $(ARCH_FILE)))
include $(ARCH_FILE) $(error "ERROR: invalid architecture: '$(ARCH)'")
else
# Load architecture-dependent settings
include $(ARCH_FILE)
endif
PROJECT_TYPE = kata PROJECT_TYPE = kata
PROJECT_NAME = Kata Containers PROJECT_NAME = Kata Containers