summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile15
1 files changed, 15 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..70e8c94
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,15 @@
1CC = riscv32-none-elf-gcc
2CP = riscv32-none-elf-objcopy
3CFLAGS = -fno-pic -nostdlib -fno-delete-null-pointer-checks --param=min-pagesize=0 -O3 -march=rv32i -mabi=ilp32 -Wall -Wextra -pedantic
4
5SRC = fibonacci.c
6ROM = riscvtest_rom_image.txt
7
8all:
9 ${CC} ${CFLAGS} ${SRC}
10 ${CP} -j .text -O binary a.out /dev/stdout \
11 | od -t x4 -w4 - | cut -d' ' -f2 | head -n -1 \
12 > ${ROM}
13
14clean:
15 rm -f a.out