From ece25aef75a794953e60c1e4e8da7d9ff51ebd09 Mon Sep 17 00:00:00 2001 From: Christopher Peplin Date: Fri, 30 Mar 2012 16:13:09 -0400 Subject: [PATCH 1/3] Use system AVR tools in Linux as they are not distributed with the IDE. As of Arduino 1.0 the AVR tools are not distributed with the IDE. --- arduino-mk/Arduino.mk | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/arduino-mk/Arduino.mk b/arduino-mk/Arduino.mk index 2d39095..41c78c4 100644 --- a/arduino-mk/Arduino.mk +++ b/arduino-mk/Arduino.mk @@ -186,7 +186,7 @@ endif ifneq (ARDUINO_DIR,) ifndef AVR_TOOLS_PATH -AVR_TOOLS_PATH = $(ARDUINO_DIR)/hardware/tools/avr/bin +AVR_TOOLS_PATH = $(ARDUINO_DIR)/hardware/tools/avr/bin/ endif ifndef ARDUINO_ETC_PATH @@ -308,13 +308,26 @@ CORE_LIB = $(OBJDIR)/libcore.a DEP_FILE = $(OBJDIR)/depends.mk # Names of executables -CC = $(AVR_TOOLS_PATH)/avr-gcc -CXX = $(AVR_TOOLS_PATH)/avr-g++ -OBJCOPY = $(AVR_TOOLS_PATH)/avr-objcopy -OBJDUMP = $(AVR_TOOLS_PATH)/avr-objdump -AR = $(AVR_TOOLS_PATH)/avr-ar -SIZE = $(AVR_TOOLS_PATH)/avr-size -NM = $(AVR_TOOLS_PATH)/avr-nm +CC := avr-gcc +CXX := avr-g++ +OBJCOPY := avr-objcopy +OBJDUMP := avr-objdump +AR := avr-ar +SIZE := avr-size +NM := avr-nm + +OSTYPE := $(shell uname) +ifneq ($(OSTYPE),Linux) +# Compilers distributed with the IDE in OS X and Windows, but not Linux +CC := $(addprefix $(AVR_TOOLS_PATH),$(CC)) +CXX := $(addprefix $(AVR_TOOLS_PATH),$(CXX)) +OBJCOPY := $(addprefix $(AVR_TOOLS_PATH),$(OBJCOPY)) +OBJDUMP := $(addprefix $(AVR_TOOLS_PATH),$(OBJDUMP)) +AR := $(addprefix $(AVR_TOOLS_PATH),$(AR)) +SIZE := $(addprefix $(AVR_TOOLS_PATH),$(SIZE)) +NM := $(addprefix $(AVR_TOOLS_PATH),$(NM)) +endif + REMOVE = rm -f MV = mv -f CAT = cat From ab5de3ae404ac59abe720f1fc6f24b932fac7b29 Mon Sep 17 00:00:00 2001 From: Christopher Peplin Date: Mon, 2 Apr 2012 17:01:41 -0400 Subject: [PATCH 2/3] Fix AVR_TOOLS_PATH and make sure OSTYPE is populated earlier. --- arduino-mk/Arduino.mk | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arduino-mk/Arduino.mk b/arduino-mk/Arduino.mk index 41c78c4..4f8b3bd 100644 --- a/arduino-mk/Arduino.mk +++ b/arduino-mk/Arduino.mk @@ -183,10 +183,12 @@ endif # Some paths # +OSTYPE := $(shell uname) + ifneq (ARDUINO_DIR,) ifndef AVR_TOOLS_PATH -AVR_TOOLS_PATH = $(ARDUINO_DIR)/hardware/tools/avr/bin/ +AVR_TOOLS_PATH = $(ARDUINO_DIR)/hardware/tools endif ifndef ARDUINO_ETC_PATH @@ -316,7 +318,6 @@ AR := avr-ar SIZE := avr-size NM := avr-nm -OSTYPE := $(shell uname) ifneq ($(OSTYPE),Linux) # Compilers distributed with the IDE in OS X and Windows, but not Linux CC := $(addprefix $(AVR_TOOLS_PATH),$(CC)) From 99ee6914a5fee4b91678147e66d6cac60923b66d Mon Sep 17 00:00:00 2001 From: Christopher Peplin Date: Tue, 3 Apr 2012 10:49:06 -0400 Subject: [PATCH 3/3] Fix and test paths on Arduino in both Linux and OS X. --- arduino-mk/Arduino.mk | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/arduino-mk/Arduino.mk b/arduino-mk/Arduino.mk index 4f8b3bd..7fe264b 100644 --- a/arduino-mk/Arduino.mk +++ b/arduino-mk/Arduino.mk @@ -187,12 +187,28 @@ OSTYPE := $(shell uname) ifneq (ARDUINO_DIR,) -ifndef AVR_TOOLS_PATH -AVR_TOOLS_PATH = $(ARDUINO_DIR)/hardware/tools +ifndef TOOLS_PATH +TOOLS_PATH = $(ARDUINO_DIR)/hardware/tools/ endif -ifndef ARDUINO_ETC_PATH -ARDUINO_ETC_PATH = $(ARDUINO_DIR)/hardware/tools/avr/etc +ifndef AVR_TOOLS_PATH +AVR_TOOLS_PATH = $(TOOLS_PATH)/avr/bin/ +endif + +ifndef AVRDUDE_TOOLS_PATH +ifeq ($(OSTYPE),Linux) +AVRDUDE_TOOLS_PATH = $(TOOLS_PATH) +else +AVRDUDE_TOOLS_PATH = $(TOOLS_PATH)/avr/bin +endif +endif + +ifndef AVRDUDE_ETC_PATH +ifeq ($(OSTYPE),Linux) +AVRDUDE_ETC_PATH = $(TOOLS_PATH) +else +AVRDUDE_ETC_PATH = $(TOOLS_PATH)/avr/etc +endif endif ifndef AVRDUDE_CONF