/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-02-21 15:28:31 UTC
  • Revision ID: tim@ed.am-20120221152831-xbynpaw5g177ul3w
updated NEWS

Show diffs side-by-side

added added

removed removed

1
1
#_______________________________________________________________________________
2
2
#
3
 
#                         edam's Arduino makefile
 
3
#                         edam's arduino makefile
4
4
#_______________________________________________________________________________
5
 
#                                                                 version 0.3dev
 
5
#                                                                    version 0.3
6
6
#
7
7
# Copyright (C) 2011, 1012 Tim Marston <tim@ed.am>.
8
8
#
44
44
#
45
45
# The Arduino software (version 1.0 or later) is required.  If you are using
46
46
# Debian (or a derivative), type `apt-get install arduino`.  Otherwise, you
47
 
# will have to download the Arduino software manually from http://arduino.cc/.
 
47
# will have to download the arduino software manually from http://arduino.cc/.
48
48
# It is suggested that you install it at ~/opt/arduino if you are unsure.
49
49
#
50
50
# If you downloaded the Arduino software manually and unpacked it somewhere
56
56
#   export ARDUINODIR=~/somewhere/arduino-1.0
57
57
#
58
58
# You will also need to set BOARD to the type of Arduino you're building for.
59
 
# Type `make boards` for a list of acceptable values.  You could set a default
60
 
# in your ~/.profile if you want, but it is suggested that you specify this at
61
 
# build time, especially if you work with different types of Arduino.  For
62
 
# example:
 
59
# You could set a default in your ~/.profile if you want, but it is suggested
 
60
# that you specify this at build time, especially if you work with different
 
61
# types of Arduino.  For example:
63
62
#
64
63
#   $ export BOARD=uno
65
64
#   $ make
92
91
#              is passed to avrdude (to the system default is used).
93
92
#
94
93
# AVRTOOLSPATH A space-separated list of directories to search in order when
95
 
#              looking for the avr build tools. This defaults to the system PATH
 
94
#              lookin for the avr build tools. This defaults to the system PATH
96
95
#              followed by subdirectories in ARDUINODIR if undefined.
97
96
#
98
97
# BOARD        Specify a target board type.  Run `make boards` to see available
131
130
# monitor      Start `screen` on the serial device.  This is meant to be an
132
131
#              equivalent to the Arduino serial monitor.
133
132
#
134
 
# size         Displays size information about the bulit target.
135
 
#
136
133
# <file>       Builds the specified file, either an object file or the target,
137
134
#              from those that that would be built for the project.
138
135
#_______________________________________________________________________________
193
190
AR := $(call findsoftware,avr-ar)
194
191
OBJCOPY := $(call findsoftware,avr-objcopy)
195
192
AVRDUDE := $(call findsoftware,avrdude)
196
 
AVRSIZE := $(call findsoftware,avr-size)
197
193
 
198
194
# files
199
195
TARGET := $(if $(TARGET),$(TARGET),a.out)
270
266
#_______________________________________________________________________________
271
267
#                                                                          RULES
272
268
 
273
 
.PHONY: all target upload clean boards monitor size
 
269
.PHONY: all target upload clean boards monitor
274
270
 
275
271
all: target upload
276
272
 
309
305
                echo; }
310
306
        screen $(SERIALDEV)
311
307
 
312
 
size: $(TARGET).elf
313
 
        echo && $(AVRSIZE) --format=avr --mcu=$(BOARD_BUILD_MCU) $(TARGET).elf
314
 
 
315
308
# building the target
316
309
 
317
310
$(TARGET).hex: $(TARGET).elf