Ruby script for generating a GNU Automake style makefile system for your arduino projects
You'll probably need to use Fedora 19 to have this work out of the box. Pull requests or github issues for other distributions / systems will thoughtfully considered.
If there's enough interest, I'll add some command line switches and more dynamic configuration
of he environment. It would probably be simple to find the arduino environment rather than
hardcoding it. Also, doing a
git init and adding certain files to the repo would be really
handy for someone that uses this regularly. Again - add github issues or send pull requests...
gem install mkduino
======== Go to the directory where your source code is(or should be):
mkduino -p ./autogen.sh mkdir build cd build ./configure --host=avr make make upload
Or, use a shortcut
mkduino -pa cd build make upload
Command line options
Usage: mkduino [options] -p, --[no-]probe Probe for stuff -v, --[no-]verbose Run verbosely -a, --[no-]autoconfigure automatically run autogen.sh and configure -b, --board BOARD Arduino Board Type mega,mega1280,uno,mini,mini3v --programmer PROGRAMMER AVRDUDE Programmer type arduino, stk500 -o, --[no-]overwrite Overwrite current project files -c, --clock SPEED Clock speed -t, --type TYPE Arduino library type (aka variant) -d, --device DEVICE Arduino programming device. Example: /dev/ttyUSB0. -h, --help Show this message
This cpp file is generated if there are no
.h files found when mkduino is run.
It's a simple file like the one generated from the IDE.
This is where most of the configuration for automake ends up. This Automake file is initially configured for an Arduino Pro Mini, but there are some variables that can be changed in this file to customize it. Any changes made to this file will be automatically picked up by make on your next make invocation.
ARDUINO_VERSION=-DARDUINO=105Define of what version of the Arduino libaries you're using.
ARDUINO_INSTALL=/usr/share/arduino/hardware/arduinoWhere the Arduino library stuff is installed. This is the default on a Fedora system
MCU=atmega328pChange this if you have a different supported ATMEL chip. For instance set it to
MCU=atmega1280for an ATMEL atmega1280 chip
ARDUINO_VARIANTS=$(ARDUINO_INSTALL)/variants/standardYou many need to change
standardto something else for mega 1280 and 2560 chips
AVRDUDE_PORT=/dev/ttyUSB0The port that
make uploadwill try to send the code to.
AVRDUDE_PROGRAMMER = arduino*The
avrdudeprogrammer type. Check the
There's not much to see here. This file is customized with the project name and that's about it.
Execute this file after running
mkduino. This file isn't customized for each project - it's the same every time.
README, NEWS, AUTHORS, ChangeLog, config/config.h and m4/
Standard files and directories for GNU Automake. Just created, nothing is in them.
Every time I run the Arduino IDE I struggle to have my hands unlearn the
so I can do some little thing. I got really tired of it and made myself a makefile.
After bragging about my makefile prowess to my friends, they all wanted to ditch the Arduino IDE.
I was embarrassed of my initial makefile, so I decided to make an environment builder for Arduino.
My initial try at this projects included downloading all of the tools (yes, even gcc), building
it all very similarly to
rvm. That proved to be a project much too big for the typical Arduino
hacker to undertake, so I quickly regrouped and hacked out this ruby script to make an automake
Hopefully this enables you to use your environment of choice for Arduino hacking.