/make/arduino-mk

To get this branch, use:
bzr branch http://bzr.ed.am/make/arduino-mk

« back to all changes in this revision

Viewing changes to arduino.mk

  • Committer: Tim Marston
  • Date: 2014-01-08 20:24:16 UTC
  • Revision ID: tim@ed.am-20140108202416-n3uhux9wm9g52js9
remove use of non-portable sed -r

Show diffs side-by-side

added added

removed removed

42
42
#
43
43
#   $ ln -s ~/src/arduino.mk Makefile
44
44
#
45
 
# The Arduino software is required, version 1.0 or later, including version 1.5
46
 
# (which is in BETA at time of release of this makefile).  On GNU/Linux you can
47
 
# probably install the software from your package manager.  If you are using
48
 
# Debian (or a derivative), try `apt-get install arduino`.  Otherwise, you can
49
 
# download the latest Arduino software manually from http://arduino.cc/.  In
50
 
# case you're unsure, install it at ~/opt/arduino (or /Applications on OS X).
 
45
# The Arduino software (version 1.0 or later, including the new 1.5 BETA) is
 
46
# required.  On GNU/Linux you can probably install the software from your
 
47
# package manager.  If you are using Debian (or a derivative), try `apt-get
 
48
# install arduino`.  Otherwise, you can download the Arduino software manually
 
49
# from http://arduino.cc/.  It is suggested that you install it at
 
50
# ~/opt/arduino (or /Applications on OS X) if you are unsure.
51
51
#
52
52
# If you downloaded the Arduino software manually and unpacked it somewhere
53
53
# *other* than ~/opt/arduino (or /Applications), you will need to set up the
173
173
        $(HOME)/Applications/Arduino.app/Contents/Resources/Java))
174
174
endif
175
175
 
176
 
# check arduino software exists and determine available backends
 
176
# check ARDUINODIR (and determine which backends are available)
177
177
ifneq "" "$(wildcard $(ARDUINODIR)/hardware/arduino/boards.txt)"
178
178
ARDUINOBACKENDS := /
179
179
else ifneq "" "$(wildcard $(ARDUINODIR)/hardware/arduino/avr/boards.txt)"
264
264
# (this is a really stupid way of doing it, but it's how the IDE works -- if
265
265
# it's causing problems, you can override it by setting LIBRARIES manually)
266
266
INCLUDEDHEADERS := \
267
 
        $(shell sed -nre "s/^\s*\#\s*include\s*[<\"](\S+\.h)[>\"].*/\1/p" \
 
267
        $(shell sed -ne "s/^\s*\#\s*include\s*[<\"]\(\S\+\.h\)[>\"].*/\1/p" \
268
268
        $(SOURCES))
269
269
reverse = $(if $(1),$(call reverse,$(wordlist 2,$(words $(1)),$(1)))) \
270
270
        $(firstword $(1))
376
376
ifeq "$(BOARD_BOOTLOADER_PATH)" "caterina"
377
377
        stty $(STTYFARG) $(SERIALDEV) speed 1200
378
378
        sleep 1
379
 
else ifeq "" "$(filter net:%,$(SERIALDEV))"
 
379
else ifeq "" "$(filter net:% usb:%,$(SERIALDEV))"
380
380
        stty $(STTYFARG) $(SERIALDEV) hupcl
381
381
endif
382
382
        $(AVRDUDE) $(AVRDUDEFLAGS) -U flash:w:$(TARGET).hex:i
388
388
 
389
389
boards:
390
390
        @echo "Available BOARD values:"
391
 
        @sed -nre '/^\w+\.name=/p; /^menu\.cpu\.\w+\.\w+=/p;' $(BOARDSFILES) | \
392
 
                sed -re 's/(\w+)\.name=(.*)/\1                   \2/' \
393
 
                        -e 's/menu.cpu.\w+(\.\w+)=(.*)/  \1                  --\2/' \
394
 
                        -e 's/(.{19}) *(.*)/  \1 \2/; s/--/  w\/ /;'
 
391
        @sed -ne '/^\w\+\.name=/p; /^menu\.cpu\.\w\+\.\w\+=/p;' $(BOARDSFILES) | \
 
392
                sed -e 's/\(\w\+\)\.name=\(.*\)/\1                   \2/' \
 
393
                        -e 's/menu.cpu.\w\+\(\.\w\+\)=\(.*\)/  \1                  --\2/' \
 
394
                        -e 's/\(.\{19\}\) *\(.*\)/  \1 \2/; s/--/  ...with /;'
395
395
ifneq "$(ARDUINOBACKENDS)" "/"
396
396
        @echo
397
397
        @echo "NOTE: where a board supports multiple CPUs, you must specify" \