Makefile
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
LICENSE
README.md
TODO.md
arduino-esp.mk
arduino-esp32.mk
arduino-tiny.mk
arduino15.mk
avr.mk
energia.mk
energia10.mk
esp32.mk
esp8266.mk
files.md
lm4f.mk
msp430.mk
targets-avr.mk
targets-esp.mk
targets-esp32.mk
ucmk.mk

README.md

uC-Makefile

A Makefile for popular Microcontrollers supporting Energia (msp430 and lm4f boards) and Arduino-1.8.x (avr, esp8266 and esp32 boards).

If:

  • You'd prefer to be using vi or emacs to the Arduino IDE
  • Your preferred source tree layout differs from Arduino's
  • You want to program more than one type of board at the same time
  • You want more control over the build process than it gives you (e.g., compiler optimisation levels)
  • ... then this is for you!

Configuration

Install the makefile fragments in somedir.

Create a Makefile in your sketch directory, such as this, for a TI Launchpad:

PROCESSOR_FAMILY := msp430
BOARD := MSP-EXP430FR5739LP
include energia.mk

For an Arduino Uno, the equivalent would be:

BOARD := uno
include arduino15.mk

Invoke with:

make -I somedir

Note: installing the fragments in a directory on Gnu Make's include path means you can simply do:

make

Other Settings

Some settings it might be necessary to override, and their defaults are:

  • IDE_HOME (/usr/local/energia or /usr/local/arduino)
  • SKETCHBOOK (~/energia/sketchbook or ~/sketchbook)
  • UPLOAD_PORT (/dev/ttyUSB0)
  • SKETCH (e.g., Blink.ino)
  • SOURCES (e.g., foo.cpp bar.c)
  • LOCAL_CPPFLAGS (e.g., local #defines)
  • PROCESSOR_FAMILY (required for Launchpads, defaults to avr for Arduino)

Credits

  • elpaso's Makefile for msp430 provided inspiration.