summaryrefslogtreecommitdiffstats
path: root/builddefs
diff options
context:
space:
mode:
Diffstat (limited to 'builddefs')
-rw-r--r--builddefs/build_full_test.mk2
-rw-r--r--builddefs/build_keyboard.mk36
-rw-r--r--builddefs/build_test.mk1
-rw-r--r--builddefs/common_features.mk8
-rw-r--r--builddefs/converters.mk24
-rw-r--r--builddefs/mcu_selection.mk12
-rw-r--r--builddefs/message.mk7
-rw-r--r--builddefs/testlist.mk1
8 files changed, 43 insertions, 48 deletions
diff --git a/builddefs/build_full_test.mk b/builddefs/build_full_test.mk
index 35f0a05b99..964ba773d4 100644
--- a/builddefs/build_full_test.mk
+++ b/builddefs/build_full_test.mk
@@ -24,6 +24,8 @@ $(TEST)_SRC := \
tests/test_common/matrix.c \
tests/test_common/test_driver.cpp \
tests/test_common/keyboard_report_util.cpp \
+ tests/test_common/keycode_util.cpp \
+ tests/test_common/keycode_table.cpp \
tests/test_common/test_fixture.cpp \
tests/test_common/test_keymap_key.cpp \
tests/test_common/test_logger.cpp \
diff --git a/builddefs/build_keyboard.mk b/builddefs/build_keyboard.mk
index 8999ac80ad..6d355c9b85 100644
--- a/builddefs/build_keyboard.mk
+++ b/builddefs/build_keyboard.mk
@@ -184,6 +184,12 @@ include $(BUILDDEFS_PATH)/converters.mk
include $(BUILDDEFS_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 :=
@@ -257,24 +263,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)","")
@@ -433,13 +421,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
@@ -479,12 +460,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
diff --git a/builddefs/build_test.mk b/builddefs/build_test.mk
index 7c8fdd20e5..4230598373 100644
--- a/builddefs/build_test.mk
+++ b/builddefs/build_test.mk
@@ -62,6 +62,7 @@ include $(PLATFORM_PATH)/common.mk
include $(TMK_PATH)/protocol.mk
include $(QUANTUM_PATH)/debounce/tests/rules.mk
include $(QUANTUM_PATH)/encoder/tests/rules.mk
+include $(QUANTUM_PATH)/os_detection/tests/rules.mk
include $(QUANTUM_PATH)/sequencer/tests/rules.mk
include $(QUANTUM_PATH)/wear_leveling/tests/rules.mk
include $(QUANTUM_PATH)/logging/print.mk
diff --git a/builddefs/common_features.mk b/builddefs/common_features.mk
index d9130b5338..dbcfcb7145 100644
--- a/builddefs/common_features.mk
+++ b/builddefs/common_features.mk
@@ -907,3 +907,11 @@ ifeq ($(strip $(ENCODER_ENABLE)), yes)
OPT_DEFS += -DENCODER_MAP_ENABLE
endif
endif
+
+ifeq ($(strip $(OS_DETECTION_ENABLE)), yes)
+ SRC += $(QUANTUM_DIR)/os_detection.c
+ OPT_DEFS += -DOS_DETECTION_ENABLE
+ ifeq ($(strip $(OS_DETECTION_DEBUG_ENABLE)), yes)
+ OPT_DEFS += -DOS_DETECTION_DEBUG_ENABLE
+ endif
+endif
diff --git a/builddefs/converters.mk b/builddefs/converters.mk
index c7e499226c..17b1c3b6ee 100644
--- a/builddefs/converters.mk
+++ b/builddefs/converters.mk
@@ -1,30 +1,25 @@
# Note for new boards -- CTPC and CONVERT_TO_PROTON_C are deprecated terms
# and should not be replicated for new boards. These will be removed from
# documentation as well as existing keymaps in due course.
-ifeq ($(strip $(CTPC)), yes)
- CONVERT_TO_PROTON_C=yes
-endif
-ifeq ($(strip $(CONVERT_TO_PROTON_C)), yes)
- CONVERT_TO=proton_c
-
-cpfirmware: ctpc_warning
-.INTERMEDIATE: ctpc_warning
-ctpc_warning: elf
- $(info @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@)
- $(info The `CONVERT_TO_PROTON_C` and `CTPC` options are soon to be deprecated.)
- $(info Boards should be changed to use `CONVERT_TO=proton_c` instead.)
- $(info @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@)
+ifneq ($(findstring yes, $(CTPC)$(CONVERT_TO_PROTON_C)),)
+$(call CATASTROPHIC_ERROR,The `CONVERT_TO_PROTON_C` and `CTPC` options are now deprecated. `CONVERT_TO=proton_c` should be used instead.)
endif
# TODO: opt in rather than assume everything uses a pro micro
PIN_COMPATIBLE ?= promicro
ifneq ($(CONVERT_TO),)
+ # stash so we can overwrite env provided vars if needed
+ ACTIVE_CONVERTER=$(CONVERT_TO)
+
# glob to search each platfrorm and/or check for valid converter
CONVERTER := $(wildcard $(PLATFORM_PATH)/*/converters/$(PIN_COMPATIBLE)_to_$(CONVERT_TO)/)
ifeq ($(CONVERTER),)
$(call CATASTROPHIC_ERROR,Converting from '$(PIN_COMPATIBLE)' to '$(CONVERT_TO)' not possible!)
endif
+ -include $(CONVERTER)/pre_converter.mk
+
+ PLATFORM_KEY = $(shell echo $(CONVERTER) | cut -d "/" -f2)
TARGET := $(TARGET)_$(CONVERT_TO)
# Configure any defaults
@@ -33,6 +28,9 @@ ifneq ($(CONVERT_TO),)
OPT_DEFS += -DCONVERTER_ENABLED
VPATH += $(CONVERTER)
+ # Configure for "alias" - worst case it produces an idential define
+ OPT_DEFS += -DCONVERT_TO_$(strip $(shell echo $(ACTIVE_CONVERTER) | tr '[:lower:]' '[:upper:]'))
+
# Finally run any converter specific logic
include $(CONVERTER)/converter.mk
endif
diff --git a/builddefs/mcu_selection.mk b/builddefs/mcu_selection.mk
index 382d9571a4..1d05902fab 100644
--- a/builddefs/mcu_selection.mk
+++ b/builddefs/mcu_selection.mk
@@ -275,7 +275,11 @@ ifneq ($(findstring STM32F103, $(MCU)),)
# Linker script to use
# - it should exist either in <chibios>/os/common/startup/ARMCMx/compilers/GCC/ld/
# or <keyboard_dir>/ld/
- MCU_LDSCRIPT ?= STM32F103x8
+ ifeq ($(strip $(BOOTLOADER)), uf2boot)
+ MCU_LDSCRIPT ?= STM32F103xB_uf2boot
+ else
+ MCU_LDSCRIPT ?= STM32F103x8
+ endif
# Startup code to use
# - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
@@ -309,7 +313,11 @@ ifneq ($(findstring STM32F303, $(MCU)),)
# Linker script to use
# - it should exist either in <chibios>/os/common/startup/ARMCMx/compilers/GCC/ld/
# or <keyboard_dir>/ld/
- MCU_LDSCRIPT ?= STM32F303xC
+ ifeq ($(strip $(BOOTLOADER)), tinyuf2)
+ MCU_LDSCRIPT ?= STM32F303xC_tinyuf2
+ else
+ MCU_LDSCRIPT ?= STM32F303xC
+ endif
# Startup code to use
# - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
diff --git a/builddefs/message.mk b/builddefs/message.mk
index 07d0e07ce8..bf39554dab 100644
--- a/builddefs/message.mk
+++ b/builddefs/message.mk
@@ -64,9 +64,10 @@ MSG_ASSEMBLING = Assembling:
MSG_CLEANING = Cleaning project:
MSG_CREATING_LIBRARY = Creating library:
MSG_GENERATING = Generating:
+MSG_NOT_REPO = $(WARN_COLOR)WARNING:$(NO_COLOR) Target folder is not a git repo, you probably downloaded a zip file instead of cloning.\n\
+Please consider following $(BOLD)https://docs.qmk.fm/\#/newbs_getting_started$(NO_COLOR).\n\n
MSG_SUBMODULE_DIRTY = $(WARN_COLOR)WARNING:$(NO_COLOR) Some git submodules are out of date or modified.\n\
-Please consider running $(BOLD)make git-submodule$(NO_COLOR).\n\n
-MSG_NO_CMP = $(ERROR_COLOR)Error:$(NO_COLOR)$(BOLD) cmp command not found, please install diffutils\n$(NO_COLOR)
+Please consider running $(BOLD)qmk git-submodule$(NO_COLOR).\n\n
define GENERATE_MSG_MAKE_KB
MSG_MAKE_KB_ACTUAL := Making $$(KB_SP) with keymap $(BOLD)$$(CURRENT_KM)$(NO_COLOR)
@@ -106,4 +107,4 @@ MSG_BOOTLOADER_NOT_FOUND_QUICK_RETRY = $(MSG_BOOTLOADER_NOT_FOUND_BASE) Trying a
define CATASTROPHIC_ERROR
$(shell printf "\n * %-99s $(ERROR_STRING)\n" "$2" >&2)
$(error $1)
-endef \ No newline at end of file
+endef
diff --git a/builddefs/testlist.mk b/builddefs/testlist.mk
index 8a30a44972..74a794adcd 100644
--- a/builddefs/testlist.mk
+++ b/builddefs/testlist.mk
@@ -3,6 +3,7 @@ FULL_TESTS := $(notdir $(TEST_LIST))
include $(QUANTUM_PATH)/debounce/tests/testlist.mk
include $(QUANTUM_PATH)/encoder/tests/testlist.mk
+include $(QUANTUM_PATH)/os_detection/tests/testlist.mk
include $(QUANTUM_PATH)/sequencer/tests/testlist.mk
include $(QUANTUM_PATH)/wear_leveling/tests/testlist.mk
include $(PLATFORM_PATH)/test/testlist.mk