BaseTools: Replace ARCH with HOST_ARCH in C Makefile to avoid conflict

https://bugzilla.tianocore.org/show_bug.cgi?id=793

ARCH is too generic. It may cause confuse of target arch or host arch.
To be clarified, replace it with HOST_ARCH in BaseTools C Makefile.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
This commit is contained in:
Liming Gao
2017-11-28 11:18:50 +08:00
parent 43e12eeac8
commit a9f6e0a4dc
23 changed files with 51 additions and 51 deletions

View File

@@ -12,40 +12,40 @@
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#
ifndef ARCH
ifndef HOST_ARCH
#
# If ARCH is not defined, then we use 'uname -m' to attempt
# try to figure out the appropriate ARCH.
# If HOST_ARCH is not defined, then we use 'uname -m' to attempt
# try to figure out the appropriate HOST_ARCH.
#
uname_m = $(shell uname -m)
$(info Attempting to detect ARCH from 'uname -m': $(uname_m))
$(info Attempting to detect HOST_ARCH from 'uname -m': $(uname_m))
ifneq (,$(strip $(filter $(uname_m), x86_64 amd64)))
ARCH=X64
HOST_ARCH=X64
endif
ifeq ($(patsubst i%86,IA32,$(uname_m)),IA32)
ARCH=IA32
HOST_ARCH=IA32
endif
ifneq (,$(findstring aarch64,$(uname_m)))
ARCH=AARCH64
HOST_ARCH=AARCH64
endif
ifneq (,$(findstring arm,$(uname_m)))
ARCH=ARM
HOST_ARCH=ARM
endif
ifndef ARCH
$(info Could not detected ARCH from uname results)
$(error ARCH is not defined!)
ifndef HOST_ARCH
$(info Could not detected HOST_ARCH from uname results)
$(error HOST_ARCH is not defined!)
endif
$(info Detected ARCH of $(ARCH) using uname.)
$(info Detected HOST_ARCH of $(HOST_ARCH) using uname.)
endif
export ARCH
export HOST_ARCH
MAKEROOT = .
include Makefiles/header.makefile
all: makerootdir subdirs $(MAKEROOT)/libs
@echo Finished building BaseTools C Tools with ARCH=$(ARCH)
@echo Finished building BaseTools C Tools with HOST_ARCH=$(HOST_ARCH)
LIBRARIES = Common
# NON_BUILDABLE_APPLICATIONS = GenBootSector BootSectImage