-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
90 lines (69 loc) · 2.67 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
81
82
83
84
85
86
87
88
89
90
##### Project #####
PROJECT ?= app
BUILD_DIR = Build
##### Options #####
# Enable printf float %f support, y:yes, n:no
ENABLE_PRINTF_FLOAT ?= y
# Build with CMSIS DSP functions, y:yes, n:no
USE_DSP ?= y
# Build with FreeRTOS, y:yes, n:no
USE_FREERTOS ?= n
# Programmer, jlink or pyocd
FLASH_PROGRM ?= pyocd
##### Toolchains #######
#ARM_TOOCHAIN ?= /opt/gcc-arm/gcc-arm-11.2-2022.02-x86_64-arm-none-eabi/bin
#ARM_TOOCHAIN ?= /opt/gcc-arm/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-eabi/bin
ARM_TOOCHAIN ?= /opt/gcc-arm/arm-gnu-toolchain-12.2.mpacbti-bet1-x86_64-arm-none-eabi/bin
# path to JLinkExe
JLINKEXE ?= /opt/SEGGER/JLink/JLinkExe
JLINK_DEVICE ?= AT32F421C8T7
# path to PyOCD
PYOCD_EXE ?= pyocd
PYOCD_DEVICE ?= _at32f421c8t7
##### Paths ############
# Link descript file for this chip
LDSCRIPT = Libraries/cmsis/cm4/device_support/startup/gcc/linker/AT32F421x8_FLASH.ld
# Library build flags
LIB_FLAGS = USE_STDPERIPH_DRIVER AT32F421C8T7
# C source folders
CDIRS := User \
Libraries/cmsis/cm4/device_support \
Libraries/drivers/src \
Libraries/bsp/src
# C source files (if there are any single ones)
CFILES :=
# ASM source folders
ADIRS := User
# ASM single files
AFILES := Libraries/cmsis/cm4/device_support/startup/gcc/startup_at32f421.s
# Include paths
INCLUDES := User \
Libraries/cmsis/cm4/core_support \
Libraries/cmsis/cm4/device_support \
Libraries/drivers/inc \
Libraries/bsp/inc
ifeq ($(USE_FREERTOS),y)
CDIRS += Middlewares/FreeRTOS \
Middlewares/FreeRTOS/portable/GCC/ARM_CM3
CFILES += Middlewares/FreeRTOS/portable/MemMang/heap_4.c
INCLUDES += Middlewares/FreeRTOS/include \
Middlewares/FreeRTOS/portable/GCC/ARM_CM3
endif
ifeq ($(USE_DSP),y)
CFILES += Libraries/cmsis/dsp/Source/BasicMathFunctions/BasicMathFunctions.c \
Libraries/cmsis/dsp/Source/BayesFunctions/BayesFunctions.c \
Libraries/cmsis/dsp/Source/CommonTables/CommonTables.c \
Libraries/cmsis/dsp/Source/ComplexMathFunctions/ComplexMathFunctions.c \
Libraries/cmsis/dsp/Source/ControllerFunctions/ControllerFunctions.c \
Libraries/cmsis/dsp/Source/DistanceFunctions/DistanceFunctions.c \
Libraries/cmsis/dsp/Source/FastMathFunctions/FastMathFunctions.c \
Libraries/cmsis/dsp/Source/FilteringFunctions/FilteringFunctions.c \
Libraries/cmsis/dsp/Source/MatrixFunctions/MatrixFunctions.c \
Libraries/cmsis/dsp/Source/StatisticsFunctions/StatisticsFunctions.c \
Libraries/cmsis/dsp/Source/SupportFunctions/SupportFunctions.c \
Libraries/cmsis/dsp/Source/SVMFunctions/SVMFunctions.c \
Libraries/cmsis/dsp/Source/TransformFunctions/TransformFunctions.c
INCLUDES += Libraries/cmsis/dsp/PrivateInclude \
Libraries/cmsis/dsp/ComputeLibrary/Include
endif
include ./rules.mk