diff --git a/Makefile b/Makefile index 4b045ed1..936b7377 100644 --- a/Makefile +++ b/Makefile @@ -7,9 +7,13 @@ ifeq ($(QMK_USERSPACE),) QMK_USERSPACE := $(shell pwd) endif -QMK_FIRMWARE_ROOT = $(shell qmk config -ro user.qmk_home | cut -d= -f2 | sed -e 's@^None$$@@g') +# Determine which qmk cli to use +QMK_BIN := qmk + +# Try to determine qmk_firmware from qmk config - no fallback is required as this functionality has existed since qmk_cli 0.0.46 +QMK_FIRMWARE_ROOT = $(shell $(QMK_BIN) env QMK_FIRMWARE) ifeq ($(QMK_FIRMWARE_ROOT),) - $(error Cannot determine qmk_firmware location. `qmk config -ro user.qmk_home` is not set) + $(error Cannot determine qmk_firmware location. `qmk config -ro user.qmk_home` or QMK_HOME environment variable is not set) endif %: