-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathf415makefile.mk
39 lines (29 loc) · 1.15 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
MCU := F415
PART := AT32F415K8U7_4
MCU_LC := $(call lc,$(MCU))
HAL_FOLDER_$(MCU) := $(HAL_FOLDER)/$(MCU_LC)
MCU_$(MCU) := -mcpu=cortex-m4 -mthumb
LDSCRIPT_$(MCU) := $(wildcard $(HAL_FOLDER_$(MCU))/*.ld)
SRC_BASE_DIR_$(MCU) := \
$(HAL_FOLDER_$(MCU))/Startup \
$(HAL_FOLDER_$(MCU))/Drivers/drivers/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) -DARTERY \
-DUSE_STDPERIPH_DRIVER
SRC_$(MCU) := $(foreach dir,$(SRC_DIR_$(MCU)),$(wildcard $(dir)/*.[cs]))
SRC_$(MCU)_BL := $(foreach dir,$(SRC_BASE_DIR_$(MCU)),$(wildcard $(dir)/*.[cs])) \
$(wildcard $(HAL_FOLDER_$(MCU))/Src/*.c)
# additional CFLAGS and source for DroneCAN
CFLAGS_DRONECAN_$(MCU) += \
-Ibootloader/DroneCAN \
-Ibootloader/DroneCAN/libcanard \
-Ibootloader/DroneCAN/dsdl_generated/include
SRC_DIR_DRONECAN_$(MCU) += bootloader/DroneCAN \
bootloader/DroneCAN/dsdl_generated/src \
bootloader/DroneCAN/libcanard
SRC_DRONECAN_$(MCU) := $(foreach dir,$(SRC_DIR_DRONECAN_$(MCU)),$(wildcard $(dir)/*.[cs]))