mirror of https://github.com/ArduPilot/ardupilot
We need TOOLPATH even when ARDUINO is defined. Refactor.
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1366 f9c3cf11-9bcb-44bc-f272-b75c42450872
This commit is contained in:
parent
338c60bfb1
commit
0620d0c631
|
@ -68,10 +68,6 @@ SKETCH := $(lastword $(subst /, ,$(SRCROOT)))
|
||||||
TMPDIR ?= /tmp
|
TMPDIR ?= /tmp
|
||||||
BUILDROOT := $(abspath $(TMPDIR)/$(SKETCH).build)
|
BUILDROOT := $(abspath $(TMPDIR)/$(SKETCH).build)
|
||||||
|
|
||||||
#
|
|
||||||
# Prefer the compiler bundled with Arduino on e.g. Mac OS.
|
|
||||||
#
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Find Arduino, if not explicitly specified
|
# Find Arduino, if not explicitly specified
|
||||||
#
|
#
|
||||||
|
@ -87,14 +83,11 @@ 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
|
||||||
# use the compiler that comes with Arduino
|
|
||||||
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))
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -118,8 +111,17 @@ endif
|
||||||
#
|
#
|
||||||
|
|
||||||
#
|
#
|
||||||
# XXX should we be using tools from the Arduino distribution?
|
# Decide where we are going to look for tools
|
||||||
#
|
#
|
||||||
|
ifeq ($(SYSTYPE),Darwin)
|
||||||
|
# use the tools that come with Arduino
|
||||||
|
TOOLPATH := $(ARDUINOS)/hardware/tools/avr/bin
|
||||||
|
endif
|
||||||
|
ifeq ($(SYSTYPE),Linux)
|
||||||
|
# expect that tools are on the path
|
||||||
|
TOOLPATH := $(subst :, ,$(PATH))
|
||||||
|
endif
|
||||||
|
|
||||||
FIND_TOOL = $(firstword $(wildcard $(addsuffix /$(1),$(TOOLPATH))))
|
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)
|
||||||
|
|
Loading…
Reference in New Issue