aboutsummaryrefslogtreecommitdiff
path: root/VexRiscvSocSoftware/resources/gcc.mk
diff options
context:
space:
mode:
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)