diff options
Diffstat (limited to 'tmk_core/chibios.mk')
-rw-r--r-- | tmk_core/chibios.mk | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/tmk_core/chibios.mk b/tmk_core/chibios.mk index c938eaeb90..c804d237e2 100644 --- a/tmk_core/chibios.mk +++ b/tmk_core/chibios.mk @@ -46,13 +46,32 @@ endif include $(PLATFORM_MK) -BOARD_MK = $(KEYBOARD_PATH)/boards/$(BOARD)/board.mk +BOARD_MK := + +ifneq ("$(wildcard $(KEYBOARD_PATH_5)/boards/$(BOARD)/board.mk)","") + BOARD_PATH = $(KEYBOARD_PATH_5) + BOARD_MK += $(KEYBOARD_PATH_5)/boards/$(BOARD)/board.mk +else ifneq ("$(wildcard $(KEYBOARD_PATH_4)/boards/$(BOARD)/board.mk)","") + BOARD_PATH = $(KEYBOARD_PATH_4) + BOARD_MK += $(KEYBOARD_PATH_4)/boards/$(BOARD)/board.mk +else ifneq ("$(wildcard $(KEYBOARD_PATH_3)/boards/$(BOARD)/board.mk)","") + BOARD_PATH = $(KEYBOARD_PATH_3) + BOARD_MK += $(KEYBOARD_PATH_3)/boards/$(BOARD)/board.mk +else ifneq ("$(wildcard $(KEYBOARD_PATH_2)/boards/$(BOARD)/board.mk)","") + BOARD_PATH = $(KEYBOARD_PATH_2) + BOARD_MK += $(KEYBOARD_PATH_2)/boards/$(BOARD)/board.mk +else ifneq ("$(wildcard $(KEYBOARD_PATH_1)/boards/$(BOARD)/board.mk)","") + BOARD_PATH = $(KEYBOARD_PATH_1) + BOARD_MK += $(KEYBOARD_PATH_1)/boards/$(BOARD)/board.mk +endif + ifeq ("$(wildcard $(BOARD_MK))","") BOARD_MK = $(CHIBIOS)/os/hal/boards/$(BOARD)/board.mk ifeq ("$(wildcard $(BOARD_MK))","") BOARD_MK = $(CHIBIOS_CONTRIB)/os/hal/boards/$(BOARD)/board.mk endif endif + include $(BOARD_MK) include $(CHIBIOS)/os/hal/osal/rt/osal.mk # RTOS files (optional). @@ -72,10 +91,18 @@ RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC endif # Define linker script file here -ifneq ("$(wildcard $(KEYBOARD_PATH)/ld/$(MCU_LDSCRIPT).ld)","") -LDSCRIPT = $(KEYBOARD_PATH)/ld/$(MCU_LDSCRIPT).ld +ifneq ("$(wildcard $(KEYBOARD_PATH_5)/ld/$(MCU_LDSCRIPT).ld)","") + LDSCRIPT = $(KEYBOARD_PATH_5)/ld/$(MCU_LDSCRIPT).ld +else ifneq ("$(wildcard $(KEYBOARD_PATH_4)/ld/$(MCU_LDSCRIPT).ld)","") + LDSCRIPT = $(KEYBOARD_PATH_4)/ld/$(MCU_LDSCRIPT).ld +else ifneq ("$(wildcard $(KEYBOARD_PATH_3)/ld/$(MCU_LDSCRIPT).ld)","") + LDSCRIPT = $(KEYBOARD_PATH_3)/ld/$(MCU_LDSCRIPT).ld +else ifneq ("$(wildcard $(KEYBOARD_PATH_2)/ld/$(MCU_LDSCRIPT).ld)","") + LDSCRIPT = $(KEYBOARD_PATH_2)/ld/$(MCU_LDSCRIPT).ld +else ifneq ("$(wildcard $(KEYBOARD_PATH_1)/ld/$(MCU_LDSCRIPT).ld)","") + LDSCRIPT = $(KEYBOARD_PATH_1)/ld/$(MCU_LDSCRIPT).ld else -LDSCRIPT = $(STARTUPLD)/$(MCU_LDSCRIPT).ld + LDSCRIPT = $(STARTUPLD)/$(MCU_LDSCRIPT).ld endif CHIBISRC = $(STARTUPSRC) \ |