1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-24 16:55:36 +03:00

Cleanup make (#12179)

* Cleanup Makefiles

Given the targets are now simply the MCU, there is now a significant amount of duplication.

TODO:
- will possibly add STM32.mk for inclusion from STM32F4 etc to remove further duplication.

Noting it is now imperative that the gating is right.

* Removed the remnants of "features"

* Further clean up in preparation of new MCUs

* Typo for STM32F722xx

* Fix F411

* Last remnants of the _TARGETS lists.
This commit is contained in:
J Blackman 2023-01-29 11:51:06 +11:00 committed by GitHub
parent d9264045b3
commit ecdbba2ce2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 152 additions and 580 deletions

View file

@ -110,40 +110,28 @@ INCLUDE_DIRS := $(INCLUDE_DIRS) \
$(ROOT)/lib/main/STM32F7/Drivers/CMSIS/Device/ST/STM32F7xx/Include \
$(ROOT)/src/main/vcp_hal
ifneq ($(filter SDCARD_SPI,$(FEATURES)),)
INCLUDE_DIRS := $(INCLUDE_DIRS) \
$(FATFS_DIR)
VPATH := $(VPATH):$(FATFS_DIR)
endif
ifneq ($(filter SDCARD_SDIO,$(FEATURES)),)
INCLUDE_DIRS := $(INCLUDE_DIRS) \
$(FATFS_DIR)
VPATH := $(VPATH):$(FATFS_DIR)
endif
#Flags
ARCH_FLAGS = -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-sp-d16 -fsingle-precision-constant
# Flags that are used in the STM32 libraries
DEVICE_FLAGS = -DUSE_HAL_DRIVER -DUSE_FULL_LL_DRIVER
ifeq ($(TARGET),$(filter $(TARGET),$(F7X5XI_TARGETS)))
ifeq ($(TARGET_MCU),STM32F765xx)
DEVICE_FLAGS += -DSTM32F765xx
LD_SCRIPT = $(LINKER_DIR)/stm32_flash_f765.ld
STARTUP_SRC = startup_stm32f765xx.s
MCU_FLASH_SIZE := 2048
else ifeq ($(TARGET),$(filter $(TARGET),$(F7X5XG_TARGETS)))
else ifeq ($(TARGET_MCU),STM32F745xx)
DEVICE_FLAGS += -DSTM32F745xx
LD_SCRIPT = $(LINKER_DIR)/stm32_flash_f74x.ld
STARTUP_SRC = startup_stm32f745xx.s
MCU_FLASH_SIZE := 1024
else ifeq ($(TARGET),$(filter $(TARGET),$(F7X6XG_TARGETS)))
else ifeq ($(TARGET_MCU),STM32F746xx)
DEVICE_FLAGS += -DSTM32F746xx
LD_SCRIPT = $(LINKER_DIR)/stm32_flash_f74x.ld
STARTUP_SRC = startup_stm32f746xx.s
MCU_FLASH_SIZE := 1024
else ifeq ($(TARGET),$(filter $(TARGET),$(F7X2RE_TARGETS)))
else ifeq ($(TARGET_MCU),STM32F722xx)
DEVICE_FLAGS += -DSTM32F722xx
ifndef LD_SCRIPT
LD_SCRIPT = $(LINKER_DIR)/stm32_flash_f722.ld
@ -158,8 +146,6 @@ $(error Unknown MCU for F7 target)
endif
DEVICE_FLAGS += -DHSE_VALUE=$(HSE_VALUE)
TARGET_FLAGS = -D$(TARGET)
VCP_SRC = \
vcp_hal/usbd_desc.c \
vcp_hal/usbd_conf_stm32f7xx.c \
@ -190,7 +176,8 @@ MCU_COMMON_SRC = \
drivers/timer_stm32f7xx.c \
drivers/system_stm32f7xx.c \
drivers/serial_uart_hal.c \
drivers/serial_uart_stm32f7xx.c
drivers/serial_uart_stm32f7xx.c \
drivers/sdio_f7xx.c
MCU_EXCLUDES = \
drivers/bus_i2c.c \
@ -199,26 +186,12 @@ MCU_EXCLUDES = \
MSC_SRC = \
drivers/usb_msc_common.c \
drivers/usb_msc_f7xx.c \
msc/usbd_storage.c
ifneq ($(filter SDCARD_SDIO,$(FEATURES)),)
MCU_COMMON_SRC += \
drivers/sdio_f7xx.c
MSC_SRC += \
msc/usbd_storage_sdio.c
endif
ifneq ($(filter SDCARD_SPI,$(FEATURES)),)
MSC_SRC += \
msc/usbd_storage_sd_spi.c
endif
ifneq ($(filter ONBOARDFLASH,$(FEATURES)),)
MSC_SRC += \
msc/usbd_storage.c \
msc/usbd_storage_emfat.c \
msc/emfat.c \
msc/emfat_file.c
endif
msc/emfat_file.c \
msc/usbd_storage_sdio.c \
msc/usbd_storage_sd_spi.c
DSP_LIB := $(ROOT)/lib/main/CMSIS/DSP
DEVICE_FLAGS += -DARM_MATH_MATRIX_CHECK -DARM_MATH_ROUNDING -D__FPU_PRESENT=1 -DUNALIGNED_SUPPORT_DISABLE -DARM_MATH_CM7