Commit graph

229 commits

Author SHA1 Message Date
John Whittington
264f8f604a Arduino IDE upto support version and SAMD builds
process uses direct downloads. Might be better to move to distribution
Arduino install + arduino-cli to install board support in future.
2020-08-06 12:32:17 +02:00
John Whittington
517fe4a632 Merge remote-tracking branch 'sej7278/python3' 2020-08-05 18:22:29 +02:00
Simon John
207253abc6 Rebased python3 branch with some changes from tuna-f1sh@87d5241 2020-08-04 23:19:49 +01:00
John Whittington
93b251a4e1 Merge branch 'master' of https://github.com/sudar/Arduino-Makefile into HEAD 2020-02-24 09:57:13 +01:00
Taylor Zowtuk
fa2146080c Updated changelog 2019-07-19 11:11:58 -06:00
John Whittington
62caf00a15 Add new *_VER variables to documentation 2019-07-18 11:10:42 +02:00
SZEDER Gábor
d4ae799795 Build the ArduinoCore API
As part of the big modularizing efforts of the Arduino project they
split out the hardware-independent layer of the Arduino "language"
from the hardware-specific cores into the dedicated 'ArduinoCore-API'
repository.  As described in 'ArduinoCore-API's README, the API source
files won't reside directly in the directory of the standard Arduino
core, i.e. in 'ARDUINO_CORE_PATH', but in its 'ARDUINO_CORE_PATH/api'
subdirectory.  Consequently, Arduino-Makefile won't be able to build
any projects when using an Arduino core following the new directory
structure.

Prepare for the upcoming new Arduino core directory structure by
building all 'ARDUINO_CORE_PATH/api/*.cpp' source files as well.  Out
of caution, look out for and build any .c source files in that
directory, too: though there are no .c source files in the
'ArduinoCore-API' repository at the moment, in the future there might
be.  Furthermore, add this directory to the list of directories to be
searched for header files: though it's not necessary to explicitly and
directly include any header file from this directory ('Arduino.h'
includes all there is), some projects might nonetheless do so, and
their build would then break.

Note that a 'make clean' will be most likely necessary when
re-building a project after switching to the new directory structure.
2019-07-04 22:19:18 +02:00
SZEDER Gábor
dafdaafabd Show the configuration when ARDUINO_QUIET=0
There is a bit of inconsistency between documentation and code
regarding the ARDUINO_QUIET variable: 'arduino-mk-vars.md' states
that ARDUINO_QUIET "Defaults to `0` (unset/disabled)", but the code
only checks whether it's defined or not, and doesn't check whether
it's set to '0' or something else.

Consequently, having 'ARDUINO_QUIET=0' in the Makefile or running
'make ARDUINO_QUIET=0' contadicts the documentation and doesn't print
the configuration.  It also means that if someone in general prefers
not to see a screenful of configuration on each build and therefore
has 'ARDUINO_QUIET = 1' in the project's Makefile or 'config.mak',
then there is no way to override it from the command line in the odd
case when showing the configuration is desired.

Modify the corresponding condition in Arduino.mk to check whether
ARDUINO_QUIET is set to 0 and treat an undefined ARDUINO_QUIET
variable as "set to 0" as well.
2019-06-12 17:15:27 +02:00
Sudar Muthu
8c85ca7001
Merge pull request #598 from Dukejung/master
Add OpenCR.mk for OpenCR 1.0 board example sketch
2019-04-20 14:37:12 +05:30
Simon John
4e465c693c
Update HISTORY.md 2019-04-01 10:30:33 +01:00
Dukejung
c9d9c9f34d
Update HISTORY.md 2019-02-11 17:50:05 +09:00
John Whittington
8a313c5d94 Populate USB_PRODUCT and USB_MANUFACTURER if in boards file using Caterina 2019-01-11 11:17:16 +00:00
Simon John
fd24677719
Updated history
Added ArchLinux documentation uplift
2018-11-27 15:45:59 +00:00
Donna Whisnant
35fece8b9c Change BOARD_SPEED to BOARD_CLOCK setting and extend to menu.clock and menu.speed.
This is needed to specify CPU speed and fuses for boards.txt files that use this format:
"{board_tag}.menu.clock.{board_clock}.build.f_cpu"
"{board_tag}.menu.clock.{board_clock}.bootloader.low_fuses"
"{board_tag}.menu.clock.{board_clock}.bootloader.high_fuses"
"{board_tag}.menu.clock.{board_clock}.bootloader.extended_fuses"
For example ATtiny processors.

