summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorJesse Vincent <jesse@keyboard.io>2017-10-04 23:46:51 -0700
committerJesse Vincent <jesse@keyboard.io>2017-10-04 23:46:51 -0700
commitcd9780a309109c7e766f9a0715f1ef1b0137db9c (patch)
tree7b05c429a745d12b4f3c72857cef09c915b19430 /Makefile
parentbeb849f84f6f96019e5c57c2800d033946bd0b07 (diff)
downloadmodel01-firmware-cd9780a309109c7e766f9a0715f1ef1b0137db9c.tar.gz
model01-firmware-cd9780a309109c7e766f9a0715f1ef1b0137db9c.tar.bz2
model01-firmware-cd9780a309109c7e766f9a0715f1ef1b0137db9c.zip
Fix our arduino-ide package detection to work on OSX
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