To develop with the Arduino platform without using the IDE I have chosen to setup my environment with a Makefile to compile and upload the code from the command line. This way I can develop my code in a text editor of my choosing and manage the git repository, code compilation and upload from a command line terminal.
My setup method (assumes some knowledge of GNU Make):
Download the Makefile from http://ed.am/dev/make/arduino-mk
This pre written Makefile does all the heavy lifting, it talks to all the individual programs behind the scenes, ensures the correct files are compiled and handles the settings used to upload the code. The website includes alot more information about using the file, its defaults and using it in more special cases.
Save the file in a convenient place. I have chosen a directory in my users home directory.
Install the Arduino IDE using your normal package manager or by downloading from http://arduino.cc. This allows all the required dependencies to be installed along with the the Arduino libraries.
# Project Variables
BOARD := diecimila
# Include Arduino Makefile
It contains the type of board that I am using for the project, it means the code will be compiled and uploaded correctly. It also includes the link to the local copy of the pre written Makefile.
- all - Default; builds target
- target - Builds the target
- upload - Uploads the target to destination
- clean - Remove target build files from working directory
- boards - Display list of valid BOARD values
- monitor - Start a serial monitor using screen
- size - Display build target size information
- bootloader - Burns bootloader to chip
- file - Build specific file
The default monitor build target uses screen. I am a fan of tmux rather than screen. To make an alternative I can add a new (and unique) build target to my Makefile.