From e42d91ed4f0184347b03954b7ff8290b1bada9de Mon Sep 17 00:00:00 2001 From: stepcut Date: Mon, 13 Oct 2014 19:48:07 -0500 Subject: [PATCH 01/12] support for Teensy 3.x via Teensy.mk --- Teensy.mk | 136 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 Teensy.mk diff --git a/Teensy.mk b/Teensy.mk new file mode 100644 index 0000000..9c3c41a --- /dev/null +++ b/Teensy.mk @@ -0,0 +1,136 @@ +######################################################################## +# +# To use you will need to uncomment these lines in, +# $(ARDUINO_DIR)/hardware/$(VENDOR)/boards.txt +# +# teensy31.build.option6=-DUSB_SERIAL +# teensy31.build.option7=-DLAYOUT_US_ENGLISH +# + +VENDOR = teensy +ARDUINO_CORE_PATH = $(ARDUINO_DIR)/hardware/teensy/cores/teensy3 +BOARDS_TXT = $(ARDUINO_DIR)/hardware/$(VENDOR)/boards.txt + +ifndef F_CPU + F_CPU=72000000 +endif + +ifndef PARSE_TEENSY + # result = $(call READ_BOARD_TXT, 'boardname', 'parameter') + PARSE_TEENSY = $(shell grep -v "^\#" "$(BOARDS_TXT)" | grep $(1).$(2) | cut -d = -f 2,3 ) +endif + +ARCHITECTURE = $(call PARSE_TEENSY,$(BOARD_TAG),build.architecture) +AVR_TOOLS_DIR = $(call dir_if_exists,$(ARDUINO_DIR)/hardware/tools/$(ARCHITECTURE)) + +######################################################################## +# command names + +ifndef CC_NAME + CC_NAME := $(call PARSE_TEENSY,$(BOARD_TAG),build.command.gcc) + ifndef CC_NAME + CC_NAME := avr-gcc + else + $(call show_config_variable,CC_NAME,[COMPUTED]) + endif +endif + +ifndef CXX_NAME + CXX_NAME := $(call PARSE_TEENSY,$(BOARD_TAG),build.command.g++) + ifndef CXX_NAME + CXX_NAME := avr-g++ + else + $(call show_config_variable,CXX_NAME,[COMPUTED]) + endif +endif + +ifndef OBJCOPY_NAME + OBJCOPY_NAME := $(call PARSE_TEENSY,$(BOARD_TAG),build.command.objcopy) + ifndef OBJCOPY_NAME + OBJCOPY_NAME := avr-objcopy + else + $(call show_config_variable,OBJCOPY_NAME,[COMPUTED]) + endif +endif + +ifndef OBJDUMP_NAME + OBJDUMP_NAME := $(call PARSE_TEENSY,$(BOARD_TAG),build.command.objdump) + ifndef OBJDUMP_NAME + OBJDUMP_NAME := avr-objdump + else + $(call show_config_variable,OBJDUMP_NAME,[COMPUTED]) + endif +endif + +ifndef AR_NAME + AR_NAME := $(call PARSE_TEENSY,$(BOARD_TAG),build.command.ar) + ifndef AR_NAME + AR_NAME := avr-ar + else + $(call show_config_variable,AR_NAME,[COMPUTED]) + endif +endif + +ifndef SIZE_NAME + SIZE_NAME := $(call PARSE_TEENSY,$(BOARD_TAG),build.command.size) + ifndef SIZE_NAME + SIZE_NAME := avr-size + else + $(call show_config_variable,SIZE_NAME,[COMPUTED]) + endif +endif + +ifndef NM_NAME + NM_NAME := $(call PARSE_TEENSY,$(BOARD_TAG),build.command.nm) + ifndef NM_NAME + NM_NAME := avr-nm + else + $(call show_config_variable,NM_NAME,[COMPUTED]) + endif +endif + +# processor stuff +ifndef MCU + MCU := $(call PARSE_TEENSY,$(BOARD_TAG),build.cpu) + ifndef MCU + MCU := $(call PARSE_TEENSY,$(BOARD_TAG),build.mcu) + ifndef MCU + # might be a submenu + MCU := $(call PARSE_TEENSY,$(BOARD_TAG),menu.cpu.$(BOARD_SUB).build.mcu) + endif + else + MCU_FLAG_NAME=mcpu + endif +endif + +######################################################################## +# FLAGS + +CPPFLAGS += -DLAYOUT_US_ENGLISH -DUSB_SERIAL +CPPFLAGS += $(call PARSE_TEENSY,$(BOARD_TAG),build.option) + +CXXFLAGS += $(call PARSE_TEENSY,$(BOARD_TAG),build.cppoption) +ifeq ("$(call PARSE_TEENSY,$(BOARD_TAG),build.gnu0x)","true") + CXXFLAGS_STD += -std=gnu++0x +endif + +ifeq ("$(call PARSE_TEENSY,$(BOARD_TAG),build.elide_constructors)", "true") + CXXFLAGS += -felide-constructors +endif + +LDFLAGS += $(call PARSE_TEENSY,$(BOARD_TAG),build.linkoption) $(call PARSE_TEENSY,$(BOARD_TAG),build.additionalobject) + +ifneq ("$(call PARSE_TEENSY,$(BOARD_TAG),build.linkscript)",) + LDFLAGS += -T$(ARDUINO_CORE_PATH)/$(call PARSE_TEENSY,$(BOARD_TAG),build.linkscript) +endif + +MONITOR_PORT = /bin/true +AVRDUDE = true + +RESET_CMD = nohup $(ARDUINO_DIR)/hardware/tools/teensy_post_compile -board=$(BOARD_TAG) -tools=$(abspath $(ARDUINO_DIR)/hardware/tools) -path=$(abspath $(OBJDIR)) -file=$(TARGET) > /dev/null ; $(ARDUINO_DIR)/hardware/tools/teensy_reboot ; true + +ifndef ARDMK_DIR + ARDMK_DIR := $(realpath $(dir $(realpath $(lastword $(MAKEFILE_LIST))))) +endif + +include $(ARDMK_DIR)/Arduino.mk From 969a468bedea20af7d536683feb934212472e843 Mon Sep 17 00:00:00 2001 From: stepcut Date: Mon, 13 Oct 2014 19:57:24 -0500 Subject: [PATCH 02/12] minor tweaks to Teensy.mk --- Teensy.mk | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Teensy.mk b/Teensy.mk index 9c3c41a..43de891 100644 --- a/Teensy.mk +++ b/Teensy.mk @@ -44,6 +44,15 @@ ifndef CXX_NAME endif endif +ifndef AS_NAME + AS_NAME := $(call PARSE_TEENSY,$(BOARD_TAG),build.command.as) + ifndef AS_NAME + AS_NAME := arm-none-eabi-gcc-as + else + $(call show_config_variable,AS_NAME,[COMPUTED]) + endif +endif + ifndef OBJCOPY_NAME OBJCOPY_NAME := $(call PARSE_TEENSY,$(BOARD_TAG),build.command.objcopy) ifndef OBJCOPY_NAME @@ -83,7 +92,7 @@ endif ifndef NM_NAME NM_NAME := $(call PARSE_TEENSY,$(BOARD_TAG),build.command.nm) ifndef NM_NAME - NM_NAME := avr-nm + NM_NAME := arm-none-eabi-gcc-nm else $(call show_config_variable,NM_NAME,[COMPUTED]) endif @@ -94,10 +103,6 @@ ifndef MCU MCU := $(call PARSE_TEENSY,$(BOARD_TAG),build.cpu) ifndef MCU MCU := $(call PARSE_TEENSY,$(BOARD_TAG),build.mcu) - ifndef MCU - # might be a submenu - MCU := $(call PARSE_TEENSY,$(BOARD_TAG),menu.cpu.$(BOARD_SUB).build.mcu) - endif else MCU_FLAG_NAME=mcpu endif From d029fab8f029ffcdaa0721055a7dc5d708d3a0ec Mon Sep 17 00:00:00 2001 From: stepcut Date: Wed, 15 Oct 2014 18:29:26 -0500 Subject: [PATCH 03/12] Teensy.mk: default to arm-none-eabi-xxx for executable names. Tweak the upload/reset stuff a little more. Add COPYRIGHT block. --- Teensy.mk | 53 +++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 39 insertions(+), 14 deletions(-) diff --git a/Teensy.mk b/Teensy.mk index 43de891..3b9676d 100644 --- a/Teensy.mk +++ b/Teensy.mk @@ -1,18 +1,36 @@ ######################################################################## # -# To use you will need to uncomment these lines in, -# $(ARDUINO_DIR)/hardware/$(VENDOR)/boards.txt +# Support for Teensy 3.x boards # -# teensy31.build.option6=-DUSB_SERIAL -# teensy31.build.option7=-DLAYOUT_US_ENGLISH +# https://www.pjrc.com/teensy/ # +# Example sketch: https://github.com/stepcut/teensy-blink +# +# Copyright (C) 2014 Jeremy Shaw based on +# work that is copyright Sudar, Nicholas Zambetti, David A. Mellis +# & Hernando Barragan. +# +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as +# published by the Free Software Foundation; either version 2.1 of the +# License, or (at your option) any later version. +# +# Adapted from Arduino 0011 Makefile by M J Oldfield +# +# Original Arduino adaptation by mellis, eighthave, oli.keller +# +# Current version: 1.3.4 +# +# Refer to HISTORY.md file for complete history of changes +# +######################################################################## VENDOR = teensy ARDUINO_CORE_PATH = $(ARDUINO_DIR)/hardware/teensy/cores/teensy3 BOARDS_TXT = $(ARDUINO_DIR)/hardware/$(VENDOR)/boards.txt ifndef F_CPU - F_CPU=72000000 + F_CPU=96000000 endif ifndef PARSE_TEENSY @@ -29,7 +47,7 @@ AVR_TOOLS_DIR = $(call dir_if_exists,$(ARDUINO_DIR)/hardware/tools/$(ARCHITECTUR ifndef CC_NAME CC_NAME := $(call PARSE_TEENSY,$(BOARD_TAG),build.command.gcc) ifndef CC_NAME - CC_NAME := avr-gcc + CC_NAME := arm-none-eabi-gcc else $(call show_config_variable,CC_NAME,[COMPUTED]) endif @@ -38,7 +56,7 @@ endif ifndef CXX_NAME CXX_NAME := $(call PARSE_TEENSY,$(BOARD_TAG),build.command.g++) ifndef CXX_NAME - CXX_NAME := avr-g++ + CXX_NAME := arm-none-eabi-g++ else $(call show_config_variable,CXX_NAME,[COMPUTED]) endif @@ -56,7 +74,7 @@ endif ifndef OBJCOPY_NAME OBJCOPY_NAME := $(call PARSE_TEENSY,$(BOARD_TAG),build.command.objcopy) ifndef OBJCOPY_NAME - OBJCOPY_NAME := avr-objcopy + OBJCOPY_NAME := arm-none-eabi-objcopy else $(call show_config_variable,OBJCOPY_NAME,[COMPUTED]) endif @@ -65,7 +83,7 @@ endif ifndef OBJDUMP_NAME OBJDUMP_NAME := $(call PARSE_TEENSY,$(BOARD_TAG),build.command.objdump) ifndef OBJDUMP_NAME - OBJDUMP_NAME := avr-objdump + OBJDUMP_NAME := arm-none-eabi-objdump else $(call show_config_variable,OBJDUMP_NAME,[COMPUTED]) endif @@ -74,7 +92,7 @@ endif ifndef AR_NAME AR_NAME := $(call PARSE_TEENSY,$(BOARD_TAG),build.command.ar) ifndef AR_NAME - AR_NAME := avr-ar + AR_NAME := arm-none-eabi-ar else $(call show_config_variable,AR_NAME,[COMPUTED]) endif @@ -83,7 +101,7 @@ endif ifndef SIZE_NAME SIZE_NAME := $(call PARSE_TEENSY,$(BOARD_TAG),build.command.size) ifndef SIZE_NAME - SIZE_NAME := avr-size + SIZE_NAME := arm-none-eabi-size else $(call show_config_variable,SIZE_NAME,[COMPUTED]) endif @@ -129,10 +147,17 @@ ifneq ("$(call PARSE_TEENSY,$(BOARD_TAG),build.linkscript)",) LDFLAGS += -T$(ARDUINO_CORE_PATH)/$(call PARSE_TEENSY,$(BOARD_TAG),build.linkscript) endif -MONITOR_PORT = /bin/true -AVRDUDE = true +######################################################################## +# some fairly odd settings so that 'make upload' works +# +# may require additional patches for Windows support -RESET_CMD = nohup $(ARDUINO_DIR)/hardware/tools/teensy_post_compile -board=$(BOARD_TAG) -tools=$(abspath $(ARDUINO_DIR)/hardware/tools) -path=$(abspath $(OBJDIR)) -file=$(TARGET) > /dev/null ; $(ARDUINO_DIR)/hardware/tools/teensy_reboot ; true +do_upload: override get_monitor_port="" +AVRDUDE=@true +RESET_CMD = nohup $(ARDUINO_DIR)/hardware/tools/teensy_post_compile -board=$(BOARD_TAG) -tools=$(abspath $(ARDUINO_DIR)/hardware/tools) -path=$(abspath $(OBJDIR)) -file=$(TARGET) > /dev/null ; $(ARDUINO_DIR)/hardware/tools/teensy_reboot + +######################################################################## +# automatially include Arduino.mk for the user ifndef ARDMK_DIR ARDMK_DIR := $(realpath $(dir $(realpath $(lastword $(MAKEFILE_LIST))))) From b6eb4a86863023a2fa55a7f7596b8091ec04d8a6 Mon Sep 17 00:00:00 2001 From: stepcut Date: Wed, 15 Oct 2014 18:33:11 -0500 Subject: [PATCH 04/12] Added Teensy to HISTORY.md --- HISTORY.md | 1 + 1 file changed, 1 insertion(+) diff --git a/HISTORY.md b/HISTORY.md index 9b2d3c5..45430ec 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -11,6 +11,7 @@ I tried to give credit whenever possible. If I have missed anyone, kindly add it - New: Add documentation about CFLAGS_STD and CXXFLAGS_STD (Issue #234) (https://github.com/ladislas) - New: Allow "make clean" target to be extended (Issue #239). (https://github.com/sej7278) - New: Add makefile and gcc version info to config output. (https://github.com/sej7278) +- New: Support for Teensy 3.x (https://github.com/stepcut) - Tweak: Remove $(EXTRA_XXX) variables (Issue #234) (https://github.com/ladislas) - Tweak: Update Malefile-example.mk with STD flags (https://github.com/ladislas) From edf90842c55435a23151c74ef274e71d69b5e510 Mon Sep 17 00:00:00 2001 From: stepcut Date: Wed, 22 Oct 2014 12:23:52 -0500 Subject: [PATCH 05/12] Added BlinkTeensy example which uses the Teensy.mk file. --- examples/BlinkTeensy/Blink.ino | 19 +++++++++++++++++++ examples/BlinkTeensy/Makefile | 5 +++++ 2 files changed, 24 insertions(+) create mode 100644 examples/BlinkTeensy/Blink.ino create mode 100644 examples/BlinkTeensy/Makefile diff --git a/examples/BlinkTeensy/Blink.ino b/examples/BlinkTeensy/Blink.ino new file mode 100644 index 0000000..f9a59a9 --- /dev/null +++ b/examples/BlinkTeensy/Blink.ino @@ -0,0 +1,19 @@ +/* + Blink + Turns on an LED on for one second, then off for one second, repeatedly. + + This example code is in the public domain. + */ + +void setup() { + // initialize the digital pin as an output. + // Pin 13 has an LED connected on most Arduino boards: + pinMode(13, OUTPUT); +} + +void loop() { + digitalWrite(13, HIGH); // set the LED on + delay(1000); // wait for a second + digitalWrite(13, LOW); // set the LED off + delay(1000); // wait for a second +} diff --git a/examples/BlinkTeensy/Makefile b/examples/BlinkTeensy/Makefile new file mode 100644 index 0000000..84ae31f --- /dev/null +++ b/examples/BlinkTeensy/Makefile @@ -0,0 +1,5 @@ +ARDUINO_DIR = /home/stepcut/n-heptane/projects/arduino/arduino-1.0.6 +BOARD_TAG = teensy31 +ARDUINO_LIBS = + +include ../../Teensy.mk From 1f5e0b33671fe1032163a3a8e3af9366cd758b9b Mon Sep 17 00:00:00 2001 From: stepcut Date: Wed, 22 Oct 2014 12:29:36 -0500 Subject: [PATCH 06/12] Make BlinkTeensy a NON_TESTABLE_EXAMPLES --- tests/script/runtests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/script/runtests.sh b/tests/script/runtests.sh index 5313d0f..f45fa3f 100755 --- a/tests/script/runtests.sh +++ b/tests/script/runtests.sh @@ -7,7 +7,7 @@ failures=() # These examples cannot be tested easily at the moment as they require # alternate cores. The MakefileExample doesn't actually contain any source code # to compile. -NON_TESTABLE_EXAMPLES=(ATtinyBlink MakefileExample TinySoftWareSerial) +NON_TESTABLE_EXAMPLES=(ATtinyBlink MakefileExample TinySoftWareSerial BlinkTeensy) for dir in $TESTS_DIR/*/ do From 6534cf8f15e64df55bb98576e43fb46855bdbd2a Mon Sep 17 00:00:00 2001 From: stepcut Date: Wed, 22 Oct 2014 15:27:59 -0500 Subject: [PATCH 07/12] move ARDUINO_DIR auto-detection into Common.mk. This allows Teensy.mk to use auto-detected location. --- Arduino.mk | 23 ----------------------- Common.mk | 23 +++++++++++++++++++++++ Teensy.mk | 33 ++++++++++++++++++++++++--------- examples/BlinkTeensy/Makefile | 1 - 4 files changed, 47 insertions(+), 33 deletions(-) diff --git a/Arduino.mk b/Arduino.mk index 76a7d5e..beda93e 100644 --- a/Arduino.mk +++ b/Arduino.mk @@ -262,29 +262,6 @@ else $(call show_config_variable,ARDMK_DIR,[USER]) endif -######################################################################## -# Arduino Directory - -ifndef ARDUINO_DIR - AUTO_ARDUINO_DIR := $(firstword \ - $(call dir_if_exists,/usr/share/arduino) \ - $(call dir_if_exists,/Applications/Arduino.app/Contents/Resources/Java) ) - ifdef AUTO_ARDUINO_DIR - ARDUINO_DIR = $(AUTO_ARDUINO_DIR) - $(call show_config_variable,ARDUINO_DIR,[AUTODETECTED]) - else - echo $(error "ARDUINO_DIR is not defined") - endif -else - $(call show_config_variable,ARDUINO_DIR,[USER]) -endif - -ifeq ($(CURRENT_OS),WINDOWS) - ifneq ($(shell echo $(ARDUINO_DIR) | egrep '^(/|[a-zA-Z]:\\)'),) - echo $(error On Windows, ARDUINO_DIR must be a relative path) - endif -endif - ######################################################################## # Default TARGET to pwd (ex Daniele Vergini) diff --git a/Common.mk b/Common.mk index 0c1bc0b..b77c644 100644 --- a/Common.mk +++ b/Common.mk @@ -45,6 +45,29 @@ else endif $(call show_config_variable,CURRENT_OS,[AUTODETECTED]) +######################################################################## +# Arduino Directory + +ifndef ARDUINO_DIR + AUTO_ARDUINO_DIR := $(firstword \ + $(call dir_if_exists,/usr/share/arduino) \ + $(call dir_if_exists,/Applications/Arduino.app/Contents/Resources/Java) ) + ifdef AUTO_ARDUINO_DIR + ARDUINO_DIR = $(AUTO_ARDUINO_DIR) + $(call show_config_variable,ARDUINO_DIR,[AUTODETECTED]) + else + echo $(error "ARDUINO_DIR is not defined") + endif +else + $(call show_config_variable,ARDUINO_DIR,[USER]) +endif + +ifeq ($(CURRENT_OS),WINDOWS) + ifneq ($(shell echo $(ARDUINO_DIR) | egrep '^(/|[a-zA-Z]:\\)'),) + echo $(error On Windows, ARDUINO_DIR must be a relative path) + endif +endif + ######################################################################## # # Travis-CI diff --git a/Teensy.mk b/Teensy.mk index 3b9676d..42282aa 100644 --- a/Teensy.mk +++ b/Teensy.mk @@ -4,7 +4,9 @@ # # https://www.pjrc.com/teensy/ # -# Example sketch: https://github.com/stepcut/teensy-blink +# You must install teensyduino for this Makefile to work: +# +# http://www.pjrc.com/teensy/teensyduino.html # # Copyright (C) 2014 Jeremy Shaw based on # work that is copyright Sudar, Nicholas Zambetti, David A. Mellis @@ -19,12 +21,18 @@ # # Original Arduino adaptation by mellis, eighthave, oli.keller # -# Current version: 1.3.4 -# # Refer to HISTORY.md file for complete history of changes # ######################################################################## + +ifndef ARDMK_DIR + ARDMK_DIR := $(realpath $(dir $(realpath $(lastword $(MAKEFILE_LIST))))) +endif + +# include Common.mk now we know where it is +include $(ARDMK_DIR)/Common.mk + VENDOR = teensy ARDUINO_CORE_PATH = $(ARDUINO_DIR)/hardware/teensy/cores/teensy3 BOARDS_TXT = $(ARDUINO_DIR)/hardware/$(VENDOR)/boards.txt @@ -121,11 +129,22 @@ ifndef MCU MCU := $(call PARSE_TEENSY,$(BOARD_TAG),build.cpu) ifndef MCU MCU := $(call PARSE_TEENSY,$(BOARD_TAG),build.mcu) - else - MCU_FLAG_NAME=mcpu endif endif +ifndef MCU_FLAG_NAME + MCU_FLAG_NAME=mcpu +endif + +#ifndef MCU +# MCU := $(call PARSE_TEENSY,$(BOARD_TAG),build.cpu) +# ifndef MCU +# MCU := $(call PARSE_TEENSY,$(BOARD_TAG),build.mcu) +# else +# MCU_FLAG_NAME=mcpu +# endif +#endif + ######################################################################## # FLAGS @@ -159,8 +178,4 @@ RESET_CMD = nohup $(ARDUINO_DIR)/hardware/tools/teensy_post_compile -board=$(BOA ######################################################################## # automatially include Arduino.mk for the user -ifndef ARDMK_DIR - ARDMK_DIR := $(realpath $(dir $(realpath $(lastword $(MAKEFILE_LIST))))) -endif - include $(ARDMK_DIR)/Arduino.mk diff --git a/examples/BlinkTeensy/Makefile b/examples/BlinkTeensy/Makefile index 84ae31f..1d59ef2 100644 --- a/examples/BlinkTeensy/Makefile +++ b/examples/BlinkTeensy/Makefile @@ -1,4 +1,3 @@ -ARDUINO_DIR = /home/stepcut/n-heptane/projects/arduino/arduino-1.0.6 BOARD_TAG = teensy31 ARDUINO_LIBS = From 1cddbfb2f4a27e3679c709a0229101ea254c213b Mon Sep 17 00:00:00 2001 From: stepcut Date: Wed, 22 Oct 2014 15:29:43 -0500 Subject: [PATCH 08/12] Teensy.mk: simplify setting of MCU and MCU_FLAG_NAME --- Teensy.mk | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/Teensy.mk b/Teensy.mk index 42282aa..dc807a8 100644 --- a/Teensy.mk +++ b/Teensy.mk @@ -127,24 +127,12 @@ endif # processor stuff ifndef MCU MCU := $(call PARSE_TEENSY,$(BOARD_TAG),build.cpu) - ifndef MCU - MCU := $(call PARSE_TEENSY,$(BOARD_TAG),build.mcu) - endif endif ifndef MCU_FLAG_NAME MCU_FLAG_NAME=mcpu endif -#ifndef MCU -# MCU := $(call PARSE_TEENSY,$(BOARD_TAG),build.cpu) -# ifndef MCU -# MCU := $(call PARSE_TEENSY,$(BOARD_TAG),build.mcu) -# else -# MCU_FLAG_NAME=mcpu -# endif -#endif - ######################################################################## # FLAGS From f162d8fee325cd4c31f17d8b3bcc8670fd5004a4 Mon Sep 17 00:00:00 2001 From: stepcut Date: Wed, 22 Oct 2014 15:43:01 -0500 Subject: [PATCH 09/12] put ARDUINO_DIR block after Travis-CI block else travis will fail. --- Common.mk | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/Common.mk b/Common.mk index b77c644..65a487a 100644 --- a/Common.mk +++ b/Common.mk @@ -45,6 +45,23 @@ else endif $(call show_config_variable,CURRENT_OS,[AUTODETECTED]) +######################################################################## +# +# Travis-CI +ifneq ($(TEST),) + DEPENDENCIES_DIR = /var/tmp/Arduino-Makefile-testing-dependencies + + DEPENDENCIES_MPIDE_DIR = $(DEPENDENCIES_DIR)/mpide-0023-linux64-20130817-test + ifeq ($(MPIDE_DIR),) + MPIDE_DIR = $(DEPENDENCIES_MPIDE_DIR) + endif + + DEPENDENCIES_ARDUINO_DIR = $(DEPENDENCIES_DIR)/arduino-1.0.6 + ifeq ($(ARDUINO_DIR),) + ARDUINO_DIR = $(DEPENDENCIES_ARDUINO_DIR) + endif +endif + ######################################################################## # Arduino Directory @@ -67,20 +84,3 @@ ifeq ($(CURRENT_OS),WINDOWS) echo $(error On Windows, ARDUINO_DIR must be a relative path) endif endif - -######################################################################## -# -# Travis-CI -ifneq ($(TEST),) - DEPENDENCIES_DIR = /var/tmp/Arduino-Makefile-testing-dependencies - - DEPENDENCIES_MPIDE_DIR = $(DEPENDENCIES_DIR)/mpide-0023-linux64-20130817-test - ifeq ($(MPIDE_DIR),) - MPIDE_DIR = $(DEPENDENCIES_MPIDE_DIR) - endif - - DEPENDENCIES_ARDUINO_DIR = $(DEPENDENCIES_DIR)/arduino-1.0.6 - ifeq ($(ARDUINO_DIR),) - ARDUINO_DIR = $(DEPENDENCIES_ARDUINO_DIR) - endif -endif From daacad1d77306a37d3df5423feca27d3f5d730f7 Mon Sep 17 00:00:00 2001 From: stepcut Date: Wed, 22 Oct 2014 16:44:53 -0500 Subject: [PATCH 10/12] added info about Teensy to README.md --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 1e12785..2b7cf4c 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ This is a very simple Makefile which knows how to build Arduino sketches. It def - Highly customizable - Supports all official AVR-based Arduino boards - Supports chipKIT +- Supports Teensy 3.x (via Teensyduino) - Works on all three major OS (Mac, Linux, Windows) - Auto detects serial baud rate and libraries used - Support for `*.ino` and `*.pde` sketches as well as raw `*.c` and `*.cpp` @@ -156,6 +157,12 @@ To upload compiled files, `avrdude` is used. This Makefile tries to find `avrdud AVRDUDE = /usr/bin/avrdude AVRDUDE_CONF = /etc/avrdude.conf +## Teensy 3.x + +For Teensy 3.x support you must first install [Teensyduino](http://www.pjrc.com/teensy/teensyduino.html). + +See examples/BlinkTeensy for example usage. + ## Versioning The current version of the makefile is `1.3.4`. You can find the full history in the [HISTORY.md](HISTORY.md) file From a2c8fe51968cf6588217d3187a674d1c44d506f0 Mon Sep 17 00:00:00 2001 From: Simon John Date: Thu, 23 Oct 2014 23:44:14 +0100 Subject: [PATCH 11/12] Add's "avrispmkii" to the list of ISP's that don't have a port, defaults to reading communication_type from avrdude.conf, which is "usb" usually, rather than setting the -P flag which is the user override. --- Arduino.mk | 2 +- HISTORY.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Arduino.mk b/Arduino.mk index fb5db4f..40f4a01 100644 --- a/Arduino.mk +++ b/Arduino.mk @@ -1310,7 +1310,7 @@ endif AVRDUDE_ISP_OPTS = -c $(ISP_PROG) -b $(AVRDUDE_ISP_BAUDRATE) ifndef $(ISP_PORT) - ifneq ($(strip $(ISP_PROG)),$(filter $(ISP_PROG), usbasp usbtiny gpio)) + ifneq ($(strip $(ISP_PROG)),$(filter $(ISP_PROG), usbasp usbtiny gpio avrispmkii)) AVRDUDE_ISP_OPTS += -P $(call get_isp_port) endif else diff --git a/HISTORY.md b/HISTORY.md index 402fd35..e432658 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -28,6 +28,7 @@ I tried to give credit whenever possible. If I have missed anyone, kindly add it - Fix: Allow user libaries/sketches to have the same name as system libs. (Issue #244, #229). (https://github.com/sej7278) - Fix: Remove impact of travis-ci from regular users. (Issue #258). (https://github.com/sej7278) - Fix: objcopy quoting issue on Windows. (Issue #272). (https://github.com/sej7278) +- Fix: Add "avrispmkii" to the list of isp that don't have a port. (Issue #279). (https://github.com/sej7278) ### 1.3.4 (2014-07-12) - Tweak: Allow spaces in "Serial.begin (....)". (Issue #190) (https://github.com/pdav) From 713997d6024a323216a97136fc2f06abf56a5f57 Mon Sep 17 00:00:00 2001 From: Simon John Date: Wed, 5 Nov 2014 15:09:43 +0000 Subject: [PATCH 12/12] Made CXX compile *.cpp files instead of CC. Fixes issue #285 --- Arduino.mk | 6 +++--- HISTORY.md | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Arduino.mk b/Arduino.mk index 1e840bf..0c29498 100644 --- a/Arduino.mk +++ b/Arduino.mk @@ -1079,7 +1079,7 @@ $(OBJDIR)/libs/%.o: $(ARDUINO_LIB_PATH)/%.c $(OBJDIR)/libs/%.o: $(ARDUINO_LIB_PATH)/%.cpp @$(MKDIR) $(dir $@) - $(CC) -MMD -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@ + $(CXX) -MMD -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@ $(OBJDIR)/libs/%.o: $(ARDUINO_LIB_PATH)/%.S @$(MKDIR) $(dir $@) @@ -1091,7 +1091,7 @@ $(OBJDIR)/platformlibs/%.o: $(ARDUINO_PLATFORM_LIB_PATH)/%.c $(OBJDIR)/platformlibs/%.o: $(ARDUINO_PLATFORM_LIB_PATH)/%.cpp @$(MKDIR) $(dir $@) - $(CC) -MMD -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@ + $(CXX) -MMD -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@ $(OBJDIR)/platformlibs/%.o: $(ARDUINO_PLATFORM_LIB_PATH)/%.S @$(MKDIR) $(dir $@) @@ -1099,7 +1099,7 @@ $(OBJDIR)/platformlibs/%.o: $(ARDUINO_PLATFORM_LIB_PATH)/%.S $(OBJDIR)/userlibs/%.o: $(USER_LIB_PATH)/%.cpp @$(MKDIR) $(dir $@) - $(CC) -MMD -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@ + $(CXX) -MMD -c $(CPPFLAGS) $(CXXFLAGS) $< -o $@ $(OBJDIR)/userlibs/%.o: $(USER_LIB_PATH)/%.c @$(MKDIR) $(dir $@) diff --git a/HISTORY.md b/HISTORY.md index 7fe05a9..0b82eca 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -30,6 +30,7 @@ I tried to give credit whenever possible. If I have missed anyone, kindly add it - Fix: Remove impact of travis-ci from regular users. (Issue #258). (https://github.com/sej7278) - Fix: objcopy quoting issue on Windows. (Issue #272). (https://github.com/sej7278) - Fix: Add "avrispmkii" to the list of isp that don't have a port. (Issue #279). (https://github.com/sej7278) +- Fix: Make CXX compile .cpp files instead of CC. (Issue #285). (https://github.com/sej7278) ### 1.3.4 (2014-07-12) - Tweak: Allow spaces in "Serial.begin (....)". (Issue #190) (https://github.com/pdav)