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
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
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.
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.
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.
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.
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.
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`.
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)
$ARCHITECTURE is probably safe as that's usually called $ARCH.
Fixes issue #386.
Need to decide if this is going to upset too many user's who have already
started using $VENDOR - and who uses tcsh? ;-)
With this fix the `TARGET` variable is set correctly when the project directory
(or its path) contains spaces. So in this case:
/Users/Joe/Dropbox (Personal)/example project
`TARGET` will be set to `example_project` instead of `Dropbox example project`
(like it was before this fix).
Needed to fix the new wiring_pulse.S in IDE 1.6.5 which
also has a wiring_pulse.c source file.
Mostly rebased @peplin's PR #266, so should allow us
to support newer chipKIT builds too.