27
27
#_______________________________________________________________________________
30
# This is a general purpose makefile for use with Arduino (see
31
# http://arduino.cc/) hardware and software. It works with the
32
# arduino-1.0 release and requires that to be downloaded separately.
33
# It can be downloaded from http://ed.am/dev/make/arduino-makefile
34
# where you can also find more information and documentation on it's
35
# use. The following text can only really be considered a reference
30
# This is a general purpose makefile for use with Arduino hardware and
31
# software. It works with the arduino-1.0 release and requires that
32
# software to be downloaded separately (see http://arduino.cc/). To
33
# download the latest version of this makefile, visit the following
34
# website, where you can also find more information and documentation
35
# on it's use. The following text can only really be considered a
36
# reference to it's use.
38
# http://ed.am/dev/make/arduino-makefile
38
40
# To install, it is suggested that you keep arduino.mk somewhere and
39
41
# either symlink to it or include it in your make files. I keep mine
44
46
# This makefile can be used as a drop-in replacement for the Arduino
45
47
# IDE's build system. Simply create a symlink to it under the name
46
# "Makefile" and run make as described below (remembering to specify a
47
# BOARD). You would create the symlink like like so:
48
# "Makefile" and run make (remembering to specify an ARDUINODIR and
49
# BOARD, as described below). You would create the symlink like like
49
# $ ln -s ~/src/arduino.mk Makefile
52
# $ ln -s ~/src/arduino.mk Makefile
51
54
# The presence of a .ino or .pde file causes the arduino.mk to
52
55
# atuomatically determine va;ues for SOURCES, TARGET and LIBRARIES.
62
65
# default main() that calls init() and loop(). Here is an example
65
# SOURCES := main.cc foo.cc
67
# include ~/src/arduino.mk
68
# SOURCES := main.cc foo.cc
70
# include ~/src/arduino.mk
69
72
# A complete list of all the settings you can use in your Makefile
70
73
# follows shortly. It should be noted, however, that some variables
71
# are better specified in the environment or on the command line than
72
# in a Makefile. Specifically, the BOARD and SERIALDEV (if it is not
73
# automatically detected).
75
# When running make, you might want to specify the board type:
79
# Or in the environment:
81
# $ export BOARD=pro5v
74
# are better specified in the environment (or on the command line)
75
# than in your Makefile. Specifically, the ARDUINODIR, BOARD and, if
76
# it is not automatically detected, SERIALDEV.
78
# When running make, you might want to specify the board and path to
79
# your installation of the arduino software, like this:
81
# $ export ARDUINODIR=~/opt/arduino-1.0
82
# $ export BOARD=pro5v
84
85
# For a list of available board types, run `make boards`.
86
# Here is a list of all configuration parameters:
87
# Here is a complete list of configuration parameters:
89
# ARDUINODIR The path where you have installed/unpacked the arduino
90
# software (from http://arduino.cc/)
88
92
# BOARD Specify a target board type.
91
95
# found. If unspecified, an attempt is made to determine
92
96
# the name of a connected arduino's serial device.
94
# The following configuration parameters can be determined automatically:
96
# TARGET The name of the target file. This need not be set if it
97
# is not determined automatically.
98
# TARGET The name of the target file. This is set automatically
99
# if a .ino or .pde is found, but it is not neccesary to
99
102
# SOURCES A list of all source files of whatever language. The
100
103
# language type is determined by the file extension.
104
# This is set automatically if a .ino or .pde is found.
102
# LIBRARIES A list of arduino libraries to build and include.
106
# LIBRARIES A list of arduino libraries to build and include. This
107
# is set automatically if a .ino or .pde is found.
104
109
# This general-purpose makefile also defines the following goals for
105
110
# use on the command line when you run make:
123
128
# The full path to the arduino software, from arduino.cc
124
130
ARDUINODIR := $(wildcard ~/opt/arduino-1.0)
126
133
# check arduino software
127
134
ifeq ($(wildcard $(ARDUINODIR)/hardware/arduino/boards.txt), )
128
$(error ARDUINODIR is not set correctly at the top of arduino.mk)
135
$(error ARDUINODIR is not set correctly; arduino software not found)