TARGET    = raven_spn
C_SRCS    = $(wildcard src/*.c)  $(BSP_BASE)/drivers/fe300prci/fe300prci_driver.c $(BSP_BASE)/drivers/plic/plic_driver.c
CXX_SRCS  = $(wildcard src/*.cpp) 
HEADERS   = $(wildcard src/*.h)
CFLAGS    = -g -fno-builtin-printf -DUSE_PLIC -I./src
CXXFLAGS  = -fno-use-cxa-atexit
LDFLAGS  += -g -lstdc++ -fno-use-cxa-atexit -march=$(RISCV_ARCH) -mabi=$(RISCV_ABI) -mcmodel=medany


BOARD=freedom-e300-hifive1
LINK_TARGET=flash
RISCV_ARCH=rv32imac
RISCV_ABI=ilp32

TOOL_DIR=/opt/shared/riscv/tools/Ubuntu/riscv64-unknown-elf-gcc-8.3.0-2020.04.1-x86_64-linux-ubuntu14/bin

BSP_BASE = ./bsp
include $(BSP_BASE)/env/common.mk

.PHONY: all
all: $(TARGET).dump

$(TARGET).dump: $(TARGET)
	$(TOOL_DIR)/$(TRIPLET)-objdump -d -S -C $< > $@