# Link
game.out: game.o system.o
avr-gcc -mmcu=atmega32u2 -Os -Wall $^ -o $@ -lm
avr-size $@
What is the avr-size $@ used for / required for?
I understand that this is probably needed by the linker, but what does the linker actually do with this piece of information. Haven't been able to find anything online but maybe I haven't look hard enough. Any explanations / links to information would be greatly appreciated, cheers.
It's not required at all as part of the build process; it simply displays information about the generated binary. The avr-size
program is just the avr version of the size
program, and you can find the corresponding manual page online or on your local system. From the description:
The GNU size utility lists the section sizes and the total size for each of the binary files objfile on its argument list. By default, one line of output is generated for each file or each module if the file is an archive.