diff options
Diffstat (limited to 'tmk_core')
-rw-r--r-- | tmk_core/chibios.mk | 35 | ||||
-rw-r--r-- | tmk_core/rules.mk | 2 |
2 files changed, 32 insertions, 5 deletions
diff --git a/tmk_core/chibios.mk b/tmk_core/chibios.mk index c938eaeb9..c804d237e 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) \ diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk index 73ffeaac1..53e79ef47 100644 --- a/tmk_core/rules.mk +++ b/tmk_core/rules.mk @@ -290,7 +290,7 @@ BEGIN = gccversion sizebefore define GEN_OBJRULE $1_INCFLAGS := $$(patsubst %,-I%,$$($1_INC)) ifdef $1_CONFIG -$1_CONFIG_FLAGS += -include $$($1_CONFIG) +$1_CONFIG_FLAGS += $$(patsubst %,-include %,$$($1_CONFIG)) endif $1_CFLAGS = $$(ALL_CFLAGS) $$($1_DEFS) $$($1_INCFLAGS) $$($1_CONFIG_FLAGS) $1_CPPFLAGS= $$(ALL_CPPFLAGS) $$($1_DEFS) $$($1_INCFLAGS) $$($1_CONFIG_FLAGS) |