From b0069c5c05dac2c910d51ef7f3bf4133721a9c49 Mon Sep 17 00:00:00 2001 From: Zach White Date: Sun, 7 Mar 2021 19:10:03 -0800 Subject: Begin the process of deprecating bin/qmk in favor of the global cli (#12109) * Begin the process of deprecating bin/qmk in favor of the global cli * Correctly set the qmk bin --- Makefile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 91ab9e4e8e..de0a2d4153 100644 --- a/Makefile +++ b/Makefile @@ -29,6 +29,13 @@ $(info QMK Firmware $(QMK_VERSION)) endif endif +# Determine which qmk cli to use +ifeq (, $(shell which qmk)) + QMK_BIN = bin/qmk +else + QMK_BIN = qmk +endif + # avoid 'Entering|Leaving directory' messages MAKEFLAGS += --no-print-directory @@ -501,8 +508,8 @@ endef %: # Check if we have the CMP tool installed cmp $(ROOT_DIR)/Makefile $(ROOT_DIR)/Makefile >/dev/null 2>&1; if [ $$? -gt 0 ]; then printf "$(MSG_NO_CMP)"; exit 1; fi; - # Ensure that bin/qmk works. - if ! bin/qmk hello 1> /dev/null 2>&1; then printf "$(MSG_PYTHON_MISSING)"; exit 1; fi + # Ensure that $(QMK_BIN) works. + if ! $(QMK_BIN) hello 1> /dev/null 2>&1; then printf "$(MSG_PYTHON_MISSING)"; exit 1; fi # Check if the submodules are dirty, and display a warning if they are ifndef SKIP_GIT if [ ! -e lib/chibios ]; then git submodule sync lib/chibios && git submodule update --depth 50 --init lib/chibios; fi -- cgit v1.2.3 From f2715a05939b749771d9826f9ad23b4cab280e82 Mon Sep 17 00:00:00 2001 From: Zach White Date: Thu, 18 Mar 2021 16:10:40 -0700 Subject: Consistently use bin/qmk when that script is called (#12286) * Pass QMK_BIN down to build_keyboard.mk * choose the correct qmk script --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index de0a2d4153..80e1a90a19 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ endif endif # Determine which qmk cli to use -ifeq (, $(shell which qmk)) +ifeq (,$(shell which qmk)) QMK_BIN = bin/qmk else QMK_BIN = qmk @@ -391,7 +391,7 @@ define PARSE_KEYMAP # Format it in bold KB_SP := $(BOLD)$$(KB_SP)$(NO_COLOR) # Specify the variables that we are passing forward to submake - MAKE_VARS := KEYBOARD=$$(CURRENT_KB) KEYMAP=$$(CURRENT_KM) REQUIRE_PLATFORM_KEY=$$(REQUIRE_PLATFORM_KEY) + MAKE_VARS := KEYBOARD=$$(CURRENT_KB) KEYMAP=$$(CURRENT_KM) REQUIRE_PLATFORM_KEY=$$(REQUIRE_PLATFORM_KEY) QMK_BIN=$$(QMK_BIN) # And the first part of the make command MAKE_CMD := $$(MAKE) -r -R -C $(ROOT_DIR) -f build_keyboard.mk $$(MAKE_TARGET) # The message to display -- cgit v1.2.3 From 64a0f5a659190518a9361e0bd2e8caff0b3354f1 Mon Sep 17 00:00:00 2001 From: Nick Brassel Date: Tue, 6 Apr 2021 16:39:15 +1000 Subject: Add support for producing UF2-format binaries. (#12435) * First stab at enabling builds of UF2-format binaries. * Add description on producing a UF2 file. --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 80e1a90a19..e007ae3679 100644 --- a/Makefile +++ b/Makefile @@ -93,8 +93,8 @@ clean: .PHONY: distclean distclean: clean - echo -n 'Deleting *.bin and *.hex ... ' - rm -f *.bin *.hex + echo -n 'Deleting *.bin, *.hex, and *.uf2 ... ' + rm -f *.bin *.hex *.uf2 echo 'done.' #Compatibility with the old make variables, anything you specify directly on the command line -- cgit v1.2.3 From bbe43a91ebf193bbc8c09ba59209b0524367e68c Mon Sep 17 00:00:00 2001 From: Ryan Date: Sun, 27 Jun 2021 02:29:02 +1000 Subject: CLI: Add subcommand to generate version.h (#13151) --- Makefile | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index e007ae3679..866bcaaf3f 100644 --- a/Makefile +++ b/Makefile @@ -548,29 +548,14 @@ git-submodule: git submodule sync --recursive git submodule update --init --recursive --progress -ifdef SKIP_VERSION -SKIP_GIT := yes -endif - # Generate the version.h file -ifndef SKIP_GIT - GIT_VERSION := $(shell git describe --abbrev=6 --dirty --always --tags 2>/dev/null || date +"%Y-%m-%d-%H:%M:%S") - CHIBIOS_VERSION := $(shell cd lib/chibios && git describe --abbrev=6 --dirty --always --tags 2>/dev/null || date +"%Y-%m-%d-%H:%M:%S") - CHIBIOS_CONTRIB_VERSION := $(shell cd lib/chibios-contrib && git describe --abbrev=6 --dirty --always --tags 2>/dev/null || date +"%Y-%m-%d-%H:%M:%S") -else - GIT_VERSION := NA - CHIBIOS_VERSION := NA - CHIBIOS_CONTRIB_VERSION := NA +ifdef SKIP_GIT +VERSION_H_FLAGS := --skip-git endif -ifndef SKIP_VERSION -BUILD_DATE := $(shell date +"%Y-%m-%d-%H:%M:%S") -else -BUILD_DATE := 2020-01-01-00:00:00 +ifdef SKIP_VERSION +VERSION_H_FLAGS := --skip-all +SKIP_GIT := yes endif - -$(shell echo '#define QMK_VERSION "$(GIT_VERSION)"' > $(ROOT_DIR)/quantum/version.h) -$(shell echo '#define QMK_BUILDDATE "$(BUILD_DATE)"' >> $(ROOT_DIR)/quantum/version.h) -$(shell echo '#define CHIBIOS_VERSION "$(CHIBIOS_VERSION)"' >> $(ROOT_DIR)/quantum/version.h) -$(shell echo '#define CHIBIOS_CONTRIB_VERSION "$(CHIBIOS_CONTRIB_VERSION)"' >> $(ROOT_DIR)/quantum/version.h) +$(shell $(QMK_BIN) generate-version-h $(VERSION_H_FLAGS) -q -o quantum/version.h) include $(ROOT_DIR)/testlist.mk -- cgit v1.2.3 From 491b83aa32e59be68387c25fcfa7bd6e7cb51479 Mon Sep 17 00:00:00 2001 From: Ryan Date: Wed, 28 Jul 2021 21:02:29 +1000 Subject: Update "make format" message (#13741) * Update "make format" message * Add examples for `qmk` command as well --- Makefile | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index e007ae3679..f91d95a12c 100644 --- a/Makefile +++ b/Makefile @@ -252,11 +252,20 @@ define PARSE_RULE else $$(info make: *** No rule to make target '$1'. Stop.) $$(info |) - $$(info | QMK's make format recently changed to use folder locations and colons:) - $$(info | make project_folder:keymap[:target]) - $$(info | Examples:) - $$(info | make dz60:default) - $$(info | make planck/rev6:default:flash) + $$(info | QMK's make format is:) + $$(info | make keyboard_folder:keymap_folder[:target]) + $$(info |) + $$(info | Where `keyboard_folder` is the path to the keyboard relative to) + $$(info | `qmk_firmware/keyboards/`, and `keymap_folder` is the name of the) + $$(info | keymap folder under that board's `keymaps/` directory.) + $$(info |) + $$(info | Examples:) + $$(info | keyboards/dz60, keyboards/dz60/keymaps/default) + $$(info | -> make dz60:default) + $$(info | -> qmk compile -kb dz60 -km default) + $$(info | keyboards/planck/rev6, keyboards/planck/keymaps/default) + $$(info | -> make planck/rev6:default:flash) + $$(info | -> qmk flash -kb planck/rev6 -km default) $$(info |) endif endef -- cgit v1.2.3 From 20f81af98af26d3e15277e402a364a513f986aa6 Mon Sep 17 00:00:00 2001 From: Zach White Date: Mon, 4 Oct 2021 09:26:19 -0700 Subject: Allow community layouts to be specified in info.json (#14682) * move the community layout detection to python * fixup tests --- Makefile | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index bb2201e852..5f25eef14b 100644 --- a/Makefile +++ b/Makefile @@ -303,37 +303,8 @@ define PARSE_KEYBOARD KEYMAPS += $$(notdir $$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_3)/keymaps/*/.))) KEYMAPS += $$(notdir $$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_4)/keymaps/*/.))) KEYMAPS += $$(notdir $$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_5)/keymaps/*/.))) - # this might be needed, but in a different form - #KEYMAPS := $$(sort $$(filter-out $$(KEYBOARD_FOLDER_1) $$(KEYBOARD_FOLDER_2) \ - $$(KEYBOARD_FOLDER_3) $$(KEYBOARD_FOLDER_4) $$(KEYBOARD_FOLDER_5), $$(KEYMAPS))) - - KEYBOARD_LAYOUTS := - ifneq ("$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_5)/rules.mk)","") - LAYOUTS := - $$(eval include $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_5)/rules.mk) - KEYBOARD_LAYOUTS := $$(sort $$(LAYOUTS) $$(KEYBOARD_LAYOUTS)) - endif - ifneq ("$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_4)/rules.mk)","") - LAYOUTS := - $$(eval include $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_4)/rules.mk) - KEYBOARD_LAYOUTS := $$(sort $$(LAYOUTS) $$(KEYBOARD_LAYOUTS)) - endif - ifneq ("$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_3)/rules.mk)","") - LAYOUTS := - $$(eval include $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_3)/rules.mk) - KEYBOARD_LAYOUTS := $$(sort $$(LAYOUTS) $$(KEYBOARD_LAYOUTS)) - endif - ifneq ("$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_2)/rules.mk)","") - LAYOUTS := - $$(eval include $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_2)/rules.mk) - KEYBOARD_LAYOUTS := $$(sort $$(LAYOUTS) $$(KEYBOARD_LAYOUTS)) - endif - ifneq ("$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_1)/rules.mk)","") - LAYOUTS := - $$(eval include $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_1)/rules.mk) - KEYBOARD_LAYOUTS := $$(sort $$(LAYOUTS) $$(KEYBOARD_LAYOUTS)) - endif + KEYBOARD_LAYOUTS := $(shell $(QMK_BIN) list-layouts --keyboard $1) LAYOUT_KEYMAPS := $$(foreach LAYOUT,$$(KEYBOARD_LAYOUTS),$$(eval LAYOUT_KEYMAPS += $$(notdir $$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/layouts/*/$$(LAYOUT)/*/.))))) -- cgit v1.2.3