It also works for speed-only settings like the Watterott ATmega328PB library: https://github.com/watterott/ATmega328PB-Testing
"{board_tag}.menu.speed.{board_clock}.build.f_cpu"
2018-11-11 17:14:11 -06:00
Donna Whisnant
66e0211878 Update documentation for BOARD_SPEED. 2018-11-11 13:27:11 -06:00
Pieter du Preez
a285810cb5 Added a test case for moving CORE_LIB in PR #583.
This patch is meant to test the link order, if the OTHER_OBJS
variable gets used to add 3rd party archives, that depend on the
Arduino core lib (the archive pointed to by the CORE_LIB variable).

The examples/Blink3rdPartyLib directory contains a stripped down Blink
and includes a library in the examples/Blink3rdPartyLib/Toggle
sub-directory. The archive, built inside the Toggle directory mimics a
3rd party library. The archive gets built and linked in by using the
OTHER_OBS variable in examples/Blink3rdPartyLib/Makefile.
2018-10-02 23:00:14 +02:00
Pieter du Preez
e44540043e Added the TOOL_PREFIX variable for setting up the executable tools.
Currently three different tool chains seem to be used:
   * avr-*
   * pic32-*
   * arm-none-eabi-*

These all get set up independently. This patch centralizes the
definitions of the executable tools and does it generically, by means
of the newly introduced TOOL_PREFIX variable. Setting up a
tool chain is now simply a matter of defining the TOOL_PREFIX
variable. For the currently supported tool chains it gets set to avr,
pic32 or arm-none-eabi. Arbitrary tool chains can now easily be set up,
by the TOOL_PREFIX variable.

Although the use of the OVERRIDE_EXECUTABLES variable is now almost
not justifiable, it was left as-is, in order to assure backwards
compatibility.
2018-09-14 16:14:14 +02:00
Pieter du Preez
2442dafb4f Moved the PARSE_BOARD macro from Arduino.mk to Common.mk.
There seems to be 3 different macros to parse the boards.txt file.
This patch moves the PARSE_BOARD macro from Arduino.mk to Common.mk.
The PARSE_OPENCM and PARSE_TEENSY macros in Teensy.mk and OpenCM.mk
were removed and the common PARSE_BOARD is now being called from
everywhere.

Advantages of this fix are:
  1. Less code, i.e. no redundant parse macros.
  2. A single standardized algorithm to parse the boards.txt file.
2018-09-13 23:44:12 +02:00
John Whittington
3f32563683 Support for Arduino Due added
Update HISTORY.md

Add avr core emulation to C sources
2018-06-14 07:29:06 +01:00
Pieter du Preez
36b6b233eb Added the DIAGNOSTICS_COLOR_WHEN var for controlling diagnostics-color.
Some IDEs do not work nicely with the recently added diagnostics-color
compiler switch. This patch adds the DIAGNOSTICS_COLOR_WHEN variable,
for controlling diagnostics-color switch. The default was chosen to be
'always', which makes the Arduino.mk file backwards compatible with
everything up to commit fa82c3a9db (Sat Sep 2 15:32:52 2017 +0100).

The supported values for DIAGNOSTICS_COLOR_WHEN are: `always`, `never`
and `auto`, and as with all Arduino.mk variables, it can easily be
overridden. For more details on the diagnostics-color compiler switch,
see: https://gcc.gnu.org/onlinedocs/gcc-4.9.2/gcc/Language-Independent-Options.html#Language-Independent-Options
2018-03-18 16:54:39 +01:00
Simon John
139b5dbc49
Merge branch 'master' into disable-prog-types-compat 2018-02-24 16:03:37 +00:00
John Whittington
f804866095 SAMD Cortex M0 device support (Zero, MKR1000, etc)
Compilation improvements by adding variant as other obj but not working on device

Arduino Zero devices with OpenOCD working

Created ARM_TOOLS_DIR and define arm toolchain executables in Sam.mk

Check avr-gcc on last AVR_TOOLS_DIR detect and indenting formatting

GDB debugging and programming added

Documentation updates and define ARDMK_VENDOR rather than include Sam.mk

Expand all parse_boards when defined rather than when used

Trim extra defines regex working on both macOS and Linux but need better fix

Print USB ids and added debug usage to readme

Add note on Arduino package dir and made board.txt work

Do ARM ARDUINO_ARCH define in Arduino.mk]

Add MZeroBlink to non-testable examples for now

Remove \B from extra defines grep

Add ARDUINO_PACKAGE_DIR for board support files

Fix a typo in the README

Fix typo in arduino-mk-vars.md

Prevent re-including Arduino.mk from Sam.mk when make restarts for upload

Add catrina to ARD_REST_OPTS if/else

Remove realpath in Sam.mk for cygwin compatability

SAMD bootloader support in ard-reset using --zero

Enters bootloader using open/close of port at 1200 BAUD, then polls the
attached devices for new port enumerating (bootloader). This is how the
Arduino IDE operates

Bossa support for Zero, MKR1000 etc

Re-word Arm README section after Native USB development

Reset for zero refactored like IDE

Zero bootloader reset tested on macOS and comments added

