diff --git a/UnixBench/Makefile b/UnixBench/Makefile index 4b1d5f8..4874d1f 100644 --- a/UnixBench/Makefile +++ b/UnixBench/Makefile @@ -89,15 +89,17 @@ else ## OS detection. Comment out if gmake syntax not supported by other 'make'. OSNAME:=$(shell uname -s) - ARCH := $(shell uname -p) + ARCH := $(shell uname -m) ifeq ($(OSNAME),Linux) # Not all CPU architectures support "-march" or "-march=native". - # - Supported : x86, x86_64, ARM, AARCH64, etc.. - # - Not Supported: RISC-V, IBM Power, etc... - ifneq ($(ARCH),$(filter $(ARCH),ppc64 ppc64le)) - OPTON += -march=native -mtune=native - else + # - Supported : x86, x86_64, ARM, AARCH64, riscv64, etc.. + # - Not Supported: IBM Power, etc... + ifeq ($(ARCH),$(filter $(ARCH),ppc64 ppc64le)) OPTON += -mcpu=native -mtune=native + else ifeq ($(ARCH),riscv64) + OPTON += -march=rv64g -mabi=lp64d + else + OPTON += -march=native -mtune=native endif endif