summaryrefslogtreecommitdiffstats
path: root/builddefs/build_keyboard.mk
diff options
context:
space:
mode:
Diffstat (limited to 'builddefs/build_keyboard.mk')
-rw-r--r--builddefs/build_keyboard.mk39
1 files changed, 8 insertions, 31 deletions
diff --git a/builddefs/build_keyboard.mk b/builddefs/build_keyboard.mk
index 28389f3cfc..7a5412ccd2 100644
--- a/builddefs/build_keyboard.mk
+++ b/builddefs/build_keyboard.mk
@@ -183,7 +183,14 @@ endif
include $(BUILDDEFS_PATH)/converters.mk
-include $(BUILDDEFS_PATH)/mcu_selection.mk
+MCU_ORIG := $(MCU)
+include $(wildcard $(PLATFORM_PATH)/*/mcu_selection.mk)
+
+# PLATFORM_KEY should be detected in info.json via key 'processor' (or rules.mk 'MCU')
+ifeq ($(PLATFORM_KEY),)
+ $(call CATASTROPHIC_ERROR,Platform not defined)
+endif
+PLATFORM=$(shell echo $(PLATFORM_KEY) | tr '[:lower:]' '[:upper:]')
# Find all the C source files to be compiled in subfolders.
KEYBOARD_SRC :=
@@ -258,24 +265,6 @@ ifneq ("$(wildcard $(KEYBOARD_PATH_5)/$(KEYBOARD_FOLDER_5).h)","")
FOUND_KEYBOARD_H = $(KEYBOARD_FOLDER_5).h
endif
-# Determine and set parameters based on the keyboard's processor family.
-# We can assume a ChibiOS target When MCU_FAMILY is defined since it's
-# not used for LUFA
-ifdef MCU_FAMILY
- PLATFORM=CHIBIOS
- PLATFORM_KEY=chibios
- FIRMWARE_FORMAT?=bin
- OPT_DEFS += -DMCU_$(MCU_FAMILY)
-else ifdef ARM_ATSAM
- PLATFORM=ARM_ATSAM
- PLATFORM_KEY=arm_atsam
- FIRMWARE_FORMAT=bin
-else
- PLATFORM=AVR
- PLATFORM_KEY=avr
- FIRMWARE_FORMAT?=hex
-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)","")
@@ -434,13 +423,6 @@ SRC += $(TMK_COMMON_SRC)
OPT_DEFS += $(TMK_COMMON_DEFS)
EXTRALDFLAGS += $(TMK_COMMON_LDFLAGS)
-SKIP_COMPILE := no
-ifneq ($(REQUIRE_PLATFORM_KEY),)
- ifneq ($(REQUIRE_PLATFORM_KEY),$(PLATFORM_KEY))
- SKIP_COMPILE := yes
- endif
-endif
-
-include $(PLATFORM_PATH)/$(PLATFORM_KEY)/bootloader.mk
include $(PLATFORM_PATH)/$(PLATFORM_KEY)/platform.mk
-include $(PLATFORM_PATH)/$(PLATFORM_KEY)/flash.mk
@@ -480,12 +462,7 @@ $(KEYBOARD_OUTPUT)_INC := $(PROJECT_INC)
$(KEYBOARD_OUTPUT)_CONFIG := $(PROJECT_CONFIG)
# Default target.
-ifeq ($(SKIP_COMPILE),no)
all: build check-size
-else
-all:
- echo "skipped" >&2
-endif
build: elf cpfirmware
check-size: build