diff options
| -rw-r--r-- | Makefile | 15 |
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 @@ | |||
| 1 | CC = riscv32-none-elf-gcc | ||
| 2 | CP = riscv32-none-elf-objcopy | ||
| 3 | CFLAGS = -fno-pic -nostdlib -fno-delete-null-pointer-checks --param=min-pagesize=0 -O3 -march=rv32i -mabi=ilp32 -Wall -Wextra -pedantic | ||
| 4 | |||
| 5 | SRC = fibonacci.c | ||
| 6 | ROM = riscvtest_rom_image.txt | ||
| 7 | |||
| 8 | all: | ||
| 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 | |||
| 14 | clean: | ||
| 15 | rm -f a.out | ||
