2019-12-04 00:47:19 +00:00
|
|
|
|
2020-03-29 15:19:14 +00:00
|
|
|
RISCV_ARCH := rv32im
|
2019-12-04 00:47:19 +00:00
|
|
|
RISCV_ABI := ilp32
|
|
|
|
|
2020-03-08 07:09:30 +00:00
|
|
|
RISCV_PATH := ../../../tools/gnu-mcu-eclipse-riscv-none-gcc-8.2.0-2.2-20190521-0004-win64/
|
2019-12-04 00:47:19 +00:00
|
|
|
|
|
|
|
CFLAGS += -march=$(RISCV_ARCH)
|
|
|
|
CFLAGS += -mabi=$(RISCV_ABI)
|
|
|
|
CFLAGS += -static -mcmodel=medany -fvisibility=hidden -nostdlib -nostartfiles
|
|
|
|
|
|
|
|
RISCV_GCC := $(abspath $(RISCV_PATH)/bin/riscv-none-embed-gcc)
|
|
|
|
RISCV_AS := $(abspath $(RISCV_PATH)/bin/riscv-none-embed-as)
|
|
|
|
RISCV_GXX := $(abspath $(RISCV_PATH)/bin/riscv-none-embed-g++)
|
|
|
|
RISCV_OBJDUMP := $(abspath $(RISCV_PATH)/bin/riscv-none-embed-objdump)
|
|
|
|
RISCV_GDB := $(abspath $(RISCV_PATH)/bin/riscv-none-embed-gdb)
|
|
|
|
RISCV_AR := $(abspath $(RISCV_PATH)/bin/riscv-none-embed-ar)
|
|
|
|
RISCV_OBJCOPY := $(abspath $(RISCV_PATH)/bin/riscv-none-embed-objcopy)
|
|
|
|
RISCV_READELF := $(abspath $(RISCV_PATH)/bin/riscv-none-embed-readelf)
|
|
|
|
|
|
|
|
|
|
|
|
.PHONY: all
|
|
|
|
all:
|
2020-03-08 07:09:30 +00:00
|
|
|
$(RISCV_GCC) $(CFLAGS) start.S main.c -Tlink.ld -o timer_int
|
|
|
|
$(RISCV_OBJCOPY) -O binary timer_int timer_int.bin
|
|
|
|
$(RISCV_OBJDUMP) --disassemble-all timer_int > timer_int.dump
|