Hi, I think you can write your own makefile to run build, but first of all you must set PATH to run commands:
Two paths are needed to set, Arduino-path is the path where you put your Arduino program:
posix command path: Arduino-path\hardware\tools\avr\utils\bin
avr-gcc command path: Arduino-path\hardware\tools\avr\bin
Use this command to set PATH
Set Path=Arduino-path\hardware\tools\arv\utils\bin:Arduino-path\hardware\tools\arv\bin
And next, write a makefile and just type 'make', build will run automatically.
I think a simple makefile is the best, and it just a list of commands needed.
The commands needed are listed in platform.txt(Arduino version >= 1.5), like this:
compiler.c.cmd=avr-gcc
compiler.c.flags=-c -g -Os -w -ffunction-sections -fdata-sections -MMD
## Compile c files
recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.c.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -D{software}={runtime.ide.version} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"
All the parameters are listed in boards.txt and programmers.txt corresponding to a board and a programmer.
The attachment is one of my makefile. But this makefile is just for a certain sketch, not a general purpose makefile.
I wrote a program to generate makefiles for sketches. It can read all parameters needed and write the command list to a makefile.
As my program is part of a plugin for Sublime Text 2, it is not a command line program.
I think you can write a program to do the same thing using your favorite program language.
makefile (12.4 KB)