/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-12-17 17:36:52 UTC
  • Revision ID: tim@ed.am-20121217173652-xl13iem0nxpl8sw8
updated THANKS

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