From c614cafa4d6f2a386e3b95d3d55e87eaebfaae02 Mon Sep 17 00:00:00 2001
From: Christopher Peplin <cpeplin@ford.com>
Date: Mon, 2 Apr 2012 15:43:40 -0400
Subject: [PATCH] Use different variables for Arduino/MPIDE path and quit if
 they're not set.

---
 arduino-mk/Arduino.mk | 6 +++---
 arduino-mk/chipKIT.mk | 6 ++++++
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/arduino-mk/Arduino.mk b/arduino-mk/Arduino.mk
index d9fe585..bfa5fe6 100644
--- a/arduino-mk/Arduino.mk
+++ b/arduino-mk/Arduino.mk
@@ -183,7 +183,9 @@ endif
 # Some paths
 #
 
-ifneq (ARDUINO_DIR,)
+ifeq ($(wildcard $(ARDUINO_DIR)),)
+$(error "Error: the ARDUINO_DIR variable must point to your Arduino IDE installation")
+endif
 
 ifndef AVR_TOOLS_PATH
 AVR_TOOLS_PATH    = $(ARDUINO_DIR)/hardware/tools
@@ -221,8 +223,6 @@ ifndef ARDUINO_VAR_PATH
 ARDUINO_VAR_PATH  = $(ARDUINO_DIR)/hardware/arduino/variants
 endif
 
-endif
-
 ########################################################################
 # boards.txt parsing
 #
diff --git a/arduino-mk/chipKIT.mk b/arduino-mk/chipKIT.mk
index 3126991..d776933 100644
--- a/arduino-mk/chipKIT.mk
+++ b/arduino-mk/chipKIT.mk
@@ -13,6 +13,12 @@
 
 OSTYPE := $(shell uname)
 
+ifeq ($(wildcard $(MPIDE_DIR)),)
+$(error "Error: the MPIDE_DIR variable must point to your MPIDE installation")
+endif
+
+ARDUINO_DIR = $(MPIDE_DIR)
+
 AVR_TOOLS_PATH = $(ARDUINO_DIR)/hardware/pic32/compiler/pic32-tools/bin
 
 ifneq ($(OSTYPE),Linux)