summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorJesse Vincent <jesse@fsck.com>2019-03-05 16:55:28 -0800
committerGitHub <noreply@github.com>2019-03-05 16:55:28 -0800
commit65839e568307dbce07a8652db7ccfd5769f4d084 (patch)
treea25b8fef9f3e5030205b180cd04f6e91dbe995cc /Makefile
parent0ebf5f3b7fe20ae3a71230517542898f7a0f8ebc (diff)
parent0e865cfc3411f900e04c2061d822f79d575db929 (diff)
downloadmodel01-firmware-65839e568307dbce07a8652db7ccfd5769f4d084.tar.gz
model01-firmware-65839e568307dbce07a8652db7ccfd5769f4d084.tar.bz2
model01-firmware-65839e568307dbce07a8652db7ccfd5769f4d084.zip
Merge pull request #81 from noseglasses/pr_quick_builds
Fallback settings for BOARD_HARDWARE_PATH
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile17
1 files changed, 17 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 14a7f3c..7682689 100644
--- a/Makefile
+++ b/Makefile
@@ -52,4 +52,21 @@ endif
BOARD_HARDWARE_PATH ?= $(SKETCHBOOK_DIR)/hardware
KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= keyboardio/build-tools/makefiles/
+# If Kaleidoscope's Arduino libraries cannot be found, e.g. because
+# they reside outside of SKETCHBOOK_DIR, we fall back to assuming that
+# the hardware directory can be determined in relation to the position of
+# this Makefile.
+ifeq ("$(wildcard $(BOARD_HARDWARE_PATH)/keyboardio/build-tools/makefiles/rules.mk)","")
+ # Determine the path of this Makefile
+ MKFILE_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
+ BOARD_HARDWARE_PATH = $(MKFILE_DIR)/../../../..
+endif
+
+ifeq ("$(wildcard $(BOARD_HARDWARE_PATH)/keyboardio/build-tools/makefiles/rules.mk)","")
+$(info ***************************************************************************)
+$(info Unable to autodetect a proper BOARD_HARDWARE_PATH. Please define it manually.)
+$(info ***************************************************************************)
+$(info )
+endif
+
include $(BOARD_HARDWARE_PATH)/$(KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR)/rules.mk