2014-02-27 22:20:38 +01:00
# Documentation of variables
2014-02-04 13:24:46 +01:00
The following are the different variables that can be overwritten in the user makefiles.
2014-02-27 22:20:38 +01:00
* [Global variables ](#global-variables )
* [Installation/Directory variables ](#installationdirectory-variables )
* [Arduino IDE variables ](#arduino-ide-variables )
* [Sketch related variables ](#sketch-related-variables )
* [ISP programming variables ](#isp-programming-variables )
* [Compiler/Executable variables ](#compilerexecutable-variables )
* [Avrdude setting variables ](#avrdude-setting-variables )
* [Bootloader variables ](#bootloader-variables )
* [ChipKIT variables ](#chipkit-variables )
2014-02-04 13:24:46 +01:00
## Global variables
### ARDUINO_QUIET
2014-02-27 22:20:38 +01:00
**Description:**
2014-02-04 13:24:46 +01:00
Suppress printing of Arduino-Makefile configuration.
2014-02-27 22:20:38 +01:00
Defaults to `0` (unset/disabled).
**Example:**
```Makefile
ARDUINO_QUIET = 1
```
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Requirement:** *Optional*
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
----
2014-02-04 13:24:46 +01:00
## Installation/Directory variables
### ARDMK_DIR
2014-02-27 22:20:38 +01:00
**Description:**
2014-02-04 13:24:46 +01:00
Directory where the `*.mk` files are stored.
2015-05-15 19:09:00 +02:00
Usually can be auto-detected as parent of `Arduino.mk` .
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Example:**
```Makefile
ARDMK_DIR = /usr/share/arduino
```
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Requirement:** *Optional*
----
2014-02-04 13:24:46 +01:00
### AVR_TOOLS_DIR
2014-02-27 22:20:38 +01:00
**Description:**
Directory where tools such as `avrdude` , `avr-g++` , `avr-gcc` , etc. are stored in the `bin/` subdirectory.
2014-02-04 13:24:46 +01:00
Usually can be auto-detected from `$PATH` as `SYSTEMPATH_AVR_TOOLS_DIR` or as `BUNDLED_AVR_TOOLS_DIR` within the Arduino distribution.
2014-02-27 22:20:38 +01:00
**Example:**
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
```Makefile
AVR_TOOLS_DIR = /usr
# or
AVR_TOOLS_DIR = /usr/share/arduino/hardware/tools/avr
```
**Requirement:** *Optional*
----
2014-02-04 13:24:46 +01:00
### RESET_CMD
2014-02-27 22:20:38 +01:00
**Description:**
2014-02-04 13:24:46 +01:00
Command to reset the MCU.
2014-02-27 22:20:38 +01:00
Defaults to `ard-reset-arduino` with the extra `--caterina` flag for atmega32u4 boards.
**Example:**
```Makefile
2017-06-01 20:22:28 +02:00
RESET_CMD = $(HOME)/gertduino/reset
2014-02-27 22:20:38 +01:00
```
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Requirement:** *Optional*
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
----
2014-02-04 13:24:46 +01:00
## Arduino IDE variables
### ARDUINO_DIR
2014-02-27 22:20:38 +01:00
**Description:**
2015-05-15 19:09:00 +02:00
Directory where the Arduino IDE and/or core files are stored. Usually can be auto-detected as `AUTO_ARDUINO_DIR` .
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Example:**
```Makefile
# Linux
ARDUINO_DIR = /usr/share/arduino
# Mac OS X
ARDUINO_DIR = /Applications/Arduino.app/Contents/Resources/Java
2015-05-15 19:09:00 +02:00
# Mac OSX with IDE 1.5+
ARDUINO_DIR = /Applications/Arduino.app/Contents/Java
2014-02-27 22:20:38 +01:00
```
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Requirement:** *Optional*
----
2014-02-04 13:24:46 +01:00
2014-10-11 23:14:32 +02:00
### ARDUINO_PLATFORM_LIB_PATH
**Description:**
Directory where the Arduino platform dependent libraries are stored.
2015-05-15 19:09:00 +02:00
(Used only for Arduino 1.5+)
2014-10-11 23:14:32 +02:00
**Example:**
```Makefile
ARDUINO_PLATFORM_LIB_PATH = /usr/share/arduino/hardware/arduino/avr/libraries
```
**Requirement:** *Optional*
----
2014-02-04 13:24:46 +01:00
### ARDUINO_VERSION
2014-02-27 22:20:38 +01:00
**Description:**
2014-02-04 13:24:46 +01:00
Version string for Arduino IDE and/or core.
2014-02-27 22:20:38 +01:00
Usually can be auto-detected as `AUTO_ARDUINO_VERSION` from `/usr/share/arduino/lib/version.txt`
**Example:**
```Makefile
ARDUINO_VERSION = 105
```
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Requirement:** *Optional*
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
----
2014-02-04 13:24:46 +01:00
2014-06-01 18:14:38 +02:00
### ARCHITECTURE
**Description:**
2015-05-15 19:09:00 +02:00
Architecture for Arduino 1.5+
2014-06-01 18:14:38 +02:00
2015-05-15 19:09:00 +02:00
Defaults to unset for 1.0 or `avr` for 1.5+
2014-06-01 18:14:38 +02:00
**Example:**
```Makefile
ARCHITECTURE = sam
```
**Requirement:** *Optional*
----
2015-09-15 01:00:30 +02:00
### ARDMK_VENDOR
2014-06-01 18:14:38 +02:00
**Description:**
Board vendor/maintainer.
Defaults to `arduino`
**Example:**
```Makefile
2015-09-15 01:00:30 +02:00
ARDMK_VENDOR = sparkfun
2014-06-01 18:14:38 +02:00
```
**Requirement:** *Optional*
----
2014-04-21 19:42:23 +02:00
### ARDUINO_SKETCHBOOK
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Description:**
Path to `sketchbook` directory.
2017-06-01 20:22:28 +02:00
Usually can be auto-detected from the Arduino `preferences.txt` file or the default `$(HOME)/sketchbook`
2014-02-27 22:20:38 +01:00
**Example:**
```Makefile
2017-06-01 20:22:28 +02:00
ARDUINO_SKETCHBOOK = $(HOME)/sketches
2014-02-27 22:20:38 +01:00
```
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Requirement:** *Optional*
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
----
2014-02-04 13:24:46 +01:00
### ARDUINO_PREFERENCES_PATH
2014-02-27 22:20:38 +01:00
**Description:**
Path to Arduino `preferences.txt` file.
Usually can be auto-detected as `AUTO_ARDUINO_PREFERENCES` from the defaults:
2017-06-01 20:22:28 +02:00
* on Linux (1.0): `$(HOME)/.arduino/preferences.txt`
* on Linux (1.5+): `$(HOME)/.arduino15/preferences.txt`
* on Mac OS X (1.0): `$(HOME)/Library/Arduino/preferences.txt`
* on Mac OS X (1.5+): `$(HOME)/Library/Arduino15/preferences.txt`
2014-02-27 22:20:38 +01:00
**Example:**
```Makefile
2017-06-01 20:22:28 +02:00
ARDUINO_PREFERENCES_PATH = $(HOME)/sketches/preferences.txt
2014-02-27 22:20:38 +01:00
```
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Requirement:** *Optional*
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
----
2014-02-04 13:24:46 +01:00
### ARDUINO_CORE_PATH
2014-02-27 22:20:38 +01:00
**Description:**
2014-02-04 13:24:46 +01:00
Path to standard Arduino core files.
2014-02-27 22:20:38 +01:00
**Example:**
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
```Makefile
ARDUINO_CORE_PATH = /usr/share/arduino/hardware/arduino/cores/arduino
```
**Requirement:** *Optional*
----
2014-02-04 13:24:46 +01:00
## Sketch related variables
### ARDUINO_LIBS
2014-02-27 22:20:38 +01:00
**Description:**
2014-02-04 13:24:46 +01:00
Any libraries you intend to include.
2014-02-27 22:20:38 +01:00
Usually can be auto-detected from the sketch. Separated by spaces. If the library has a `/utility` folder (like `SD` or `Wire` library), then the utility folder should also be specified.
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Example:**
```Makefile
ARDUINO_LIBS = SD SD/utility Wire Wire/utility
```
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Requirement:** *Optional*
----
2014-02-04 13:24:46 +01:00
### BOARD_TAG
2014-02-27 22:20:38 +01:00
**Description:**
Device type as listed in `boards.txt` or `make show_boards` .
**Example:**
```Makefile
BOARD_TAG = uno or mega2560
```
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Requirement:** *Mandatory*
----
2014-02-04 13:24:46 +01:00
2014-06-01 18:14:38 +02:00
### BOARD_SUB
**Description:**
2016-02-19 23:05:26 +01:00
1.5+ submenu as listed in `boards.txt` or `make show_submenu` .
2014-06-01 18:14:38 +02:00
**Example:**
```Makefile
# diecimila.name=Arduino Duemilanove or Diecimila
BOARD_TAG=diecimila
# diecimila.menu.cpu.atmega168=ATmega168
BOARD_SUB=atmega168
```
2015-05-15 19:09:00 +02:00
**Requirement:** *Mandatory for 1.5+ if using a submenu CPU*
2014-06-01 18:14:38 +02:00
----
2014-02-04 13:24:46 +01:00
### MONITOR_PORT
2014-02-27 22:20:38 +01:00
**Description:**
2014-02-04 13:24:46 +01:00
Path to serial (USB) device used for uploading/serial comms.
2014-02-27 22:20:38 +01:00
**Example:**
```Makefile
# Linux
MONITOR_PORT = /dev/ttyUSB0
# or
MONITOR_PORT = /dev/ttyACM0
# Mac OS X
MONITOR_PORT = /dev/cu.usb*
# Windows
MONITOR_PORT = com3
```
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Requirement:** *Mandatory*
----
2014-02-04 13:24:46 +01:00
2014-12-29 18:34:45 +01:00
### FORCE_MONITOR_PORT
**Description:**
Skip the MONITOR_PORT existance check.
**Example:**
```Makefile
# Enable
FORCE_MONITOR_PORT = true
# Disable (default)
undefine FORCE_MONITOR_PORT
```
**Requirement:** *Optional*
----
2014-02-04 13:24:46 +01:00
### USER_LIB_PATH
2014-02-27 22:20:38 +01:00
**Description:**
2014-02-04 13:24:46 +01:00
Directory where additional libraries are stored.
2014-02-27 22:20:38 +01:00
Defaults to `libraries` directory within user's sketchbook.
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Example:**
```Makefile
# Linux
2017-06-01 20:22:28 +02:00
USER_LIB_PATH = $(HOME)/sketchbook/libraries
2014-02-27 22:20:38 +01:00
# For a random project on *nix
USER_LIB_PATH = /path/to/my/project
```
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Requirement:** *Optional*
----
2014-02-04 13:24:46 +01:00
2014-02-27 22:22:59 +01:00
### OBJDIR
**Description:**
Directory where binaries and compiled files are put.
Defaults to `build-$(BOARD_TAG)` in your `Makefile` directory.
**Example:**
```Makefile
OBJDIR = /path/to/my/project-directory/bin
```
2014-02-27 22:20:38 +01:00
**Requirement:** *Optional*
2014-02-27 22:22:59 +01:00
----
2015-09-06 14:14:22 +02:00
### TARGET
**Description:**
What name you would like for generated target files.
Defaults to the name of your current working directory, but with underscores (_) instead of spaces.
**Example:**
```Makefile
TARGET = my-project
```
Will generate targets like `my-project.hex` and `my-project.elf` .
**Requirement:** *Optional*
----
2014-02-04 13:24:46 +01:00
### ALTERNATE_CORE
2014-02-27 22:20:38 +01:00
**Description:**
2014-02-04 13:24:46 +01:00
Non-standard core for Arduino-unsupported chips like the ATtiny.
2014-02-27 22:20:38 +01:00
**Example:**
```Makefile
# HLT core
ALTERNATE_CORE = attiny-master
# tiny core
ALTERNATE_CORE = arduino-tiny
# tiny core 2
ALTERNATE_CORE = tiny2
```
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Requirement:** *Optional*
----
2014-02-04 13:24:46 +01:00
### ARDUINO_VAR_PATH
2014-02-27 22:20:38 +01:00
**Description:**
2014-02-04 13:24:46 +01:00
Path to non-standard core's variant files.
2014-02-27 22:20:38 +01:00
**Example:**
```Makefile
2017-06-01 20:22:28 +02:00
ARDUINO_VAR_PATH = $(HOME)/sketchbook/hardware/arduino-tiny/cores/tiny
2014-02-27 22:20:38 +01:00
```
**Requirement:** *Optional*
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
----
2014-02-04 13:24:46 +01:00
2014-12-29 18:34:45 +01:00
### CORE
**Description:**
Name of the core *inside* the ALTERNATE_CORE or the standard core.
Usually can be auto-detected as `build.core` from `boards.txt` .
**Example:**
```Makefile
# standard Arduino core (undefine ALTERNATE_CORE)
CORE = arduino
# or
CORE = robot
# tiny core (ALTERNATE_CORE = arduino-tiny)
CORE = tiny
```
**Requirement:** *Optional*
----
2014-02-04 13:24:46 +01:00
### VARIANT
2014-02-27 22:20:38 +01:00
**Description:**
2014-02-04 13:24:46 +01:00
Variant of a standard board design.
2014-02-27 22:20:38 +01:00
Usually can be auto-detected as `build.variant` from `boards.txt` .
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Example:**
```Makefile
VARIANT = leonardo
```
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Requirement:** *Optional*
----
2014-02-04 13:24:46 +01:00
2015-01-23 11:10:53 +01:00
### USB_TYPE
**Description:**
Define Teensy 3.1 usb device type. Default is USB_SERIAL
**Example:**
```Makefile
USB_TYPE = USB_SERIAL
# or
USB_TYPE = USB_HID
# or
USB_TYPE = USB_SERIAL_HID
# or
USB_TYPE = USB_MIDI
# or
USB_TYPE = USB_RAWHID
# or
USB_TYPE = USB_FLIGHTSIM
```
**Requirement:** *Optional*
----
2014-02-04 13:24:46 +01:00
### USB_VID
2014-02-27 22:20:38 +01:00
**Description:**
Override `USB VID` for atmega32u4 boards.
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
Usually can be auto-detected as `build.vid` from `boards.txt`
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Example:**
```Makefile
USB_VID = 0x2341
```
**Requirement:** *Optional*
----
2014-02-04 13:24:46 +01:00
### USB_PID
2014-02-27 22:20:38 +01:00
**Description:**
Override `USB PID` for atmega32u4 boards.
Usually can be auto-detected as `build.pid` from `boards.txt`
**Example:**
```Makefile
USB_PID = 0x8039
```
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Requirement:** *Optional*
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
----
2014-02-04 13:24:46 +01:00
### F_CPU
2014-02-27 22:20:38 +01:00
**Description:**
2014-02-04 13:24:46 +01:00
CPU speed in Hz
2015-03-28 17:10:06 +01:00
Usually can be auto-detected as `build.f_cpu` from `boards.txt` , except in
2015-05-15 19:09:00 +02:00
some 1.5+ cores like attiny where there is a clock submenu.
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Example:**
```Makefile
F_CPU = 8000000L
```
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Requirement:** *Optional*
----
2014-02-04 13:24:46 +01:00
### HEX_MAXIMUM_SIZE
2014-02-27 22:20:38 +01:00
**Description:**
2014-02-04 13:24:46 +01:00
Maximum hex file size
2014-02-27 22:20:38 +01:00
Usually can be auto-detected as `upload.maximum_size` from `boards.txt`
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Example:**
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
```Makefile
HEX_MAXIMUM_SIZE = 14336
```
**Requirement:** *Optional*
----
2014-02-04 13:24:46 +01:00
### MCU
2014-02-27 22:20:38 +01:00
**Description:**
2014-02-04 13:24:46 +01:00
Microcontroller model.
2014-02-27 22:20:38 +01:00
Usually can be auto-detected as `build.mcu` from `boards.txt`
**Example:**
```Makefile
MCU = atmega32u4
```
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Requirement:** *Optional*
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
----
2014-02-04 13:24:46 +01:00
### MCU_FLAG_NAME
2014-02-27 22:20:38 +01:00
**Description:**
2014-02-04 13:24:46 +01:00
Override default MCU flags.
2014-02-27 22:20:38 +01:00
Defaults to `mmcu`
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Example:**
```Makefile
MCU_FLAG_NAME = mprocessor
```
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Requirement:** *Optional*
----
2014-02-04 13:24:46 +01:00
### MONITOR_BAUDRATE
2014-02-27 22:20:38 +01:00
**Description:**
2014-02-04 13:24:46 +01:00
Baudrate of the serial monitor.
2014-02-27 22:20:38 +01:00
Defaults to `9600` if it can't find it in the sketch `Serial.begin()`
**Example:**
```Makefile
MONITOR_BAUDRATE = 57600
```
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Requirement:** *Optional*
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
----
2014-02-04 13:24:46 +01:00
## ISP programming variables
### ISP_PROG
2014-02-27 22:20:38 +01:00
**Description:**
2014-02-04 13:24:46 +01:00
Type of ISP. Either a USB device or ArduinoISP protocol.
2014-02-27 22:20:38 +01:00
**Example:**
```Makefile
ISP_PROG = usbasp
# or
ISP_PROG = usbtiny
# or
ISP_PROG = stk500v2
# or
ISP_PROG = stk500v1
```
**Requirement:** *Optional*
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
----
2014-02-04 13:24:46 +01:00
### ISP_PORT
2014-02-27 22:20:38 +01:00
**Description:**
2014-02-04 13:24:46 +01:00
Device path to ArduinoISP. Not needed for hardware ISP's.
2014-02-27 22:20:38 +01:00
**Example:**
```Makefile
# Linux
ISP_PORT = /dev/ttyACM0
```
**Requirement:** *Optional*
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
----
2014-02-04 13:24:46 +01:00
### ISP_LOCK_FUSE_PRE
2014-02-27 22:20:38 +01:00
**Description:**
2014-02-04 13:24:46 +01:00
Bootloader unlock bits.
2014-02-27 22:20:38 +01:00
Usually can be auto-detected from `boards.txt`
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Example:**
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
```Makefile
ISP_LOCK_FUSE_PRE = 0x3f
```
**Requirement:** *Optional*
----
2014-02-04 13:24:46 +01:00
### ISP_LOCK_FUSE_POST
2014-02-27 22:20:38 +01:00
**Description:**
2014-02-04 13:24:46 +01:00
Bootloader lock bits.
2014-02-27 22:20:38 +01:00
Usually can be auto-detected from `boards.txt`
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Example:**
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
```Makefile
ISP_LOCK_FUSE_POST = 0xcf
```
**Requirement:** *Optional*
----
2014-02-04 13:24:46 +01:00
### ISP_HIGH_FUSE
2014-02-27 22:20:38 +01:00
**Description:**
`ISP_LOW_FUSE/ISP_EXT_FUSE` - high/low/extended fuse bits.
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
Usually can be auto-detected from `boards.txt`
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Example:**
```Makefile
ISP_HIGH_FUSE = 0xdf # or 0xff or 0x01
```
**Requirement:** *Optional*
----
2014-02-04 13:24:46 +01:00
### ISP_EEPROM
2014-02-27 22:20:38 +01:00
**Description:**
2014-02-04 13:24:46 +01:00
Whether to upload the EEPROM file or not.
2014-02-27 22:20:38 +01:00
Defaults to `0`
**Example:**
```Makefile
ISP_EEPROM = 1
```
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Requirement:** *Optional*
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
----
2014-02-04 13:24:46 +01:00
## Compiler/Executable variables
### CC_NAME
2014-02-27 22:20:38 +01:00
**Description:**
2014-02-04 13:24:46 +01:00
C compiler.
2014-02-27 22:20:38 +01:00
Defaults to `avr-gcc`
**Example:**
```Makefile
CC_NAME = pic32-gcc
```
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Requirement:** *Optional*
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
----
2014-02-04 13:24:46 +01:00
### CXX_NAME
2014-02-27 22:20:38 +01:00
**Description:**
2014-02-04 13:24:46 +01:00
C++ compiler.
2014-02-27 22:20:38 +01:00
Defaults to `avr-g++`
**Example:**
```Makefile
CXX_NAME = pic32-g++
```
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Requirement:** *Optional*
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
----
2014-02-04 13:24:46 +01:00
### OBJCOPY_NAME
2014-02-27 22:20:38 +01:00
**Description:**
2014-02-04 13:24:46 +01:00
Objcopy utility.
2014-02-27 22:20:38 +01:00
Defaults to `avr-objcopy`
**Example:**
```Makefile
OBJCOPY_NAME = pic32-objcopy
```
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Requirement:** *Optional*
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
----
2014-02-04 13:24:46 +01:00
### OBJDUMP_NAME
2014-02-27 22:20:38 +01:00
**Description:**
2014-02-04 13:24:46 +01:00
Objdump utility.
2014-02-27 22:20:38 +01:00
Defaults to `avr-objdump`
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Example:**
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
```Makefile
OBJDUMP_NAME = pic32-objdump
```
**Requirement:** *Optional*
----
2014-02-04 13:24:46 +01:00
### AR_NAME
2014-02-27 22:20:38 +01:00
**Description:**
2014-02-04 13:24:46 +01:00
Archive utility.
2016-10-11 16:23:36 +02:00
Defaults to `avr-ar` unless you're using toolchain > 4.9.0 in which case we use avr-gcc-ar.
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Example:**
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
```Makefile
AR_NAME = pic32-ar
```
**Requirement:** *Optional*
----
2014-02-04 13:24:46 +01:00
### SIZE_NAME
2014-02-27 22:20:38 +01:00
**Description:**
2014-02-04 13:24:46 +01:00
Size utility.
2014-02-27 22:20:38 +01:00
Defaults to `avr-size`
**Example:**
```Makefile
SIZE_NAME = pic32-size
```
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Requirement:** *Optional*
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
----
2014-02-04 13:24:46 +01:00
### NM_NAME
2014-02-27 22:20:38 +01:00
**Description:**
2014-02-04 13:24:46 +01:00
Nm utility.
2014-02-27 22:20:38 +01:00
Defaults to `avr-nm`
**Example:**
```Makefile
NM_NAME = pic32-nm
```
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Requirement:** *Optional*
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
----
2014-02-04 13:24:46 +01:00
### OPTIMIZATION_LEVEL
2014-02-27 22:20:38 +01:00
**Description:**
Linker's `-O` flag
Defaults to `s` , which shouldn't really be changed as it breaks `SoftwareSerial` and usually results in bigger hex files.
**Example:**
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
```Makefile
OPTIMIZATION_LEVEL = 3
```
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Requirement:** *Optional*
----
2014-02-04 13:24:46 +01:00
2016-11-04 23:32:57 +01:00
### OTHER_LIBS
**Description:**
Additional Linker lib flags, for platform support
Defaults to ""
**Example:**
```Makefile
OTHER_LIBS = -lsomeplatformlib
```
**Requirement:** *Optional*
----
2014-02-04 13:24:46 +01:00
### CFLAGS_STD
2014-02-27 22:20:38 +01:00
**Description:**
2014-08-13 11:16:16 +02:00
Controls, *exclusively* , which C standard is to be used for compilation.
2014-02-04 13:24:46 +01:00
2016-10-11 16:23:36 +02:00
Defaults to `undefined` on 1.0.x or `-std=gnu11 -flto -fno-fat-lto-objects` on 1.5+ or if you install AVR toolchain > 4.9.0
2014-08-13 11:16:16 +02:00
Possible values:
2016-09-08 16:48:04 +02:00
* With `avr-gcc 4.3` , shipped with the 1.0 Arduino IDE:
2014-08-13 11:16:16 +02:00
* `undefined`
* `-std=c99`
* `-std=gnu89` - This is the default for C code
* `-std=gnu99`
2016-09-08 16:48:04 +02:00
* With `avr-gcc 4.7, 4.8 or 4.9` , installed by you or 1.5+ IDE:
2014-08-13 11:16:16 +02:00
* `undefined`
* `-std=c99`
* `-std=c11`
2016-09-08 16:48:04 +02:00
* `-std=gnu89`
2014-08-13 11:16:16 +02:00
* `-std=gnu99`
2016-09-08 16:48:04 +02:00
* `-std=gnu11 -flto -fno-fat-lto-objects` - This is the default for C code
2014-08-13 11:16:16 +02:00
For more information, please refer to the [Options Controlling C Dialect ](https://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html )
**Example:**
```Makefile
CFLAGS_STD = = -std=gnu89
```
**Requirement:** *Optional*
----
### CXXFLAGS_STD
**Description:**
Controls, *exclusively* , which C++ standard is to be used for compilation.
2016-10-11 16:23:36 +02:00
Defaults to `undefined` on 1.0 or `-std=gnu++11 -fno-threadsafe-statics -flto` on AVR toolchain > 4.9.0 (e.g. IDE 1.6.10+)
2014-08-13 11:16:16 +02:00
Possible values:
2016-09-08 16:48:04 +02:00
* With `avr-gcc 4.3` , shipped with the 1.0 Arduino IDE:
2014-08-13 11:16:16 +02:00
* `undefined`
* `-std=c++98`
* `-std=c++0x`
* `-std=gnu++98` - This is the default for C code
* `-std=gnu++0x`
2016-09-08 16:48:04 +02:00
* With `avr-gcc 4.7, 4.8 or 4.9` , installed by you or 1.5+ IDE:
2014-08-13 11:16:16 +02:00
* `undefined`
* `-std=c++98`
* `-std=c++11`
* `-std=c++1y`
* `-std=c++14`
2016-09-08 16:48:04 +02:00
* `-std=gnu++98`
* `-std=gnu++11 -fno-threadsafe-statics -flto` - This is the default for C++ code
2014-08-13 11:16:16 +02:00
* `-std=gnu++1y`
* `-std=gnu++14`
For more information, please refer to the [Options Controlling C Dialect ](https://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html )
2014-02-27 22:20:38 +01:00
**Example:**
```Makefile
2014-08-13 11:16:16 +02:00
CXXFLAGS_STD = = -std=gnu++98
2014-02-27 22:20:38 +01:00
```
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Requirement:** *Optional*
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
----
2014-02-04 13:24:46 +01:00
2014-09-10 06:09:04 +02:00
### CFLAGS
**Description:**
Flags passed to compiler for files compiled as C. Add more flags to this
variable using `+=` .
Defaults to all flags required for a typical build.
**Example:**
```Makefile
CFLAGS += -my-c-only-flag
```
**Requirement:** *Optional*
----
### CXXFLAGS
**Description:**
Flags passed to the compiler for files compiled as C++. Add more flags to this
variable using `+=` .
2016-09-08 16:48:04 +02:00
Defaults to `-fpermissive -fno-exceptions`
2014-09-10 06:09:04 +02:00
**Example:**
```Makefile
CXXFLAGS += -my-c++-onlyflag
```
**Requirement:** *Optional*
----
### ASFLAGS
**Description:**
Flags passed to compiler for files compiled as assembly (e.g. `.S` files). Add
more flags to this variable using `+=` .
Defaults to all flags required for a typical build.
**Example:**
```Makefile
ASFLAGS += -my-as-only-flag
```
**Requirement:** *Optional*
----
### CPPFLAGS
**Description:**
Flags passed to the C pre-processor (for C, C++ and assembly source flies). Add
more flags to this variable using `+=` .
Defaults to all flags required for a typical build.
**Example:**
```Makefile
CPPFLAGS += -DMY_DEFINE_FOR_ALL_SOURCE_TYPES
```
**Requirement:** *Optional*
----
2014-02-04 13:24:46 +01:00
### OVERRIDE_EXECUTABLES
2014-02-27 22:20:38 +01:00
**Description:**
2014-02-04 13:24:46 +01:00
Override the default build tools.
2014-02-27 22:20:38 +01:00
If set to `1` , each tool (`CC`, `CXX` , `AS` , `OBJCOPY` , `OBJDUMP` , `AR` , `SIZE` , `NM` ) must have its path explicitly defined. See `chipKIT.mk` .
**Example:**
```Makefile
OVERRIDE_EXECUTABLES = 1
```
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Requirement:** *Optional*
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
----
2014-02-04 13:24:46 +01:00
### MONITOR_CMD
2014-02-27 22:20:38 +01:00
**Description:**
2014-02-04 13:24:46 +01:00
Command to run the serial monitor.
2014-02-27 22:20:38 +01:00
Defaults to `screen`
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Example:**
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
```Makefile
MONITOR_CMD = minicom
```
**Requirement:** *Optional*
----
2014-02-04 13:24:46 +01:00
2014-03-14 00:42:35 +01:00
### PRE_BUILD_HOOK
**Description:**
Path to shell script to be executed before build. Could be used to automatically
bump revision number for example.
Defaults to `pre-build-hook.sh`
**Example:**
```Makefile
2017-06-01 20:22:28 +02:00
PRE_BUILD_HOOK = $(HOME)/bin/bump-revision.sh
2014-03-14 00:42:35 +01:00
```
**Requirement:** *Optional*
----
2014-02-04 13:24:46 +01:00
## Avrdude setting variables
### AVRDUDE
2014-02-27 22:20:38 +01:00
**Description:**
Path to `avrdude` utility
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
Usually can be auto-detected within the parent of `AVR_TOOLS_DIR` or in the `$PATH`
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Example:**
```Makefile
AVRDUDE = /usr/bin/avrdude
```
**Requirement:** *Optional*
----
2014-02-04 13:24:46 +01:00
### AVRDUDE_CONF
2014-02-27 22:20:38 +01:00
**Description:**
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
Path to `avrdude.conf` file
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
Usually can be auto-detected within the parent of `AVR_TOOLS_DIR`
**Example:**
```Makefile
AVRDUDE_CONF = /etc/avrdude.conf
# or
AVRDUDE_CONF = /usr/share/arduino/hardware/tools/avrdude.conf
```
**Requirement:** *Optional*
----
2014-02-04 13:24:46 +01:00
### AVR_TOOLS_PATH
2014-02-27 22:20:38 +01:00
**Description:**
Directory where tools such as `avrdude` , `avr-g++` , `avr-gcc` etc. are stored.
Usually can be auto-detected from `AVR_TOOLS_DIR/bin`
**Example:**
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
```Makefile
AVR_TOOLS_PATH = /usr/bin
# or
AVR_TOOLS_PATH = /usr/share/arduino/hardware/tools/avr/bin
```
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Requirement:** *Optional*
----
2014-02-04 13:24:46 +01:00
### ARDUINO_LIB_PATH
2014-02-27 22:20:38 +01:00
**Description:**
2014-02-04 13:24:46 +01:00
Directory where the standard Arduino libraries are stored.
2014-02-27 22:20:38 +01:00
Defaults to `ARDUINO_DIR/libraries`
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Example:**
```Makefile
# Linux
ARDUINO_LIB_PATH = /usr/share/arduino/libraries
```
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Requirement:** *Optional*
----
2014-02-04 13:24:46 +01:00
### ARDUINO_CORE_PATH
2014-02-27 22:20:38 +01:00
**Description:**
2014-02-04 13:24:46 +01:00
Directory where the standard Arduino cores are stored.
2014-02-27 22:20:38 +01:00
Defaults to `ARDUINO_DIR/hardware/arduino/cores/arduino`
**Example:**
```Makefile
ARDUINO_CORE_PATH = /usr/share/arduino/hardware/arduino/cores/robot
```
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Requirement:** *Optional*
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
----
2014-02-04 13:24:46 +01:00
### ALTERNATE_CORE_PATH
2014-02-27 22:20:38 +01:00
**Description:**
2014-02-04 13:24:46 +01:00
Path to non-standard cores.
2014-02-27 22:20:38 +01:00
Defaults to `ARDUINO_SKETCHBOOK/hardware/ALTERNATE_CORE`
**Example:**
```Makefile
2017-06-01 20:22:28 +02:00
ALTERNATE_CORE_PATH = $(HOME)/sketchbook/hardware/arduino-tiny/cores/tiny
2014-02-27 22:20:38 +01:00
```
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Requirement:** *Optional*
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
----
2014-02-04 13:24:46 +01:00
### BOARDS_TXT
2014-02-27 22:20:38 +01:00
**Description:**
Path to `boards.txt`
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
Defaults to `ARDUINO_DIR/hardware/arduino/boards.txt`
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Example:**
```Makefile
2017-06-01 20:22:28 +02:00
BOARD_TXT = $(HOME)/sketchbook/hardware/boards.txt
2014-02-27 22:20:38 +01:00
# or
BOARD_TXT = /usr/share/arduino/hardware/arduino/boards.txt
```
**Requirement:** *Optional*
----
2014-02-04 13:24:46 +01:00
### AVRDUDE_ARD_BAUDRATE
2014-02-27 22:20:38 +01:00
**Description:**
2014-02-04 13:24:46 +01:00
Upload speed
2014-02-27 22:20:38 +01:00
Usually can be auto-detected as `upload.speed` from `boards.txt`
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Example:**
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
```Makefile
AVRDUDE_ARD_BAUDRATE = 19200
```
**Requirement:** *Optional*
----
2014-02-04 13:24:46 +01:00
### AVRDUDE_ARD_PROGRAMMER
2014-02-27 22:20:38 +01:00
**Description:**
2014-02-04 13:24:46 +01:00
Upload protocol
2014-02-27 22:20:38 +01:00
Usually can be auto-detected as `upload.protocol` from `boards.txt`
**Example:**
```Makefile
AVRDUDE_ARD_PROGRAMMER = stk500v1
```
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Requirement:** *Optional*
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
----
2014-02-04 13:24:46 +01:00
### AVRDUDE_ISP_BAUDRATE
2014-02-27 22:20:38 +01:00
**Description:**
ISP speed if different to `upload.speed`
Defaults to same as `AVRDUDE_ARD_BAUDRATE` or `19200`
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Example:**
```Makefile
AVRDUDE_ISP_BAUDRATE = 19200
```
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Requirement:** *Optional*
----
2014-02-04 13:24:46 +01:00
### AVRDUDE_OPTS
2014-02-27 22:20:38 +01:00
**Description:**
Options to pass to `avrdude` .
2014-02-04 13:24:46 +01:00
2014-11-07 23:59:30 +01:00
Defaults to `-q -V` (quiet, don't verify). User values are not *ANDed* to the defaults, you have to set each option you require.
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Example:**
```Makefile
AVRDUDE_OPTS = -v
```
**Requirement:** *Optional*
----
2014-02-04 13:24:46 +01:00
## Bootloader variables
### BOOTLOADER_FILE
2014-02-27 22:20:38 +01:00
**Description:**
2014-02-04 13:24:46 +01:00
File for bootloader.
2014-02-27 22:20:38 +01:00
Usually can be auto-detected as `bootloader.file` from `boards.txt`
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Example:**
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
```Makefile
BOOTLOADER_FILE = optiboot_atmega328.hex
```
**Requirement:** *Optional*
----
2014-02-04 13:24:46 +01:00
### BOOTLOADER_PATH
2014-02-27 22:20:38 +01:00
**Description:**
2014-03-24 01:53:30 +01:00
Relative path to bootloader directory.
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
Usually can be auto-detected as a relative `bootloader.path` from `boards.txt`
2014-02-04 13:24:46 +01:00
2014-06-01 18:14:38 +02:00
Deprecated in 1.5, now part of bootloader.file
2014-02-27 22:20:38 +01:00
**Example:**
```Makefile
BOOTLOADER_PATH = optiboot
# or
BOOTLOADER_PATH = arduino:atmega
```
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Requirement:** *Optional*
----
2014-02-04 13:24:46 +01:00
2014-03-24 01:53:30 +01:00
### BOOTLOADER_PARENT
**Description:**
Absolute path to bootloader file's parent directory.
Defaults to `/usr/share/arduino/hardware/arduino/bootloaders` (Linux)
**Example:**
```Makefile
2017-06-01 20:22:28 +02:00
BOOTLOADER_PARENT = $(HOME)/sketchbook/hardware/promicro/bootloaders
2014-03-24 01:53:30 +01:00
BOOTLOADER_PATH = caterina
BOOTLOADER_FILE = Caterina-promicro16.hex
```
2017-06-01 20:22:28 +02:00
Would result in an absolute path to the bootloader hex file of `$(HOME)/sketchbook/hardware/promicro/bootloaders/caterina/Caterina-promicro16.hex`
2014-03-24 01:53:30 +01:00
**Requirement:** *Optional, unless BOOTLOADER_FILE and/or BOOTLOADER_PATH are user-defined*
----
2014-02-04 13:24:46 +01:00
## ChipKIT variables
### MPIDE_DIR
2014-02-27 22:20:38 +01:00
**Description:**
2014-02-04 13:24:46 +01:00
Path to chipKIT MP IDE
2014-02-27 22:20:38 +01:00
Usually can be auto-detected as `AUTO_MPIDE_DIR` from the defaults `/usr/share/mpide` (Linux) or `/Applications/Mpide.app/Contents/Resources/Java` (OSX)
**Example:**
```Makefile
2017-06-01 20:22:28 +02:00
MPIDE_DIR = $(HOME)/mpide
2014-02-27 22:20:38 +01:00
```
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Requirement:** *Optional*
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
----
2014-02-04 13:24:46 +01:00
### MPIDE_PREFERENCES_PATH
2014-02-27 22:20:38 +01:00
**Description:**
Path to chipKIT `preferences.txt` file.
2014-02-04 13:24:46 +01:00
2017-06-01 20:22:28 +02:00
Usually can be auto-detected as `AUTO_MPIDE_PREFERENCES_PATH` from the defaults `$(HOME)/.mpide/preferences.txt` (Linux) or `$(HOME)/Library/Mpide/preferences.txt` (OSX)
2014-02-27 22:20:38 +01:00
**Example:**
```Makefile
2017-06-01 20:22:28 +02:00
MPIDE_PREFERENCES_PATH = $(HOME)/chipkit/preferences.txt
2014-02-27 22:20:38 +01:00
```
2014-02-04 13:24:46 +01:00
2014-02-27 22:20:38 +01:00
**Requirement:** *Optional*