[v1.03][RISCV] Add support for compiling to RISC-V

This commit is contained in:
Dr-Noob
2023-03-31 17:57:01 +02:00
parent cf77360d1b
commit 1f450b23a1
9 changed files with 67 additions and 1 deletions

View File

@@ -41,6 +41,11 @@ ifneq ($(OS),Windows_NT)
SOURCE += $(SRC_DIR)sysctl.c
HEADERS += $(SRC_DIR)sysctl.h
endif
else ifeq ($(arch), $(filter $(arch), riscv64 riscv32))
SRC_DIR=src/riscv/
SOURCE += $(COMMON_SRC) $(SRC_DIR)riscv.c $(SRC_DIR)uarch.c
HEADERS += $(COMMON_SRC) $(SRC_DIR)riscv.h $(SRC_DIR)uarch.h
CFLAGS += -DARCH_RISCV -Wno-unused-parameter -std=c99 -fstack-protector-all
else
# Error lines should not be tabulated because Makefile complains about it
$(warning Unsupported arch detected: $(arch). See https://github.com/Dr-Noob/cpufetch#1-support)