2013-02-21 00:43:25 -04:00
|
|
|
################################################################################
|
|
|
|
# Tools
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# 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
|
|
|
|
# use BWK awk
|
|
|
|
AWK = awk
|
2013-03-08 02:53:09 -04:00
|
|
|
FIND_TOOL = $(firstword $(wildcard $(addsuffix /$(1),$(TOOLPATH))))
|
2013-02-21 00:43:25 -04:00
|
|
|
endif
|
|
|
|
ifeq ($(SYSTYPE),Linux)
|
|
|
|
# expect that tools are on the path
|
|
|
|
TOOLPATH := $(subst :, ,$(PATH))
|
2013-03-08 02:53:09 -04:00
|
|
|
FIND_TOOL = $(firstword $(wildcard $(addsuffix /$(1),$(TOOLPATH))))
|
2013-02-21 00:43:25 -04:00
|
|
|
endif
|
|
|
|
ifeq ($(findstring CYGWIN, $(SYSTYPE)),CYGWIN)
|
|
|
|
TOOLPATH := $(ARDUINO)/hardware/tools/avr/bin
|
2013-03-08 02:53:09 -04:00
|
|
|
FIND_TOOL = $(firstword $(wildcard $(addsuffix /$(1).exe,$(TOOLPATH))))
|
2013-02-21 00:43:25 -04:00
|
|
|
endif
|
2013-03-08 02:53:09 -04:00
|
|
|
ifeq ($(findstring MINGW, $(SYSTYPE)),MINGW)
|
|
|
|
TOOLPATH := $(ARDUINO)/hardware/tools/avr/bin
|
|
|
|
FIND_TOOL = $(firstword $(wildcard $(addsuffix /$(1).exe,$(TOOLPATH))))
|
2013-02-21 00:43:25 -04:00
|
|
|
endif
|
|
|
|
|
2013-03-03 07:22:33 -04:00
|
|
|
NATIVE_CXX := g++
|
|
|
|
NATIVE_CC := gcc
|
|
|
|
NATIVE_AS := gcc
|
|
|
|
NATIVE_AR := ar
|
|
|
|
NATIVE_LD := g++
|
|
|
|
NATIVE_GDB := gdb
|
|
|
|
NATIVE_OBJCOPY := objcopy
|
2013-02-21 00:43:25 -04:00
|
|
|
|
|
|
|
AVR_CXX := $(call FIND_TOOL,avr-g++)
|
|
|
|
AVR_CC := $(call FIND_TOOL,avr-gcc)
|
|
|
|
AVR_AS := $(call FIND_TOOL,avr-gcc)
|
|
|
|
AVR_AR := $(call FIND_TOOL,avr-ar)
|
|
|
|
AVR_LD := $(call FIND_TOOL,avr-gcc)
|
|
|
|
AVR_GDB := $(call FIND_TOOL,avr-gdb)
|
|
|
|
AVR_OBJCOPY := $(call FIND_TOOL,avr-objcopy)
|
|
|
|
|
|
|
|
AVRDUDE := $(call FIND_TOOL,avrdude)
|
|
|
|
AVARICE := $(call FIND_TOOL,avarice)
|
|
|
|
|
2013-09-23 00:01:42 -03:00
|
|
|
# Tools for Maple/Flymaple
|
|
|
|
# Toolchain is expected to be on the PATH
|
|
|
|
ARM_CXX := $(call FIND_TOOL,arm-none-eabi-g++)
|
|
|
|
ARM_CC := $(call FIND_TOOL,arm-none-eabi-gcc)
|
|
|
|
ARM_AS := $(call FIND_TOOL,arm-none-eabi-gcc)
|
|
|
|
ARM_AR := $(call FIND_TOOL,arm-none-eabi-ar)
|
|
|
|
ARM_LD := $(call FIND_TOOL,arm-none-eabi-g++)
|
|
|
|
ARM_GDB := $(call FIND_TOOL,arm-none-eabi-gdb)
|
|
|
|
ARM_OBJCOPY := $(call FIND_TOOL,arm-none-eabi-objcopy)
|
|
|
|
|
2013-02-21 00:43:25 -04:00
|
|
|
CXX = $($(TOOLCHAIN)_CXX)
|
|
|
|
CC = $($(TOOLCHAIN)_CC)
|
|
|
|
AS = $($(TOOLCHAIN)_AS)
|
|
|
|
AR = $($(TOOLCHAIN)_AR)
|
|
|
|
LD = $($(TOOLCHAIN)_LD)
|
|
|
|
GDB = $($(TOOLCHAIN)_GDB)
|
|
|
|
OBJCOPY = $($(TOOLCHAIN)_OBJCOPY)
|
|
|
|
|
2013-03-03 07:22:33 -04:00
|
|
|
ifeq ($(CXX),)
|
2013-05-04 02:10:20 -03:00
|
|
|
$(error ERROR: cannot find the compiler tools for $(TOOLCHAIN) anywhere on the path $(TOOLPATH))
|
2013-02-21 00:43:25 -04:00
|
|
|
endif
|
|
|
|
|
|
|
|
# Find awk
|
|
|
|
AWK ?= gawk
|
|
|
|
ifeq ($(shell which $(AWK)),)
|
|
|
|
$(error ERROR: cannot find $(AWK) - you may need to install GNU awk)
|
|
|
|
endif
|
|
|
|
|