From 801fc060618bcfcf3b84edfd535bab641ceb7097 Mon Sep 17 00:00:00 2001 From: Simon John Date: Mon, 19 May 2014 22:09:00 +0100 Subject: [PATCH] Check that on windows ARDUINO_DIR (and MPIDE_DIR) is a relative path. Checks for paths starting with / e.g. /cydrive/arduino or a drive letter e.g. C:\Program Files\Arduino --- Arduino.mk | 6 ++++++ chipKIT.mk | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/Arduino.mk b/Arduino.mk index a352628..42dfef0 100644 --- a/Arduino.mk +++ b/Arduino.mk @@ -279,6 +279,12 @@ else $(call show_config_variable,ARDUINO_DIR,[USER]) endif +ifeq ($(CURRENT_OS),WINDOWS) + ifneq ($(shell echo $(ARDUINO_DIR) | egrep '^(/|[a-zA-Z]:\\)'),) + echo $(error On Windows, ARDUINO_DIR must be a relative path) + endif +endif + ######################################################################## # Default TARGET to pwd (ex Daniele Vergini) diff --git a/chipKIT.mk b/chipKIT.mk index 19a4a4a..06d85e3 100644 --- a/chipKIT.mk +++ b/chipKIT.mk @@ -47,6 +47,12 @@ else $(call show_config_variable,MPIDE_DIR,[USER]) endif +ifeq ($(CURRENT_OS),WINDOWS) + ifneq ($(shell echo $(ARDUINO_DIR) | egrep '^(/|[a-zA-Z]:\\)'),) + echo $(error On Windows, MPIDE_DIR must be a relative path) + endif +endif + ifndef MPIDE_PREFERENCES_PATH AUTO_MPIDE_PREFERENCES_PATH := $(firstword \ $(call dir_if_exists,$(HOME)/.mpide/preferences.txt) \