diff options
author | Joel Challis <git@zvecr.com> | 2020-03-22 09:48:17 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-22 20:48:17 +1100 |
commit | d8f3c28a3786e7888fe3157c173845107c3ccc95 (patch) | |
tree | ae89818914169b118b7a8f6b09fa3d51c509176f /tmk_core | |
parent | eef0cb2f908d6b6e1a7b67414b95a877b7df0ebb (diff) | |
download | qmk_firmware-d8f3c28a3786e7888fe3157c173845107c3ccc95.tar.gz |
Align some ChibiOS build logic (#8461)
* Align some ChibiOS build logic
* infer more makefile logic
* Move bootloader logic to chibios file
Diffstat (limited to 'tmk_core')
-rw-r--r-- | tmk_core/chibios.mk | 29 | ||||
-rw-r--r-- | tmk_core/common.mk | 5 |
2 files changed, 29 insertions, 5 deletions
diff --git a/tmk_core/chibios.mk b/tmk_core/chibios.mk index b400e9e0f..f3b4b399c 100644 --- a/tmk_core/chibios.mk +++ b/tmk_core/chibios.mk @@ -24,6 +24,7 @@ endif # # Imported source files and paths +OPT_OS = chibios CHIBIOS = $(TOP_DIR)/lib/chibios CHIBIOS_CONTRIB = $(TOP_DIR)/lib/chibios-contrib # Startup files. Try a few different locations, for compability with old versions and @@ -49,6 +50,34 @@ PLATFORM_MK = $(CHIBIOS_CONTRIB)/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)/$(PLAT endif include $(PLATFORM_MK) +# Bootloader address +ifdef STM32_BOOTLOADER_ADDRESS + OPT_DEFS += -DSTM32_BOOTLOADER_ADDRESS=$(STM32_BOOTLOADER_ADDRESS) +endif + +ifneq ("$(wildcard $(KEYBOARD_PATH_5)/bootloader_defs.h)","") + OPT_DEFS += -include $(KEYBOARD_PATH_5)/bootloader_defs.h +else ifneq ("$(wildcard $(KEYBOARD_PATH_5)/boards/$(BOARD)/bootloader_defs.h)","") + OPT_DEFS += -include $(KEYBOARD_PATH_5)/boards/$(BOARD)/bootloader_defs.h +else ifneq ("$(wildcard $(KEYBOARD_PATH_4)/bootloader_defs.h)","") + OPT_DEFS += -include $(KEYBOARD_PATH_4)/bootloader_defs.h +else ifneq ("$(wildcard $(KEYBOARD_PATH_4)/boards/$(BOARD)/bootloader_defs.h)","") + OPT_DEFS += -include $(KEYBOARD_PATH_4)/boards/$(BOARD)/bootloader_defs.h +else ifneq ("$(wildcard $(KEYBOARD_PATH_3)/bootloader_defs.h)","") + OPT_DEFS += -include $(KEYBOARD_PATH_3)/bootloader_defs.h +else ifneq ("$(wildcard $(KEYBOARD_PATH_3)/boards/$(BOARD)/bootloader_defs.h)","") + OPT_DEFS += -include $(KEYBOARD_PATH_3)/boards/$(BOARD)/bootloader_defs.h +else ifneq ("$(wildcard $(KEYBOARD_PATH_2)/bootloader_defs.h)","") + OPT_DEFS += -include $(KEYBOARD_PATH_2)/bootloader_defs.h +else ifneq ("$(wildcard $(KEYBOARD_PATH_2)/boards/$(BOARD)/bootloader_defs.h)","") + OPT_DEFS += -include $(KEYBOARD_PATH_2)/boards/$(BOARD)/bootloader_defs.h +else ifneq ("$(wildcard $(KEYBOARD_PATH_1)/bootloader_defs.h)","") + OPT_DEFS += -include $(KEYBOARD_PATH_1)/bootloader_defs.h +else ifneq ("$(wildcard $(KEYBOARD_PATH_1)/boards/$(BOARD)/bootloader_defs.h)","") + OPT_DEFS += -include $(KEYBOARD_PATH_1)/boards/$(BOARD)/bootloader_defs.h +else ifneq ("$(wildcard $(TOP_DIR)/drivers/boards/$(BOARD)/bootloader_defs.h)","") + OPT_DEFS += -include $(TOP_DIR)/drivers/boards/$(BOARD)/bootloader_defs.h +endif BOARD_MK := diff --git a/tmk_core/common.mk b/tmk_core/common.mk index 3cc72a845..4d4272d26 100644 --- a/tmk_core/common.mk +++ b/tmk_core/common.mk @@ -166,11 +166,6 @@ ifeq ($(strip $(LINK_TIME_OPTIMIZATION_ENABLE)), yes) TMK_COMMON_DEFS += -DNO_ACTION_FUNCTION endif -# Bootloader address -ifdef STM32_BOOTLOADER_ADDRESS - TMK_COMMON_DEFS += -DSTM32_BOOTLOADER_ADDRESS=$(STM32_BOOTLOADER_ADDRESS) -endif - # Search Path VPATH += $(TMK_PATH)/$(COMMON_DIR) VPATH += $(TMK_PATH)/$(PLATFORM_COMMON_DIR) |