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