From c0c4c97db6fe92b61f0a169a9c96c0025cc4af07 Mon Sep 17 00:00:00 2001
From: Guillaume Seguin <guillaume@segu.in>
Date: Thu, 1 Aug 2013 19:20:27 +0200
Subject: [PATCH] Detect OS in Makefile to use the correct avrdude.conf path

---
 Marlin/Makefile | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/Marlin/Makefile b/Marlin/Makefile
index 5cc25ea014d..59ec4d4f7eb 100644
--- a/Marlin/Makefile
+++ b/Marlin/Makefile
@@ -312,7 +312,12 @@ LDFLAGS = -lm
 # Programming support using avrdude. Settings and variables.
 AVRDUDE_PORT = $(UPLOAD_PORT)
 AVRDUDE_WRITE_FLASH = -U flash:w:$(BUILD_DIR)/$(TARGET).hex:i
-AVRDUDE_FLAGS = -D -C $(ARDUINO_INSTALL_DIR)/hardware/tools/avr/etc/avrdude.conf \
+ifeq ($(shell uname -s), Linux)
+AVRDUDE_CONF = $(ARDUINO_INSTALL_DIR)/hardware/tools/avrdude.conf
+else
+AVRDUDE_CONF = $(ARDUINO_INSTALL_DIR)/hardware/tools/avr/etc/avrdude.conf
+endif
+AVRDUDE_FLAGS = -D -C $(AVRDUDE_CONF) \
 	-p $(MCU) -P $(AVRDUDE_PORT) -c $(AVRDUDE_PROGRAMMER) \
 	-b $(UPLOAD_RATE)