aboutsummaryrefslogtreecommitdiff
path: root/VexRiscvSocSoftware/resources/gcc.mk
diff options
context:
space:
mode:
authorFriedrich Beckmann <friedrich.beckmann@hs-augsburg.de>2022-07-25 17:55:39 +0200
committerFriedrich Beckmann <friedrich.beckmann@hs-augsburg.de>2022-07-25 17:55:39 +0200
commit3fff6023602822531efdae30bc8ebf862967f1ef (patch)
tree16028102b8d850f8ab3115d28a8539ca6bc5f51d /VexRiscvSocSoftware/resources/gcc.mk
Initial Commit
Diffstat (limited to 'VexRiscvSocSoftware/resources/gcc.mk')
-rw-r--r--VexRiscvSocSoftware/resources/gcc.mk26
1 files changed, 26 insertions, 0 deletions
diff --git a/VexRiscvSocSoftware/resources/gcc.mk b/VexRiscvSocSoftware/resources/gcc.mk
new file mode 100644
index 0000000..597f0ba
--- /dev/null
+++ b/VexRiscvSocSoftware/resources/gcc.mk
@@ -0,0 +1,26 @@
+# Set it to yes if you are using the sifive precompiled GCC pack
+SIFIVE_GCC_PACK ?= yes
+
+ifeq ($(SIFIVE_GCC_PACK),yes)
+ RISCV_NAME ?= riscv64-unknown-elf
+ RISCV_PATH ?= /opt/riscv/
+else
+ RISCV_NAME ?= riscv32-unknown-elf
+ ifeq ($(MULDIV),yes)
+ RISCV_PATH ?= /opt/riscv32im/
+ else
+ RISCV_PATH ?= /opt/riscv32i/
+ endif
+endif
+
+MABI=ilp32
+MARCH := rv32i
+ifeq ($(MULDIV),yes)
+ MARCH := $(MARCH)m
+endif
+ifeq ($(COMPRESSED),yes)
+ MARCH := $(MARCH)ac
+endif
+
+CFLAGS += -march=$(MARCH) -mabi=$(MABI)
+LDFLAGS += -march=$(MARCH) -mabi=$(MABI)