ifndef VERBOSE .SILENT: endif # Never run this makefile in parallel, as it could screw things up # It won't affect the submakes, so you still get the speedup from specifying -jx .NOTPARALLEL: # Allow the silent with lower caps to work the same way as upper caps ifdef silent SILENT = $(silent) endif ifdef SILENT SUB_IS_SILENT := $(SILENT) endif # We need to make sure that silent is always turned off at the top level # Otherwise the [OK], [ERROR] and [WARN] messages won't be displayed correctly override SILENT := false ifndef SUB_IS_SILENT ifndef SKIP_GIT QMK_VERSION := $(shell git describe --abbrev=0 --tags 2>/dev/null) endif ifneq ($(QMK_VERSION),) $(info QMK Firmware $(QMK_VERSION)) endif endif # avoid 'Entering|Leaving directory' messages MAKEFLAGS += --no-print-directory ON_ERROR := error_occurred=1 BREAK_ON_ERRORS = no STARTING_MAKEFILE := $(firstword $(MAKEFILE_LIST)) ROOT_MAKEFILE := $(lastword $(MAKEFILE_LIST)) ROOT_DIR := $(dir $(ROOT_MAKEFILE)) ifeq ($(ROOT_DIR),) ROOT_DIR := . endif ABS_STARTING_MAKEFILE := $(abspath $(STARTING_MAKEFILE)) ABS_ROOT_MAKEFILE := $(abspath $(ROOT_MAKEFILE)) ABS_STARTING_DIR := $(dir $(ABS_STARTING_MAKEFILE)) ABS_ROOT_DIR := $(dir $(ABS_ROOT_MAKEFILE)) STARTING_DIR := $(subst $(ABS_ROOT_DIR),,$(ABS_STARTING_DIR)) BUILD_DIR := $(ROOT_DIR)/.build TEST_DIR := $(BUILD_DIR)/test ERROR_FILE := $(BUILD_DIR)/error_occurred MAKEFILE_INCLUDED=yes # Helper function to process the newt element of a space separated path # It works a bit like the traditional functional head tail # so the CURRENT_PATH_ELEMENT will become the new head # and the PATH_ELEMENTS are the rest that are still unprocessed define NEXT_PATH_ELEMENT $$(eval CURRENT_PATH_ELEMENT := $$(firstword $$(PATH_ELEMENTS))) $$(eval PATH_ELEMENTS := $$(wordlist 2,9999,$$(PATH_ELEMENTS))) endef # We change the / to spaces so that we more easily can work with the elements # separately PATH_ELEMENTS := $(subst /, ,$(STARTING_DIR)) # Initialize the path elements list for further processing $(eval $(call NEXT_PATH_ELEMENT)) # This function sets the KEYBOARD; KEYMAP and SUBPROJECT to the correct # variables depending on which directory you stand in. # It's really a very simple if else chain, if you squint enough, # but the makefile syntax makes it very verbose. # If we are in a subfolder of keyboards # # *** No longer needed ** # # ifeq ($(CURRENT_PATH_ELEMENT),keyboards) # $(eval $(call NEXT_PATH_ELEMENT)) # KEYBOARD := $(CURRENT_PATH_ELEMENT) # $(eval $(call NEXT_PATH_ELEMENT)) # # If we are in a subfolder of keymaps, or in other words in a keymap # # folder # ifeq ($(CURRENT_PATH_ELEMENT),keymaps) # $(eval $(call NEXT_PATH_ELEMENT)) # KEYMAP := $(CURRENT_PATH_ELEMENT) # # else if we are not in the keyboard folder itself # else ifneq ($(CURRENT_PATH_ELEMENT),) # # the we can assume it's a subproject, as no other folders # # should have make files in them # SUBPROJECT := $(CURRENT_PATH_ELEMENT) # $(eval $(call NEXT_PATH_ELEMENT)) # # if we are inside a keymap folder of a subproject # ifeq ($(CURRENT_PATH_ELEMENT),keymaps) # $(eval $(call NEXT_PATH_ELEMENT)) # KEYMAP := $(CURRENT_PATH_ELEMENT) # endif # endif # endif define GET_KEYBOARDS ifndef ALT_GET_KEYBOARDS All_RULES_MK := $$(patsubst $(ROOT_DIR)/keyboards/%/rules.mk,%,$$(wildcard $(ROOT_DIR)/keyboards/*/rules.mk)) All_RULES_MK += $$(patsubst $(ROOT_DIR)/keyboards/%/rules.mk,%,$$(wildcard $(ROOT_DIR)/keyboards/*/*/rules.mk)) All_RULES_MK += $$(patsubst $(ROOT_DIR)/keyboards/%/rules.mk,%,$$(wildcard $(ROOT_DIR)/keyboards/*/*/*/rules.mk)) All_RULES_MK += $$(patsubst $(ROOT_DIR)/keyboards/%/rules.mk,%,$$(wildcard $(ROOT_DIR)/keyboards/*/*/*/*/rules.mk)) KEYMAPS_MK := $$(patsubst $(ROOT_DIR)/keyboards/%/rules.mk,%,$$(wildcard $(ROOT_DIR)/keyboards/*/keymaps/*/rules.mk)) KEYMAPS_MK += $$(patsubst $(ROOT_DIR)/keyboards/%/rules.mk,%,$$(wildcard $(ROOT_DIR)/keyboards/*/*/keymaps/*/rules.mk)) KEYMAPS_MK += $$(patsubst $(ROOT_DIR)/keyboards/%/rules.mk,%,$$(wildcard $(ROOT_DIR)/keyboards/*/*/*/keymaps/*/rules.mk)) KEYMAPS_MK += $$(p
config BUTTON_HOTPLUG
tristate "Button Hotplug driver"