rework structure

This commit is contained in:
2023-08-20 15:00:51 +02:00
parent 4c2208c1ac
commit 314ceeb072
381 changed files with 10697 additions and 14653 deletions

View File

@ -1,23 +1,21 @@
TARGET = hello
C_SRCS = $(wildcard *.c)
#HEADERS = $(wildcard *.h)
CFLAGS += -g
HEADERS = $(wildcard *.h)
CFLAGS += -O2 -g
BOARD=freedom-e300-hifive1
LINK_TARGET=flash
BOARD=iss
LINK_TARGET=link
RISCV_ARCH:=rv32i
RISCV_ABI:=ilp32
LDFLAGS := -Wl,--wrap=scanf -Wl,--wrap=printf -march=$(RISCV_ARCH) -mabi=$(RISCV_ABI) -g
LDFLAGS += -g -Wl,--wrap=printf
#TOOL_DIR?=/opt/shared/riscv/FreedomStudio/20180122/SiFive/riscv64-unknown-elf-gcc-20171231-x86_64-linux-centos6/bin
TOOL_DIR=/opt/shared/riscv/tools/Ubuntu/riscv64-unknown-elf-gcc-8.3.0-2020.04.1-x86_64-linux-ubuntu14/bin
compiler := $(shell which riscv32-unknown-elf-gcc)
TOOL_DIR=$(dir $(compiler))
BSP_BASE = ./bsp
include $(BSP_BASE)/env/common.mk
TRIPLET=riscv32-unknown-elf
BSP_BASE = ../bare-metal-bsp
include $(BSP_BASE)/env/common-gcc.mk
.PHONY: all
all: $(TARGET).dump
$(TARGET).dump: $(TARGET)
$(TOOL_DIR)/$(TRIPLET)-objdump -d -S -C $< > $@
$(TARGET).vlog:$(TARGET)
riscv32-unknown-elf-objcopy -O verilog $(TARGET) $(TARGET).vlog