Fix Arduino version detection on some systems

This commit is contained in:
Amilcar Lucas 2011-10-01 23:43:52 +02:00
parent 0d2527daf1
commit d327bdde80

View File

@ -305,7 +305,14 @@ LIBOBJS := $(SKETCHLIBOBJS) $(ARDUINOLIBOBJS)
# Pull the Arduino version from the revisions.txt file
#
# XXX can we count on this? If not, what?
ARDUINO_VERS := $(shell expr `head -1 $(ARDUINO)/lib/version.txt | cut -d ' ' -f 2`)
ARDUINO_VERS := $(shell expr `head -1 $(ARDUINO)/revisions.txt | cut -d ' ' -f 2`)
# If the version is not a number, try it again, using another file
ifneq ($(ARDUINO_VERS),$(shell echo $(ARDUINO_VERS) | sed 's/[^0-9]*//g'))
ARDUINO_VERS := $(shell expr `head -1 $(ARDUINO)/lib/version.txt | cut -d ' ' -f 2`)
endif
ifneq ($(ARDUINO_VERS),$(shell echo $(ARDUINO_VERS) | sed 's/[^0-9]*//g'))
$(warning Could not determine Arduino version)
endif
# Find the hardware directory to use
HARDWARE_DIR := $(firstword $(wildcard $(SKETCHBOOK)/hardware/$(HARDWARE) \