Better TOOLPATH handling for Linux

git-svn-id: https://arducopter.googlecode.com/svn/trunk@1364 f9c3cf11-9bcb-44bc-f272-b75c42450872
This commit is contained in:
DrZiplok 2010-12-29 23:13:44 +00:00
parent d32d2ded68
commit 0b48a85ddf
1 changed files with 4 additions and 6 deletions

View File

@ -71,7 +71,6 @@ BUILDROOT := $(abspath $(TMPDIR)/$(SKETCH).build)
# #
# Prefer the compiler bundled with Arduino on e.g. Mac OS. # Prefer the compiler bundled with Arduino on e.g. Mac OS.
# #
TOOLPATH = $(ARDUINOS)/hardware/tools/avr/bin
# #
# Find Arduino, if not explicitly specified # Find Arduino, if not explicitly specified
@ -88,14 +87,14 @@ ifeq ($(ARDUINO),)
ifeq ($(ARDUINOS),) ifeq ($(ARDUINOS),)
$(error ERROR: Spotlight cannot find Arduino on your system.) $(error ERROR: Spotlight cannot find Arduino on your system.)
endif endif
# other places we might find toolchain # use the compiler that comes with Arduino
TOOLPATH += /usr/local/CrossPack-AVR/bin /opt/local/bin TOOLPATH := $(ARDUINOS)/hardware/tools/avr/bin
endif endif
ifeq ($(SYSTYPE),Linux) ifeq ($(SYSTYPE),Linux)
ARDUINO_SEARCHPATH = /usr/share/arduino /usr/local/share/arduino ARDUINO_SEARCHPATH = /usr/share/arduino /usr/local/share/arduino
ARDUINOS := $(wildcard $(ARDUINO_SEARCHPATH)) ARDUINOS := $(wildcard $(ARDUINO_SEARCHPATH))
TOOLPATH := $(subst ;, ,$(PATH)) TOOLPATH := $(subst :, ,$(PATH))
endif endif
# #
@ -121,14 +120,13 @@ endif
# #
# XXX should we be using tools from the Arduino distribution? # XXX should we be using tools from the Arduino distribution?
# #
FIND_TOOL = $(firstword $(wildcard $(addsuffix /$(1),$(TOOLPATH))) >/dev/tty) FIND_TOOL = $(firstword $(wildcard $(addsuffix /$(1),$(TOOLPATH))))
CXX = $(call FIND_TOOL,avr-g++) CXX = $(call FIND_TOOL,avr-g++)
CC = $(call FIND_TOOL,avr-gcc) CC = $(call FIND_TOOL,avr-gcc)
AS = $(call FIND_TOOL,avr-gcc) AS = $(call FIND_TOOL,avr-gcc)
AR = $(call FIND_TOOL,avr-ar) AR = $(call FIND_TOOL,avr-ar)
LD = $(call FIND_TOOL,avr-gcc) LD = $(call FIND_TOOL,avr-gcc)
OBJCOPY = $(call FIND_TOOL,avr-objcopy) OBJCOPY = $(call FIND_TOOL,avr-objcopy)
ifeq ($(CXX),) ifeq ($(CXX),)
$(error ERROR: cannot find the compiler tools anywhere on the path $(TOOLPATH)) $(error ERROR: cannot find the compiler tools anywhere on the path $(TOOLPATH))
endif endif