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 /build_keyboard.mk | |
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 'build_keyboard.mk')
-rw-r--r-- | build_keyboard.mk | 55 |
1 files changed, 8 insertions, 47 deletions
diff --git a/build_keyboard.mk b/build_keyboard.mk index bfadede37..410870487 100644 --- a/build_keyboard.mk +++ b/build_keyboard.mk @@ -244,34 +244,6 @@ else FIRMWARE_FORMAT?=hex endif -ifeq ($(PLATFORM),CHIBIOS) - include $(TMK_PATH)/chibios.mk - OPT_OS = chibios - 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 -endif - # Find all of the config.h files and add them to our CONFIG_H define. CONFIG_H := ifneq ("$(wildcard $(KEYBOARD_PATH_5)/config.h)","") @@ -307,11 +279,6 @@ ifneq ("$(wildcard $(KEYBOARD_PATH_5)/post_config.h)","") POST_CONFIG_H += $(KEYBOARD_PATH_5)/post_config.h endif -# Save the defines and includes here, so we don't include any keymap specific ones -PROJECT_DEFS := $(OPT_DEFS) -PROJECT_INC := $(VPATH) $(EXTRAINCDIRS) $(KEYBOARD_PATHS) -PROJECT_CONFIG := $(CONFIG_H) - # Userspace setup and definitions ifeq ("$(USER_NAME)","") USER_NAME := $(KEYMAP) @@ -357,23 +324,17 @@ SRC += $(TMK_COMMON_SRC) OPT_DEFS += $(TMK_COMMON_DEFS) EXTRALDFLAGS += $(TMK_COMMON_LDFLAGS) -ifeq ($(PLATFORM),AVR) -ifeq ($(strip $(PROTOCOL)), VUSB) - include $(TMK_PATH)/protocol/vusb.mk +include $(TMK_PATH)/$(PLATFORM_KEY).mk +ifneq ($(strip $(PROTOCOL)),) + include $(TMK_PATH)/protocol/$(strip $(shell echo $(PROTOCOL) | tr '[:upper:]' '[:lower:]')).mk else - include $(TMK_PATH)/protocol/lufa.mk -endif - include $(TMK_PATH)/avr.mk -endif - -ifeq ($(PLATFORM),ARM_ATSAM) - include $(TMK_PATH)/arm_atsam.mk - include $(TMK_PATH)/protocol/arm_atsam.mk + include $(TMK_PATH)/protocol/$(PLATFORM_KEY).mk endif -ifeq ($(PLATFORM),CHIBIOS) - include $(TMK_PATH)/protocol/chibios.mk -endif +# TODO: remove this bodge? +PROJECT_DEFS := $(OPT_DEFS) +PROJECT_INC := $(VPATH) $(EXTRAINCDIRS) $(KEYBOARD_PATHS) +PROJECT_CONFIG := $(CONFIG_H) ifeq ($(strip $(VISUALIZER_ENABLE)), yes) VISUALIZER_DIR = $(QUANTUM_DIR)/visualizer |