Makeduino is a project mainly written in ..., it's free.
A hand-written makefile for compiling and uploading arduino sketches
No guarantees. Good luck.
I modify this file for every sketch I write and its still in alpha.