/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: Tim Marston
  • Date: 2013-07-05 16:30:19 UTC
  • Revision ID: tim@ed.am-20130705163019-sjm4ndbkjifj87u5
be stricter when extracting parameters from boards.txt

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.5dev
 
5
#                                                                 version 0.6dev
6
6
#
7
 
# Copyright (C) 2011, 2012 Tim Marston <tim@ed.am>.
 
7
# Copyright (C) 2011, 2012, 2013 Tim Marston <tim@ed.am>.
8
8
#
9
9
# Permission is hereby granted, free of charge, to any person obtaining a copy
10
10
# of this software and associated documentation files (the "Software"), to deal
198
198
 
199
199
# obtain board parameters from the arduino boards.txt file
200
200
BOARDSFILE := $(ARDUINODIR)/hardware/arduino/boards.txt
201
 
readboardsparam = $(shell sed -ne "s/$(BOARD).$(1)=\(.*\)/\1/p" $(BOARDSFILE))
 
201
readboardsparam = $(shell sed -ne "s/^$(BOARD).$(1)=\(.*\)/\1/p" $(BOARDSFILE))
202
202
BOARD_BUILD_MCU := $(call readboardsparam,build.mcu)
203
203
BOARD_BUILD_FCPU := $(call readboardsparam,build.f_cpu)
204
204
BOARD_BUILD_VARIANT := $(call readboardsparam,build.variant)
 
205
BOARD_BUILD_CORE := $(call readboardsparam,build.core)
205
206
BOARD_UPLOAD_SPEED := $(call readboardsparam,upload.speed)
206
207
BOARD_UPLOAD_PROTOCOL := $(call readboardsparam,upload.protocol)
207
208
BOARD_USB_VID := $(call readboardsparam,build.vid)
262
263
AVRSIZE := $(call findsoftware,avr-size)
263
264
 
264
265
# directories
265
 
ARDUINOCOREDIR := $(ARDUINODIR)/hardware/arduino/cores/arduino
 
266
ARDUINOCOREDIR := $(ARDUINODIR)/hardware/arduino/cores/$(BOARD_BUILD_CORE)
266
267
LIBRARYDIRS := $(foreach lib, $(LIBRARIES), \
267
268
        $(firstword $(wildcard $(addsuffix /$(lib), $(LIBRARYPATH)))))
268
269
LIBRARYDIRS += $(addsuffix /utility, $(LIBRARYDIRS))
335
336
ifeq "$(BOARD_BOOTLOADER_PATH)" "caterina"
336
337
        stty $(STTYFARG) $(SERIALDEV) speed 1200
337
338
        sleep 1
 
339
else
 
340
        stty $(STTYFARG) $(SERIALDEV) hupcl
338
341
endif
339
 
        stty $(STTYFARG) $(SERIALDEV) hupcl
340
342
        $(AVRDUDE) $(AVRDUDEFLAGS) -U flash:w:$(TARGET).hex:i
341
343
 
342
344
clean: