moved platform specific files to folder

This commit is contained in:
Sergey Yarkov 2026-09-11 16:07:12 +03:00
parent 770694a42c
commit c036856290
12 changed files with 14 additions and 4 deletions

3
.gitignore vendored
View File

@ -1,4 +1,5 @@
.cache
compile_commands.json
build
obj
obj
asm

View File

@ -50,7 +50,6 @@ PROJ_SRCS=$(shell find $(SRC_DIR) -name "*.c")
OBJS=$(patsubst $(SRC_DIR)/%.c,$(OBJ_DIR)/%.o,$(PROJ_SRCS))
ASMS=$(patsubst $(SRC_DIR)/%.c,$(ASM_DIR)/%.S,$(PROJ_SRCS))
ifneq (, $(filter $(PLATFORM), $(BUILD_CONFIGS_MK)))
include build_config/$(PLATFORM).mk
else

View File

@ -1,5 +1,6 @@
# === Directories path =============================================================================
EVT_DIR=/opt/wch/CH32V003EVT/EVT/EXAM/SRC
PLATFORM_DIR=platform/ch32v00x
# ==================================================================================================
@ -19,6 +20,7 @@ CC_FLAGS+=-march=rv32ec_zicsr
CC_FLAGS+=-mabi=ilp32e
CC_FLAGS+=-I$(EVT_DIR)/Core
CC_FLAGS+=-I$(EVT_DIR)/Peripheral/inc
CC_FLAGS+=-I./platform/ch32v00x
# ==================================================================================================
@ -28,11 +30,15 @@ LDSCRIPT+=./ld/Link.ld
LD_FLAGS+=-T$(LDSCRIPT)
# ==================================================================================================
# Adds WCH SDK to compile flow
STARTUP_SRC=./startup_ch32v00x.S
STARTUP_SRC=$(PLATFORM_DIR)/startup_ch32v00x.S
PLATFORM_SRCS=$(shell find platform/ch32v00x -name "*.c")
EVT_SRCS=$(shell find $(EVT_DIR)/Core -name "*.c")
EVT_SRCS+=$(shell find $(EVT_DIR)/Peripheral -name "*.c")
OBJS+=$(patsubst $(EVT_DIR)/%.c,$(OBJ_DIR)/evt/%.o,$(EVT_SRCS))
OBJS+=$(patsubst $(PLATFORM_DIR)/%.c,$(OBJ_DIR)/$(PLATFORM_DIR)/%.o,$(PLATFORM_SRCS))
OBJS+=$(OBJ_DIR)/startup_ch32v00x.o
prog_flash: $(OUT_DIR)/$(TARGET).bin
@ -47,6 +53,10 @@ $(OBJ_DIR)/evt/%.o: $(EVT_DIR)/%.c
@mkdir -p $(dir $@)
$(CC) $(CC_FLAGS) -c $< -o $@
$(OBJ_DIR)/$(PLATFORM_DIR)/%.o: $(PLATFORM_DIR)/%.c
@mkdir -p $(dir $@)
$(CC) $(CC_FLAGS) -c $< -o $@
$(OBJ_DIR)/startup_ch32v00x.o: $(STARTUP_SRC)
@mkdir -p $(dir $@)
$(CC) $(CC_FLAGS) -c $< -o $@

View File

@ -1,4 +1,4 @@
#include "debug.h"
#include "../platform/ch32v00x/debug.h"
int main(void) {
GPIO_InitTypeDef GPIO_InitStructure = {0};