Re-word ARM bootloader and remove imports from testing

Patch changes ARDMK_VENDOR->ARCHITECHTURE, show_config_vars, ignore CORE_VER if emtpy

Common.mk header guard, openocd/bossac avoid separator, typos

Documentation update for patch changes

Move ARM tools to Sam.mk and auto-detect include

Correct accidental commit of Blink Makefile change

Lib fix with alternative core and documentation

Append zero to ARD_RESET_OPTS rather than set

Prioritise package ARM upload tools over path installed

Add note in README on ARM tools versions

Move openocd variant config script flag to OPTS
2018-02-24 11:15:53 +00:00
Kier Davis
b3c5127be2
Allow compatibility with old pgmspace API to be disabled by the user
When this compatibility mode is enabled, code that is entirely
compliant with the new pgmspace API can still raise deprecation
warnings when symbols present in both the old and new APIs (for
example, PGM_P) are used. Clearly, these warnings are false
positives. They can be avoided by disabling the compatibility mode.

This functionality is achieved by prepending the flag that enables
the compatibility mode to CPPFLAGS instead of appending it, thus
allowing the user to override the default behaviour and disable the
compatibility mode by putting the negation of the flag in the
CPPFLAGS variable in their top-level Makefile.
2018-01-24 21:52:22 +00:00
John Whittington
a6d979ef90 Merge remote-tracking branch 'upstream/master' 2018-01-03 08:14:39 +00:00
Simon John
6d3d973cd4 Moved ATtiny examples from Blink to ATtinyBlink and updated the instructions (issue #537).
Updated the alternate core instructions for e.g. ATmega644p for IDE 1.8
2017-12-28 17:55:01 +00:00
Simon John
246e568011 Moved -e flag for avrdude from set_fuses to ispload as you wouldn't want a chip erase operation when only setting the fuses.
ispload probably should erase the flash+eeprom+lockbits as that's when you upload the sketch.

setting fuses should be just that, not deleting anything.
2017-12-22 10:14:06 +00:00
SZEDER Gábor
b8f5eaa816 Recognize serial monitors with full path in MONITOR_CMD
When assembling the command line for the various supported serial
monitors, MONITOR_CMD must match the name of one of the supported
commands to be recognized.  Serial monitors given with leading path
components are not recognized, and a command like

  make MONITOR_CMD=~/src/picocom/picocom monitor

errors out as the fallback monitor command is executed instead of the
picocom-specific one.  However, sometimes it's necessary to specify a
supported serial monitor with its full path, because e.g. the user
wants to tests a freshly compiled version before installing it.  Sure,
the user could just run the serial monitor directly, but that's
cumbersome because he has to pay attention to use the right baud rate
and USB port.

So strip all leading path components, if present, from MONITOR_CMD
using the 'nondir' make function before checking whether it's one of
the supported serial monitors.  This way commands like the above would
just work.

While at it, remove the single quotes around 'putty': they are both
unnecessary and inconsistent with similar constructs throughout
Arduino.mk.
2017-10-03 12:54:13 +01:00
John Whittington
a165a3bf26 ardmk-init usage added to README and HISTORY update 2017-09-28 13:51:08 +01:00
SZEDER Gábor
c49af21700 Recognize serial monitors with full path in MONITOR_CMD
When assembling the command line for the various supported serial
monitors, MONITOR_CMD must match the name of one of the supported
commands to be recognized.  Serial monitors given with leading path
components are not recognized, and a command like

  make MONITOR_CMD=~/src/picocom/picocom monitor

errors out as the fallback monitor command is executed instead of the
picocom-specific one.  However, sometimes it's necessary to specify a
supported serial monitor with its full path, because e.g. the user
wants to tests a freshly compiled version before installing it.  Sure,
the user could just run the serial monitor directly, but that's
cumbersome because he has to pay attention to use the right baud rate
and USB port.

So strip all leading path components, if present, from MONITOR_CMD
using the 'nondir' make function before checking whether it's one of
the supported serial monitors.  This way commands like the above would
just work.

While at it, remove the single quotes around 'putty': they are both
unnecessary and inconsistent with similar constructs throughout
Arduino.mk.
2017-09-27 00:14:57 +02:00
John Whittington
e413feedbb Update HISTORY.md 2017-09-05 17:39:42 +01:00
John Whittington
73426bc233 Merge branch 'master' of https://github.com/sudar/Arduino-Makefile 2017-09-03 21:37:03 +01:00
Simon John
fa82c3a9db Moved the LTO etc. flags from CXXFLAGS_STD to CXXFLAGS 2017-09-02 15:32:52 +01:00
John Whittington
4c4c9ac2f0 Merge with upstream 2017-09-01 12:42:45 +00:00
SZEDER Gábor
a80518e308 Quote the prefix tag in the space_pad_to function
POSIX shells treat an unquoted [abcd] as a pattern bracket expression
and apply it for filename expansion.  This kicks in and causes
troubles in the space_pad_to function when it's called to pad prefix
tags like '[AUTODETECT]', because the argument holding such a tag is
passed to a shell unquoted.  The result is funny output when the
directory containing the Makefile also contains any files or
directories, whose name is a single upper-case character that can be
found in any prefix tags:

  $ touch A B C D
  $ make
  -------------------------
  Arduino.mk Configuration:
  - A C D                CURRENT_OS = LINUX
  - [USER]               ARDUINO_DIR = /home/szeder/src/arduino/arduino-1.8.1
  - [USER]               ARDMK_DIR = /home/szeder/src/arduino/Arduino-Makefile
  - A C D                ARDUINO_VERSION = 181
  - A D                  ARCHITECTURE = avr
  - A D                  ARDMK_VENDOR = arduino
  - A D                  ARDUINO_SKETCHBOOK =
  <snip>

Prevent this by quoting space_pad_to's parameter when passing it to a
shell.
2017-08-08 23:41:28 +02:00
Simon John
d1156e8fdf Add -fno-devirtualize to CXXFLAGS_STD to workaround a g++ bug. As this could impact performance we should track when the issue is fixed upstream to remove the flag again (see links from Issue #486)
Enabled colourised diagnostics from avr-gcc

We forgot to increase ARDMK_VERSION for the 1.6.0 release
2017-07-21 21:26:11 +01:00
Karl Semich
5bcb64ade9 Add makefile for Robotis OpenCM & update version to 1.6.0 2017-07-12 23:55:05 +00:00
John Whittington
81673d4666 Support for generation of project tags file
Considering the number of project files spread in different locations
when developing an Arduino project, proper use of tags can be difficult;
resolving beyond local functions.

I've added automatic generation of a tags file, which includes:

* Standard ctags source in project dir (.c, .cpp, .h)
* Arduino source in project dir (.ide, .pde)
* Arduino core based on detected project core from Arduino install.
* Included Arduino libraries from user library folder.

As a Vim user I find this hugely useful and think it would be a useful
addtion for others. Target has been added as `make tags`.
2017-06-04 10:47:04 +01:00
Milan Vancura
60d7e9401e Document how to setup Makefile for 3rd party boards 2017-06-02 00:37:03 +02:00
Simon John
d1363592f2 Fix autodetection of USB_PID on SparkFun's new ProMicro core
Remove use of tilde in documentation as ~ doesn't work, use $(HOME) instead
2017-06-01 19:22:28 +01:00
Simon John
18c6474d50 Add support for cu as MONITOR_CMD, use ~. to exit, be mindful when using over ssh 2017-04-01 23:06:28 +01:00
Simon John
6bffcd3383 Update HISTORY.md 2017-03-13 15:38:26 +00:00
Simon John
9f2cec3204 Update HISTORY.md 2017-03-12 22:05:23 +00:00
Simon John
08b4f441ff Update HISTORY.md 2017-02-12 18:13:50 +00:00
batchy
697c95e26f Arduino.mk: Fix generating assembly for cpp files.
Do not include the Arduino header when generating assembly for .cpp
files with generate_assembly.  This was likely a copy-paste error.
2017-01-21 12:32:25 +01:00
batchy
e126d37f9b History.md: Re-add "In Development" section. 2017-01-21 12:32:25 +01:00
Sudar Muthu
7a14d670eb Bump up version to 1.5.2 for release 2017-01-11 16:48:33 +05:30
George Harker
0b1aa8d26a hard code ARCHITECTURE if not found in boards.txt, update history 2016-11-05 12:10:15 -07:00
Simon John
a6a9928859 Changed the PARSE_BOARD function to handle colons found in things like build.core and
build.variant

Fixes Issue #461
2016-10-11 19:59:35 +01:00
Simon John
fe020380b6 Changed LTO support check to avr-gcc > 4.9.0 as the 4.8.1 bundled with the IDE prior to 1.6.10
doesn't support LTO or plugins. Fixes Issue #456

So essentially LTO support will only be enabled with avr-gcc 4.9.2 which comes with 1.6.10 or later
and Debian, Ubuntu etc; not 4.8.1 which comes with IDE 1.6.9 and a few earlier versions.

Tested with:

 * 1.6.8 (avr-gcc 4.8.1 which doesn't support LTO so uses avr-ar and doesn't set LTO flags)
 * 1.6.12 (avr-gcc 4.9.2 which supports LTO so uses avr-gcc-ar and sets LTO flags)
 * 1.0.5 with Debian avr-gcc 4.9.2 (supports LTO so uses avr-gcc-ar and sets LTO flags)
2016-10-11 15:23:36 +01:00
Simon John
c426e07fe2 Updated changelog 2016-09-08 18:31:52 +01:00