diff --git a/etc/makefiles/arduino-cli.mk b/etc/makefiles/arduino-cli.mk index b6541a04..68ea4ecc 100644 --- a/etc/makefiles/arduino-cli.mk +++ b/etc/makefiles/arduino-cli.mk @@ -55,26 +55,7 @@ endif # Otherwise, use the arduino-cli bundle export ARDUINO_DIRECTORIES_USER ?= $(ARDUINO_CONTENT)/user -# If we're not calling setup, we should freak out if the hardware -# definitions don't exist - -ifneq ($(MAKECMDGOALS),setup) - -ifeq ($(wildcard $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/avr/boards.txt),) - -$(info Kaleidoscope hardware definitions not found in) -$(info $(ARDUINO_DIRECTORIES_USER)) -$(info ) -$(info You may be able to resolve this issue by running the following command) -$(info to initialize Kaleidoscope ) -$(info ) -$(info $(MAKE) -C $(KALEIDOSCOPE_DIR) setup ) -$(info ) -$(error ) - -endif -endif arduino_env = ARDUINO_DIRECTORIES_USER=$(ARDUINO_DIRECTORIES_USER) \ ARDUINO_DIRECTORIES_DATA=$(ARDUINO_DIRECTORIES_DATA) @@ -176,3 +157,20 @@ install-arduino-core-deps: $(QUIET) $(ARDUINO_CLI) core install "keyboardio:gd32-tools-only" +# If we're not calling setup, we should freak out if the hardware +# definitions don't exist + +.PHONY: kaleidoscope-hardware-configured + +kaleidoscope-hardware-configured: $(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/avr/platform.txt + +$(ARDUINO_DIRECTORIES_USER)/hardware/keyboardio/avr/platform.txt: + $(info Kaleidoscope hardware definitions not found in) + $(info $(ARDUINO_DIRECTORIES_USER)) + $(info ) + $(info You may be able to resolve this issue by running the following command) + $(info to initialize Kaleidoscope ) + $(info ) + $(info $(MAKE) -C $(KALEIDOSCOPE_DIR) setup ) + $(info ) + $(error ) diff --git a/etc/makefiles/sketch.mk b/etc/makefiles/sketch.mk index a5c5ceb5..d54a7ef3 100644 --- a/etc/makefiles/sketch.mk +++ b/etc/makefiles/sketch.mk @@ -123,7 +123,7 @@ DEFAULT_GOAL: compile .PHONY: compile configure-arduino-cli install-arduino-core-kaleidoscope install-arduino-core-avr .PHONY: disassemble decompile size-map flash clean all test -all: compile +all: compile @: ## Do not remove this line, otherwise `make all` will trigger the `%` rule too. @@ -175,7 +175,7 @@ ifneq ($(KALEIDOSCOPE_LOCAL_LIB_DIR),) _arduino_local_libraries_prop = --libraries "${KALEIDOSCOPE_LOCAL_LIB_DIR}" endif -compile: +compile: kaleidoscope-hardware-configured $(QUIET) install -d "${OUTPUT_PATH}" @@ -205,7 +205,7 @@ endif .PHONY: ensure-device-port-defined -ensure-device-port-defined: +ensure-device-port-defined: kaleidoscope-hardware-configured @if [ -z $(KALEIDOSCOPE_DEVICE_PORT) ]; then \ echo "ERROR: Unable to detect keyboard serial port.";\ echo ;\ @@ -223,7 +223,7 @@ port_arg = --port $(KALEIDOSCOPE_DEVICE_PORT) endif -flash: +flash: compile $(info $(unescaped_flashing_instructions)) $(info ) $(info When you're ready to proceed, press 'Enter'.)