summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile17
1 files changed, 12 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 91ab9e4e8e..e007ae3679 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
@@ -86,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
@@ -384,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
@@ -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