mirror of
https://github.com/sergeyyarkov/ch32v00x-template-mk.git
synced 2026-10-11 02:09:00 +03:00
moved platform specific files to folder
This commit is contained in:
parent
770694a42c
commit
c036856290
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,3 +2,4 @@
|
||||
compile_commands.json
|
||||
build
|
||||
obj
|
||||
asm
|
||||
1
Makefile
1
Makefile
@ -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
|
||||
|
||||
@ -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 $@
|
||||
@ -1,4 +1,4 @@
|
||||
#include "debug.h"
|
||||
#include "../platform/ch32v00x/debug.h"
|
||||
|
||||
int main(void) {
|
||||
GPIO_InitTypeDef GPIO_InitStructure = {0};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user