summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile18
1 files changed, 10 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 80a5aad..cf76098 100644
--- a/Makefile
+++ b/Makefile
@@ -3,8 +3,16 @@
UNAME_S := $(shell uname -s)
+ifeq ($(UNAME_S),Darwin)
+SKETCHBOOK_DIR ?= $(HOME)/Documents/Arduino/
+PACKAGE_DIR ?= $(HOME)/Library/Arduino15
+else
+SKETCHBOOK_DIR ?= $(HOME)/Arduino
+PACKAGE_DIR ?= $(HOME)/.arduino15
+endif
+
-INSTALLED_ENV=$(shell ls -dt ~/.arduino15/packages/keyboardio/hardware/avr/*|head -n 1)
+INSTALLED_ENV=$(shell ls -dt $(PACKAGE_DIR)/packages/keyboardio/hardware/avr/*|head -n 1)
ifneq ("$(wildcard $(INSTALLED_ENV)/boards.txt)","")
BOARD_HARDWARE_PATH = $(INSTALLED_ENV)
@@ -13,13 +21,7 @@ KALEIDOSCOPE_BUILDER_DIR ?= $(INSTALLED_ENV)/libraries/Kaleidoscope/bin/
endif
-
-ifeq ($(UNAME_S),Darwin)
-SKETCHBOOK_DIR ?= $(HOME)/Documents/Arduino/
-else
-SKETCHBOOK_DIR ?= $(HOME)/Arduino
-endif
-
BOARD_HARDWARE_PATH ?= $(SKETCHBOOK_DIR)/hardware
KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR ?= keyboardio/avr/build-tools/makefiles/
+
include $(BOARD_HARDWARE_PATH)/$(KALEIDOSCOPE_PLUGIN_MAKEFILE_DIR)/rules.mk