summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorAlistair Francis <alistair.francis@wdc.com>2019-02-16 01:56:53 +0300
committerAnup Patel <anup@brainfault.org>2019-02-17 13:51:18 +0300
commit16426420b5d6bbf16c035503dd7d9eabd91e3f04 (patch)
treefd732be2d71af0e46697df54dbdcdba231d22d0e /Makefile
parent3c53950b003af585de66c6eeddcf8cc17eb6c890 (diff)
downloadopensbi-16426420b5d6bbf16c035503dd7d9eabd91e3f04.tar.xz
Makefile: Fix the assignment of OPENSBI_CC_XLEN
Previously OPENSBI_CC_XLEN was not being correctly assigned either 32 or 64. It also was not assigned before config.mk was parsed. Ensure that it will always be assigned. Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile6
1 files changed, 3 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 2433085..c1ac54c 100644
--- a/Makefile
+++ b/Makefile
@@ -54,6 +54,9 @@ export firmware_dir=$(CURDIR)/firmware
OPENSBI_VERSION_MAJOR=`grep MAJOR $(include_dir)/sbi/sbi_version.h | awk '{ print $$3 }'`
OPENSBI_VERSION_MINOR=`grep MINOR $(include_dir)/sbi/sbi_version.h | awk '{ print $$3 }'`
+# Guess the compillers xlen
+OPENSBI_CC_XLEN := $(shell TMP=`$(CC) -dumpmachine`; echo $${TMP:5:2})
+
# Setup list of objects.mk files
ifdef PLATFORM
platform-object-mks=$(shell if [ -d $(platform_dir) ]; then find $(platform_dir) -iname "objects.mk" | sort -r; fi)
@@ -116,9 +119,6 @@ endif
AS = $(CC)
DTC = dtc
-# Guess the compillers xlen
-OPENSBI_CC_XLEN = `expr substr \`$(CC) -dumpmachine\` 6 2`
-
# Setup platform XLEN, ABI, ISA and Code Model
ifndef PLATFORM_RISCV_XLEN
ifeq ($(OPENSBI_CC_XLEN), 32)