/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: edam
  • Date: 2012-10-19 16:35:44 UTC
  • Revision ID: tim@ed.am-20121019163544-zqt3v12zwuaivccr
fixed check for stty switch, so that it works with busybox

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
#
3
3
#                         edam's Arduino makefile
4
4
#_______________________________________________________________________________
5
 
#                                                                    version 0.3
 
5
#                                                                 version 0.4dev
6
6
#
7
7
# Copyright (C) 2011, 1012 Tim Marston <tim@ed.am>.
8
8
#
260
260
AVRDUDEFLAGS += -c $(BOARD_UPLOAD_PROTOCOL) -b $(BOARD_UPLOAD_SPEED)
261
261
LINKFLAGS := -Os -Wl,--gc-sections -mmcu=$(BOARD_BUILD_MCU)
262
262
 
263
 
# figure out which arg to use with stty
264
 
STTYFARG := $(shell stty --help > /dev/null 2>&1 && echo -F || echo -f)
 
263
# figure out which arg to use with stty (for OS X, GNU and busybox stty)
 
264
STTYFARG := $(shell stty --help 2>&1 | \
 
265
        grep -q 'illegal option' && echo -f || echo -F)
265
266
 
266
267
# include dependencies
267
268
ifneq "$(MAKECMDGOALS)" "clean"
280
281
 
281
282
target: $(TARGET).hex
282
283
 
283
 
upload:
 
284
upload: target
284
285
        @echo "\nUploading to board..."
285
286
        @test -n "$(SERIALDEV)" || { \
286
287
                echo "error: SERIALDEV could not be determined automatically." >&2; \
298
299
 
299
300
boards:
300
301
        @echo Available values for BOARD:
301
 
        @sed -ne '/^#/d; /^[^.]\+\.name=/p' $(BOARDS_FILE) | \
302
 
                sed -e 's/\([^.]\+\)\.name=\(.*\)/\1            \2/' \
303
 
                        -e 's/\(.\{12\}\) *\(.*\)/\1 \2/'
 
302
        @sed -nEe '/^#/d; /^[^.]+\.name=/p' $(BOARDS_FILE) | \
 
303
                sed -Ee 's/([^.]+)\.name=(.*)/\1            \2/' \
 
304
                        -e 's/(.{12}) *(.*)/\1 \2/'
304
305
 
305
306
monitor:
306
307
        @test -n "$(SERIALDEV)" || { \