-
Notifications
You must be signed in to change notification settings - Fork 130
/
f415makefile.mk
45 lines (31 loc) · 1.11 KB
/
f415makefile.mk
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
MCU := F415
PART := AT32F415K8U7_4
MCU_LC := $(call lc,$(MCU))
TARGETS_$(MCU) := $(call get_targets,$(MCU))
HAL_FOLDER_$(MCU) := $(HAL_FOLDER)/$(MCU_LC)
MCU_$(MCU) := -mcpu=cortex-m4 -mthumb
LDSCRIPT_$(MCU) := $(HAL_FOLDER_$(MCU))/ldscript.ld
SRC_BASE_DIR_$(MCU) := \
$(HAL_FOLDER_$(MCU))/Startup \
$(HAL_FOLDER_$(MCU))/Drivers/drivers/src
SRC_DIR_$(MCU) := $(SRC_BASE_DIR_$(MCU)) \
$(HAL_FOLDER_$(MCU))/Src
CFLAGS_$(MCU) := \
-I$(HAL_FOLDER_$(MCU))/Inc \
-I$(HAL_FOLDER_$(MCU))/Drivers/drivers/inc \
-I$(HAL_FOLDER_$(MCU))/Drivers/CMSIS/cm4/core_support \
-I$(HAL_FOLDER_$(MCU))/Drivers/CMSIS/cm4/device_support
CFLAGS_$(MCU) += \
-D$(PART) \
-DUSE_STDPERIPH_DRIVER
SRC_$(MCU) := $(foreach dir,$(SRC_DIR_$(MCU)),$(wildcard $(dir)/*.[cs]))
# optional CAN support
CFLAGS_CAN_$(MCU) = \
-ISrc/DroneCAN \
-ISrc/DroneCAN/libcanard \
-ISrc/DroneCAN/dsdl_generated/include
SRC_DIR_CAN_$(MCU) = Src/DroneCAN \
Src/DroneCAN/dsdl_generated/src \
Src/DroneCAN/libcanard
SRC_CAN_$(MCU) := $(foreach dir,$(SRC_DIR_CAN_$(MCU)),$(wildcard $(dir)/*.[cs]))
LDSCRIPT_CAN_$(MCU) := $(HAL_FOLDER_$(MCU))/ldscript_CAN.ld