A Makefile for popular Microcontrollers supporting Energia (msp430 and lm4f boards) and Arduino-1.8.x (avr, esp8266 and esp32 boards).
- 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!
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
make -I somedir
Note: installing the fragments in a directory on Gnu Make's include path means you can simply do:
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)
- elpaso's Makefile for msp430 provided inspiration.