From 3442e216dcec3ce6c8ba1c755b0d647a7f384f01 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Mon, 15 Aug 2016 09:07:32 +0300 Subject: [PATCH] Move bootloader_defs include to build_keyboard Also fix it for subprojects --- build_keyboard.mk | 9 +++++++++ tmk_core/chibios.mk | 8 -------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/build_keyboard.mk b/build_keyboard.mk index a6b578efbc..e8d8f3572b 100644 --- a/build_keyboard.mk +++ b/build_keyboard.mk @@ -54,6 +54,15 @@ ifeq ($(PLATFORM),CHIBIOS) include $(TMK_PATH)/protocol/chibios.mk include $(TMK_PATH)/chibios.mk OPT_OS = chibios + ifneq ("$(wildcard $(SUBPROJECT_PATH)/bootloader_defs.h)","") + OPT_DEFS += -include $(SUBPROJECT_PATH)/bootloader_defs.h + else ifneq ("$(wildcard $(SUBPROJECT_PATH)/boards/$(BOARD)/bootloader_defs.h)","") + OPT_DEFS += -include $(SUBPROJECT_PATH)/boards/$(BOARD)/bootloader_defs.h + else ifneq ("$(wildcard $(KEYBOARD_PATH)/bootloader_defs.h)","") + OPT_DEFS += -include $(KEYBOARD_PATH)/bootloader_defs.h + else ifneq ("$(wildcard $(KEYBOARD_PATH)/boards/$(BOARD)/bootloader_defs.h)","") + OPT_DEFS += -include $(KEYBOARD_PATH)/boards/$(BOARD)/bootloader_defs.h + endif endif CONFIG_H = $(KEYBOARD_PATH)/config.h diff --git a/tmk_core/chibios.mk b/tmk_core/chibios.mk index b05d59ee89..062a712bd1 100644 --- a/tmk_core/chibios.mk +++ b/tmk_core/chibios.mk @@ -143,14 +143,6 @@ MCUFLAGS = -mcpu=$(MCU) DEBUG = gdb -# Define ASM defines here -# bootloader definitions may be used in the startup .s file -ifneq ("$(wildcard $(KEYBOARD_PATH)/bootloader_defs.h)","") - OPT_DEFS += -include $(KEYBOARD_PATH)/bootloader_defs.h -else ifneq ("$(wildcard $(KEYBOARD_PATH)/boards/$(BOARD)/bootloader_defs.h)","") - OPT_DEFS += -include $(KEYBOARD_PATH)/boards/$(BOARD)/bootloader_defs.h -endif - # List any extra directories to look for libraries here. EXTRALIBDIRS = $(RULESPATH)/ld