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