/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-11-30 15:13:27 UTC
  • Revision ID: tim@ed.am-20121130151327-scygxxvu0crec501
documented AVRDUDEFLAGS, CPPFLAGS, LINKFLAGS and LINBRARYPATH, cleaned up a
little bit, and fixed a tiny bug (called ecit, not exit, during an error)

Show diffs side-by-side

added added

removed removed

159
159
$(error ARDUINODIR is not set correctly; arduino software not found)
160
160
endif
161
161
 
162
 
# obtain preferences from the IDE's preferences.txt
163
 
PREFERENCES_FILE := $(wildcard $(HOME)/.arduino/preferences.txt)
164
 
ifneq "$(PREFERENCES_FILE)" ""
165
 
SKETCHBOOKDIR := \
166
 
        $(shell sed -ne "s/sketchbook.path=\(.*\)/\1/p" $(PREFERENCES_FILE))
167
 
endif
168
 
 
169
162
# default arduino version
170
163
ARDUINOCONST ?= 100
171
164
 
172
165
# default path for avr tools
173
 
AVRTOOLSPATH ?= $(subst :, , $(PATH)) $(ARDUINODIR)/hardware/tools \
174
 
        $(ARDUINODIR)/hardware/tools/avr/bin
 
166
ifndef AVRTOOLSPATH
 
167
AVRTOOLSPATH := $(subst :, , $(PATH))
 
168
AVRTOOLSPATH += $(ARDUINODIR)/hardware/tools
 
169
AVRTOOLSPATH += $(ARDUINODIR)/hardware/tools/avr/bin
 
170
endif
175
171
 
176
172
# default path to find libraries
177
 
LIBRARYPATH ?= libraries libs $(SKETCHBOOKDIR)/libraries $(ARDUINODIR)/libraries
 
173
LIBRARYPATH ?= libraries libs $(ARDUINODIR)/libraries
178
174
 
179
175
# auto mode?
180
176
INOFILE := $(wildcard *.ino *.pde)
262
258
        $(shell sed -ne "s/$(BOARD).build.vid=\(.*\)/\1/p" $(BOARDS_FILE))
263
259
BOARD_USB_PID := \
264
260
        $(shell sed -ne "s/$(BOARD).build.pid=\(.*\)/\1/p" $(BOARDS_FILE))
265
 
BOARD_BOOTLOADER_PATH := \
266
 
        $(shell sed -ne "s/$(BOARD).bootloader.path=\(.*\)/\1/p" $(BOARDS_FILE))
267
261
 
268
262
# invalid board?
269
263
ifeq "$(BOARD_BUILD_MCU)" ""
319
313
        @test 0 -eq $(SERIALDEVGUESS) || { \
320
314
                echo "*GUESSING* at serial device:" $(SERIALDEV); \
321
315
                echo; }
322
 
ifeq "$(BOARD_BOOTLOADER_PATH)" "caterina"
323
 
        stty $(STTYFARG) $(SERIALDEV) speed 1200
324
 
        sleep 1
325
 
endif
326
316
        stty $(STTYFARG) $(SERIALDEV) hupcl
327
317
        $(AVRDUDE) $(AVRDUDEFLAGS) -U flash:w:$(TARGET).hex:i
328
318