From 47d12f39e252ad57a9f144c4678ea3a876ae2276 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Sun, 7 Jun 2020 16:10:21 -0700 Subject: [PATCH] Add a test to the Makefile to complain if it can't find the Kaleidoscope bundle with a hint as to what the user might do to resolve things Signed-off-by: Jesse Vincent --- examples/Devices/Keyboardio/Model01/Makefile | 22 +++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/examples/Devices/Keyboardio/Model01/Makefile b/examples/Devices/Keyboardio/Model01/Makefile index 996bde98..dc5e9463 100644 --- a/examples/Devices/Keyboardio/Model01/Makefile +++ b/examples/Devices/Keyboardio/Model01/Makefile @@ -44,12 +44,28 @@ BOARD_HARDWARE_PATH = $(ARDUINO_INSTALLED_ENV) KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= build-tools/makefiles/ KALEIDOSCOPE_BUILDER_DIR ?= $(ARDUINO_INSTALLED_ENV)/libraries/Kaleidoscope/bin/ - - endif - BOARD_HARDWARE_PATH ?= $(SKETCHBOOK_DIR)/hardware KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= keyboardio/avr/build-tools/makefiles/ +ifneq ("$(wildcard $(BOARD_HARDWARE_PATH)/$(KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR)/rules.mk)","") + include $(BOARD_HARDWARE_PATH)/$(KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR)/rules.mk + +else + +$(info ****************************************************************************) +$(info I can't find an installed copy of Kaleidoscope's source code.) +$(info ) +$(info This usually means you're attempting to build a device's firmware from a git) +$(info checkout without having previously told Arduino where to find Kaleidoscope.) +$(info ) +$(info It is probably the case that you want to move or symlink your git checkout ) +$(info of the Kaleidoscope bundle to the directory: ) +$(info ) +$(info $(SKETCHBOOK_DIR)/hardware/keyboardio ) +$(info ****************************************************************************) + + +endif