diff --git a/sdk/bsp/common.mk b/sdk/bsp/bsp.mk similarity index 80% rename from sdk/bsp/common.mk rename to sdk/bsp/bsp.mk index 7b39a96..409a5f4 100644 --- a/sdk/bsp/common.mk +++ b/sdk/bsp/bsp.mk @@ -10,22 +10,22 @@ RISCV_AR := $(abspath $(RISCV_TOOLS_PATH)/$(RISCV_TOOLS_PREFIX)ar) RISCV_OBJCOPY := $(abspath $(RISCV_TOOLS_PATH)/$(RISCV_TOOLS_PREFIX)objcopy) RISCV_READELF := $(abspath $(RISCV_TOOLS_PATH)/$(RISCV_TOOLS_PREFIX)readelf) -BIN_TO_MEM := $(COMMON_DIR)/../../tools/BinToMem.py +BIN_TO_MEM := $(BSP_DIR)/../../tools/BinToMem.py .PHONY: all all: $(TARGET) -ASM_SRCS += $(COMMON_DIR)/start.S -ASM_SRCS += $(COMMON_DIR)/trap_entry.S -C_SRCS += $(COMMON_DIR)/init.c -C_SRCS += $(COMMON_DIR)/trap_handler.c -C_SRCS += $(COMMON_DIR)/lib/utils.c -C_SRCS += $(COMMON_DIR)/lib/xprintf.c -C_SRCS += $(COMMON_DIR)/lib/uart.c +ASM_SRCS += $(BSP_DIR)/start.S +ASM_SRCS += $(BSP_DIR)/trap_entry.S +C_SRCS += $(BSP_DIR)/init.c +C_SRCS += $(BSP_DIR)/trap_handler.c +C_SRCS += $(BSP_DIR)/lib/utils.c +C_SRCS += $(BSP_DIR)/lib/xprintf.c +C_SRCS += $(BSP_DIR)/lib/uart.c -LINKER_SCRIPT := $(COMMON_DIR)/link.lds +LINKER_SCRIPT := $(BSP_DIR)/link.lds -INCLUDES += -I$(COMMON_DIR) +INCLUDES += -I$(BSP_DIR) LDFLAGS += -T $(LINKER_SCRIPT) -nostartfiles -Wl,--gc-sections -Wl,--check-sections diff --git a/sdk/examples/FreeRTOS/Demo/tinyriscv_GCC/Makefile b/sdk/examples/FreeRTOS/Demo/tinyriscv_GCC/Makefile index 354fc2f..2bb3701 100644 --- a/sdk/examples/FreeRTOS/Demo/tinyriscv_GCC/Makefile +++ b/sdk/examples/FreeRTOS/Demo/tinyriscv_GCC/Makefile @@ -23,6 +23,5 @@ C_SRCS := \ ../../Source/portable/RISC-V/port.c \ -COMMON_DIR = ../../../../bsp -TOOLCHAIN_DIR = ../../../../.. -include ../../../../bsp/common.mk +BSP_DIR = ../../../../bsp +include ../../../../bsp/bsp.mk diff --git a/sdk/examples/coremark/Makefile b/sdk/examples/coremark/Makefile index 2c42c50..d7da2d0 100644 --- a/sdk/examples/coremark/Makefile +++ b/sdk/examples/coremark/Makefile @@ -16,6 +16,5 @@ CFLAGS := -O2 -fno-common -funroll-loops -finline-functions --param max-inline-i CFLAGS += -DFLAGS_STR=\""$(CFLAGS)"\" CFLAGS += -DITERATIONS=10000 -DPERFORMANCE_RUN=1 -COMMON_DIR = ../../bsp -TOOLCHAIN_DIR = ../../.. -include ../../bsp/common.mk +BSP_DIR = ../../bsp +include ../../bsp/bsp.mk diff --git a/sdk/examples/gpio/Makefile b/sdk/examples/gpio/Makefile index c187e30..0fb2498 100644 --- a/sdk/examples/gpio/Makefile +++ b/sdk/examples/gpio/Makefile @@ -16,6 +16,5 @@ C_SRCS := \ main.c \ -COMMON_DIR = ../../bsp -TOOLCHAIN_DIR = ../../.. -include ../../bsp/common.mk +BSP_DIR = ../../bsp +include ../../bsp/bsp.mk diff --git a/sdk/examples/simple/Makefile b/sdk/examples/simple/Makefile index 059d25a..1e74d4a 100644 --- a/sdk/examples/simple/Makefile +++ b/sdk/examples/simple/Makefile @@ -16,6 +16,5 @@ C_SRCS := \ main.c \ -COMMON_DIR = ../../bsp -TOOLCHAIN_DIR = ../../.. -include ../../bsp/common.mk +BSP_DIR = ../../bsp +include ../../bsp/bsp.mk diff --git a/sdk/examples/timer_int/Makefile b/sdk/examples/timer_int/Makefile index 1860901..d398e00 100644 --- a/sdk/examples/timer_int/Makefile +++ b/sdk/examples/timer_int/Makefile @@ -16,6 +16,5 @@ C_SRCS := \ main.c \ -COMMON_DIR = ../../bsp -TOOLCHAIN_DIR = ../../.. -include ../../bsp/common.mk +BSP_DIR = ../../bsp +include ../../bsp/bsp.mk diff --git a/sdk/examples/uart_rx/Makefile b/sdk/examples/uart_rx/Makefile index aa23595..429bd3c 100644 --- a/sdk/examples/uart_rx/Makefile +++ b/sdk/examples/uart_rx/Makefile @@ -16,6 +16,5 @@ C_SRCS := \ main.c \ -COMMON_DIR = ../../bsp -TOOLCHAIN_DIR = ../../.. -include ../../bsp/common.mk +BSP_DIR = ../../bsp +include ../../bsp/bsp.mk diff --git a/sdk/examples/uart_tx/Makefile b/sdk/examples/uart_tx/Makefile index 8cc6358..bc6db9c 100644 --- a/sdk/examples/uart_tx/Makefile +++ b/sdk/examples/uart_tx/Makefile @@ -16,6 +16,5 @@ C_SRCS := \ main.c \ -COMMON_DIR = ../../bsp -TOOLCHAIN_DIR = ../../.. -include ../../bsp/common.mk +BSP_DIR = ../../bsp +include ../../bsp/bsp.mk