For one part of ESTCube-1 satellite we need to compile big and changing project to our AVR ATmega. Just using AVR Studio doesn't fit because we have people with linux (me), windows and mac in our team. The other common way - using hand modified AVR Studio Makefile doesn't fit either because it is prone to errors and irritating when working with tens of files. Lets use build automation tools! First though was Makefiles. After half a week of studying about the cryptic ways of Makefiles it was clear that it is not the right way. So lets use something simple (simple usually means python) - Scons. It is a tool very similar to Makefiles. But instead of writing cryptic and non debuggable pseudo code we can use python! I worked on it for couple of days, finally taught myself Scons with really really simple example and then copied the structure to real project.

The code compiles the test and library to elf with avr-gcc. Then the the elf to hex. The avr-size then shows the size. Finally avrdude, using AVR Dragon JTAG erases the device and flashes fresh .hex file. For clean command the target must also be specified.