-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
80 lines (58 loc) · 1.77 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
##### Project #####
PROJECT ?= app
# The path for generated files
BUILD_DIR = Build
##### Options #####
# Include NetLib, y:yes, n:no
USE_NET_LIB ?= n
# Build with FreeRTOS, y:yes, n:no
USE_FREERTOS ?= n
##### Toolchains #######
#GCC_TOOCHAIN ?= /opt/gcc-riscv/xpack-riscv-none-embed-gcc-10.2.0-1.2/bin
#GCC_TOOCHAIN ?= /opt/gcc-riscv/xpack-riscv-none-elf-gcc-12.2.0-3/bin
#GCC_TOOCHAIN ?= /opt/gcc-riscv/riscv-wch-embedded-gcc-v1.60/bin
GCC_TOOCHAIN ?= /opt/gcc-riscv/riscv-wch-embedded-gcc-v1.70/bin
# riscv-none-embed- or riscv-none-elf-
GCC_PREFIX ?= riscv-none-embed-
OPENOCD_PATH ?= /opt/openocd/wch-openocd-v1.70/bin
##### Paths ############
LDSCRIPT = Libraries/Ld/Link.ld
OPENOCD_CFG = Misc/wch-riscv.cfg.v1.70
# CH32V203: CH32V20x_D6
# CH32V203RB: CH32V20x_D8
# CH32V208: CH32V20x_D8W
LIB_FLAGS = CH32V20x_D8W
# C source folders
CDIRS := User \
Libraries/Core \
Libraries/Debug \
Libraries/Peripheral/src
# C source files (if there are any single ones)
CFILES :=
# ASM source folders
ADIRS := User
# ASM single files
AFILES := Libraries/Startup/startup_ch32v20x_D8W.S
LIBS :=
# Include paths
INCLUDES := User \
Libraries/Core \
Libraries/Debug \
Libraries/NetLib \
Libraries/Peripheral/inc
##### Optional Libraries ############
ifeq ($(USE_NET_LIB),y)
CDIRS += Libraries/NetLib
INCLUDES += Libraries/NetLib
LIBS += Libraries/NetLib/libwchnet.a
endif
ifeq ($(USE_FREERTOS),y)
ADIRS += Libraries/FreeRTOS/portable/GCC/RISC-V
CDIRS += Libraries/FreeRTOS \
Libraries/FreeRTOS/portable/GCC/RISC-V
CFILES += Libraries/FreeRTOS/portable/MemMang/heap_4.c
INCLUDES += Libraries/FreeRTOS/include \
Libraries/FreeRTOS/portable/GCC/RISC-V \
Libraries/FreeRTOS/portable/GCC/RISC-V/chip_specific_extensions/RV32I_PFIC_no_extensions
endif
include ./rules.mk