diff options
Diffstat (limited to 'builddefs')
-rw-r--r-- | builddefs/build_keyboard.mk | 17 | ||||
-rw-r--r-- | builddefs/build_test.mk | 1 | ||||
-rw-r--r-- | builddefs/common_features.mk | 21 | ||||
-rw-r--r-- | builddefs/common_rules.mk | 10 | ||||
-rw-r--r-- | builddefs/docsgen/package.json | 2 | ||||
-rw-r--r-- | builddefs/docsgen/yarn.lock | 8 | ||||
-rw-r--r-- | builddefs/generic_features.mk | 1 | ||||
-rw-r--r-- | builddefs/support.mk | 11 |
8 files changed, 51 insertions, 20 deletions
diff --git a/builddefs/build_keyboard.mk b/builddefs/build_keyboard.mk index fb07042bb7..640dedc31e 100644 --- a/builddefs/build_keyboard.mk +++ b/builddefs/build_keyboard.mk @@ -11,6 +11,7 @@ endif .DEFAULT_GOAL := all include paths.mk +include $(BUILDDEFS_PATH)/support.mk include $(BUILDDEFS_PATH)/message.mk # Helper to add defines with a 'QMK_' prefix @@ -251,6 +252,9 @@ generated-files: $(INTERMEDIATE_OUTPUT)/src/config.h $(INTERMEDIATE_OUTPUT)/src/ endif # Community modules +COMMUNITY_RULES_MK = $(shell $(QMK_BIN) generate-community-modules-rules-mk -kb $(KEYBOARD) --quiet --escape --output $(INTERMEDIATE_OUTPUT)/src/community_rules.mk $(KEYMAP_JSON)) +include $(COMMUNITY_RULES_MK) + $(INTERMEDIATE_OUTPUT)/src/community_modules.h: $(KEYMAP_JSON) $(DD_CONFIG_FILES) @$(SILENT) || printf "$(MSG_GENERATING) $@" | $(AWK_CMD) $(eval CMD=$(QMK_BIN) generate-community-modules-h -kb $(KEYBOARD) --quiet --output $(INTERMEDIATE_OUTPUT)/src/community_modules.h $(KEYMAP_JSON)) @@ -271,10 +275,19 @@ $(INTERMEDIATE_OUTPUT)/src/community_modules_introspection.h: $(KEYMAP_JSON) $(D $(eval CMD=$(QMK_BIN) generate-community-modules-introspection-h -kb $(KEYBOARD) --quiet --output $(INTERMEDIATE_OUTPUT)/src/community_modules_introspection.h $(KEYMAP_JSON)) @$(BUILD_CMD) -SRC += $(INTERMEDIATE_OUTPUT)/src/community_modules.c +$(INTERMEDIATE_OUTPUT)/src/led_matrix_community_modules.inc: $(KEYMAP_JSON) $(DD_CONFIG_FILES) + @$(SILENT) || printf "$(MSG_GENERATING) $@" | $(AWK_CMD) + $(eval CMD=$(QMK_BIN) generate-led-matrix-community-modules-inc -kb $(KEYBOARD) --quiet --output $(INTERMEDIATE_OUTPUT)/src/led_matrix_community_modules.inc $(KEYMAP_JSON)) + @$(BUILD_CMD) -generated-files: $(INTERMEDIATE_OUTPUT)/src/community_modules.h $(INTERMEDIATE_OUTPUT)/src/community_modules.c $(INTERMEDIATE_OUTPUT)/src/community_modules_introspection.c $(INTERMEDIATE_OUTPUT)/src/community_modules_introspection.h +$(INTERMEDIATE_OUTPUT)/src/rgb_matrix_community_modules.inc: $(KEYMAP_JSON) $(DD_CONFIG_FILES) + @$(SILENT) || printf "$(MSG_GENERATING) $@" | $(AWK_CMD) + $(eval CMD=$(QMK_BIN) generate-rgb-matrix-community-modules-inc -kb $(KEYBOARD) --quiet --output $(INTERMEDIATE_OUTPUT)/src/rgb_matrix_community_modules.inc $(KEYMAP_JSON)) + @$(BUILD_CMD) + +SRC += $(INTERMEDIATE_OUTPUT)/src/community_modules.c +generated-files: $(INTERMEDIATE_OUTPUT)/src/community_modules.h $(INTERMEDIATE_OUTPUT)/src/community_modules.c $(INTERMEDIATE_OUTPUT)/src/community_modules_introspection.c $(INTERMEDIATE_OUTPUT)/src/community_modules_introspection.h $(INTERMEDIATE_OUTPUT)/src/led_matrix_community_modules.inc $(INTERMEDIATE_OUTPUT)/src/rgb_matrix_community_modules.inc include $(BUILDDEFS_PATH)/converters.mk diff --git a/builddefs/build_test.mk b/builddefs/build_test.mk index d0de63c6f5..0c5c98e2a3 100644 --- a/builddefs/build_test.mk +++ b/builddefs/build_test.mk @@ -7,6 +7,7 @@ endif OPT = g include paths.mk +include $(BUILDDEFS_PATH)/support.mk include $(BUILDDEFS_PATH)/message.mk TARGET=test/$(TEST_OUTPUT) diff --git a/builddefs/common_features.mk b/builddefs/common_features.mk index ec856715b0..90231c9a96 100644 --- a/builddefs/common_features.mk +++ b/builddefs/common_features.mk @@ -29,6 +29,8 @@ QUANTUM_SRC += \ $(QUANTUM_DIR)/logging/debug.c \ $(QUANTUM_DIR)/logging/sendchar.c \ $(QUANTUM_DIR)/process_keycode/process_default_layer.c \ + $(QUANTUM_DIR)/process_keycode/process_oneshot.c \ + $(QUANTUM_DIR)/process_keycode/process_quantum.c \ include $(QUANTUM_DIR)/nvm/rules.mk @@ -219,7 +221,7 @@ ifneq ($(strip $(EEPROM_DRIVER)),none) COMMON_VPATH += $(PLATFORM_PATH)/$(PLATFORM_KEY)/$(DRIVER_DIR)/flash COMMON_VPATH += $(DRIVER_PATH)/flash SRC += eeprom_driver.c eeprom_legacy_emulated_flash.c legacy_flash_ops.c - else ifneq ($(filter $(MCU_SERIES),STM32F1xx STM32F3xx STM32F4xx STM32L4xx STM32G4xx WB32F3G71xx WB32FQ95xx AT32F415 GD32VF103),) + else ifneq ($(filter $(MCU_SERIES),STM32F1xx STM32F3xx STM32F4xx STM32L4xx STM32G0xx STM32G4xx WB32F3G71xx WB32FQ95xx AT32F415 GD32VF103),) # Wear-leveling EEPROM implementation, backed by MCU flash OPT_DEFS += -DEEPROM_DRIVER -DEEPROM_WEAR_LEVELING SRC += eeprom_driver.c eeprom_wear_leveling.c @@ -267,18 +269,14 @@ ifneq ($(strip $(WEAR_LEVELING_DRIVER)),none) ifeq ($(strip $(WEAR_LEVELING_DRIVER)), embedded_flash) OPT_DEFS += -DHAL_USE_EFL SRC += wear_leveling_efl.c - POST_CONFIG_H += $(PLATFORM_PATH)/$(PLATFORM_KEY)/$(DRIVER_DIR)/wear_leveling/wear_leveling_efl_config.h else ifeq ($(strip $(WEAR_LEVELING_DRIVER)), spi_flash) FLASH_DRIVER := spi SRC += wear_leveling_flash_spi.c - POST_CONFIG_H += $(DRIVER_PATH)/wear_leveling/wear_leveling_flash_spi_config.h else ifeq ($(strip $(WEAR_LEVELING_DRIVER)), rp2040_flash) SRC += wear_leveling_rp2040_flash.c - POST_CONFIG_H += $(PLATFORM_PATH)/$(PLATFORM_KEY)/$(DRIVER_PATH)/wear_leveling/wear_leveling_rp2040_flash_config.h else ifeq ($(strip $(WEAR_LEVELING_DRIVER)), legacy) COMMON_VPATH += $(PLATFORM_PATH)/$(PLATFORM_KEY)/$(DRIVER_DIR)/flash SRC += legacy_flash_ops.c wear_leveling_legacy.c - POST_CONFIG_H += $(PLATFORM_PATH)/$(PLATFORM_KEY)/$(DRIVER_DIR)/wear_leveling/wear_leveling_legacy_config.h endif endif endif @@ -639,6 +637,11 @@ ifeq ($(strip $(VIA_ENABLE)), yes) TRI_LAYER_ENABLE := yes endif +ifeq ($(strip $(RAW_ENABLE)), yes) + OPT_DEFS += -DRAW_ENABLE + SRC += raw_hid.c +endif + ifeq ($(strip $(DYNAMIC_KEYMAP_ENABLE)), yes) SEND_STRING_ENABLE := yes endif @@ -721,6 +724,7 @@ ifeq ($(strip $(LIB8TION_ENABLE)), yes) # ATmegaxxU2 does not have hardware MUL instruction - lib8tion must be told to use software multiplication routines OPT_DEFS += -DLIB8_ATTINY endif + OPT_DEFS += -DFASTLED_SCALE8_FIXED=1 -DFASTLED_BLEND_FIXED=1 SRC += $(LIB_PATH)/lib8tion/lib8tion.c endif @@ -892,18 +896,19 @@ ifeq ($(strip $(BLUETOOTH_ENABLE)), yes) OPT_DEFS += -DBLUETOOTH_ENABLE OPT_DEFS += -DBLUETOOTH_$(strip $(shell echo $(BLUETOOTH_DRIVER) | tr '[:lower:]' '[:upper:]')) NO_USB_STARTUP_CHECK := yes + CONNECTION_ENABLE := yes COMMON_VPATH += $(DRIVER_PATH)/bluetooth - SRC += outputselect.c process_connection.c + SRC += $(DRIVER_PATH)/bluetooth/bluetooth.c ifeq ($(strip $(BLUETOOTH_DRIVER)), bluefruit_le) SPI_DRIVER_REQUIRED = yes - SRC += $(DRIVER_PATH)/bluetooth/bluetooth.c + SRC += $(DRIVER_PATH)/bluetooth/bluetooth_drivers.c SRC += $(DRIVER_PATH)/bluetooth/bluefruit_le.cpp endif ifeq ($(strip $(BLUETOOTH_DRIVER)), rn42) UART_DRIVER_REQUIRED = yes - SRC += $(DRIVER_PATH)/bluetooth/bluetooth.c + SRC += $(DRIVER_PATH)/bluetooth/bluetooth_drivers.c SRC += $(DRIVER_PATH)/bluetooth/rn42.c endif endif diff --git a/builddefs/common_rules.mk b/builddefs/common_rules.mk index e45063cfaf..d6f91b10e4 100644 --- a/builddefs/common_rules.mk +++ b/builddefs/common_rules.mk @@ -168,7 +168,7 @@ MOVE_DEP = mv -f $(patsubst %.o,%.td,$@) $(patsubst %.o,%.d,$@) # For a ChibiOS build, ensure that the board files have the hook overrides injected define BOARDSRC_INJECT_HOOKS -$(INTERMEDIATE_OUTPUT)/$(patsubst %.c,%.o,$(patsubst ./%,%,$1)): INIT_HOOK_CFLAGS += -include $(TOP_DIR)/tmk_core/protocol/chibios/init_hooks.h +$(INTERMEDIATE_OUTPUT)/$(patsubst %.c,%.o,$(patsubst ./%,%,$1)): FILE_SPECIFIC_CFLAGS += -include $(TOP_DIR)/tmk_core/protocol/chibios/init_hooks.h endef $(foreach LOBJ, $(BOARDSRC), $(eval $(call BOARDSRC_INJECT_HOOKS,$(LOBJ)))) @@ -289,10 +289,10 @@ $1/%.o : %.c $1/%.d $1/cflags.txt $1/compiler.txt | $(BEGIN) ifneq ($$(VERBOSE_C_INCLUDE),) $$(if $$(filter $$(notdir $$(VERBOSE_C_INCLUDE)),$$(notdir $$<)),$$(eval CC_EXEC += -H)) endif - $$(eval CMD := $$(CC_EXEC) -c $$($1_CFLAGS) $$(INIT_HOOK_CFLAGS) $$(GENDEPFLAGS) $$< -o $$@ && $$(MOVE_DEP)) + $$(eval CMD := $$(CC_EXEC) -c $$($1_CFLAGS) $$(FILE_SPECIFIC_CFLAGS) $$(GENDEPFLAGS) $$< -o $$@ && $$(MOVE_DEP)) @$$(BUILD_CMD) ifneq ($$(DUMP_C_MACROS),) - $$(eval CMD := $$(CC) -E -dM $$($1_CFLAGS) $$(INIT_HOOK_CFLAGS) $$(GENDEPFLAGS) $$<) + $$(eval CMD := $$(CC) -E -dM $$($1_CFLAGS) $$(FILE_SPECIFIC_CFLAGS) $$(GENDEPFLAGS) $$<) @$$(if $$(filter $$(notdir $$(DUMP_C_MACROS)),$$(notdir $$<)),$$(BUILD_CMD)) endif @@ -300,13 +300,13 @@ $1/%.o : %.c $1/%.d $1/cflags.txt $1/compiler.txt | $(BEGIN) $1/%.o : %.cpp $1/%.d $1/cxxflags.txt $1/compiler.txt | $(BEGIN) @mkdir -p $$(@D) @$$(SILENT) || printf "$$(MSG_COMPILING_CXX) $$<" | $$(AWK_CMD) - $$(eval CMD=$$(CC) -c $$($1_CXXFLAGS) $$(INIT_HOOK_CFLAGS) $$(GENDEPFLAGS) $$< -o $$@ && $$(MOVE_DEP)) + $$(eval CMD=$$(CC) -c $$($1_CXXFLAGS) $$(FILE_SPECIFIC_CFLAGS) $$(GENDEPFLAGS) $$< -o $$@ && $$(MOVE_DEP)) @$$(BUILD_CMD) $1/%.o : %.cc $1/%.d $1/cxxflags.txt $1/compiler.txt | $(BEGIN) @mkdir -p $$(@D) @$$(SILENT) || printf "$$(MSG_COMPILING_CXX) $$<" | $$(AWK_CMD) - $$(eval CMD=$$(CC) -c $$($1_CXXFLAGS) $$(INIT_HOOK_CFLAGS) $$(GENDEPFLAGS) $$< -o $$@ && $$(MOVE_DEP)) + $$(eval CMD=$$(CC) -c $$($1_CXXFLAGS) $$(FILE_SPECIFIC_CFLAGS) $$(GENDEPFLAGS) $$< -o $$@ && $$(MOVE_DEP)) @$$(BUILD_CMD) # Assemble: create object files from assembler source files. diff --git a/builddefs/docsgen/package.json b/builddefs/docsgen/package.json index a798207d77..69e229ae61 100644 --- a/builddefs/docsgen/package.json +++ b/builddefs/docsgen/package.json @@ -1,7 +1,7 @@ { "license": "GPL-2.0-or-later", "devDependencies": { - "vite": "^5.4.15", + "vite": "^5.4.19", "vitepress": "^1.1.0", "vitepress-plugin-tabs": "^0.5.0", "vue": "^3.4.24" diff --git a/builddefs/docsgen/yarn.lock b/builddefs/docsgen/yarn.lock index eda99772c4..8a8457eb8d 100644 --- a/builddefs/docsgen/yarn.lock +++ b/builddefs/docsgen/yarn.lock @@ -766,10 +766,10 @@ tabbable@^6.2.0: resolved "https://registry.yarnpkg.com/tabbable/-/tabbable-6.2.0.tgz#732fb62bc0175cfcec257330be187dcfba1f3b97" integrity sha512-Cat63mxsVJlzYvN51JmVXIgNoUokrIaT2zLclCXjRd8boZ0004U4KCs/sToJ75C6sdlByWxpYnb5Boif1VSFew== -vite@^5.2.9, vite@^5.4.15: - version "5.4.15" - resolved "https://registry.yarnpkg.com/vite/-/vite-5.4.15.tgz#2941547f10ebb4bf9b0fa0da863c06711eb7e5e5" - integrity sha512-6ANcZRivqL/4WtwPGTKNaosuNJr5tWiftOC7liM7G9+rMb8+oeJeyzymDu4rTN93seySBmbjSfsS3Vzr19KNtA== +vite@^5.2.9, vite@^5.4.19: + version "5.4.19" + resolved "https://registry.yarnpkg.com/vite/-/vite-5.4.19.tgz#20efd060410044b3ed555049418a5e7d1998f959" + integrity sha512-qO3aKv3HoQC8QKiNSTuUM1l9o/XX3+c+VTgLHbJWHZGeTPVAg2XwazI9UWzoxjIJCGCV2zU60uqMzjeLZuULqA== dependencies: esbuild "^0.21.3" postcss "^8.4.43" diff --git a/builddefs/generic_features.mk b/builddefs/generic_features.mk index d39727f23b..c826514431 100644 --- a/builddefs/generic_features.mk +++ b/builddefs/generic_features.mk @@ -25,6 +25,7 @@ GENERIC_FEATURES = \ CAPS_WORD \ COMBO \ COMMAND \ + CONNECTION \ CRC \ DEFERRED_EXEC \ DIGITIZER \ diff --git a/builddefs/support.mk b/builddefs/support.mk new file mode 100644 index 0000000000..7ef7b9b041 --- /dev/null +++ b/builddefs/support.mk @@ -0,0 +1,11 @@ +# Helper to determine if a compiler option is supported +# Args: +# $(1) = option to test, if successful will be output +# $(2) = option to use if $(1) is not supported +# $(3) = additional arguments to pass to the compiler during the test, but aren't contained in the output +cc-option = $(shell \ + if { echo 'int main(){return 0;}' | $(CC) $(1) $(3) -o /dev/null -x c /dev/null >/dev/null 2>&1; }; \ + then echo "$(1)"; else echo "$(2)"; fi) + +# Helper to pass comma character to make functions (use with `$(,)` to pass in `$(call ...)` arguments) +, := , |