Close

code-size helpers (in the form of a makefile)

A project log for limited-code hacks/ideas

When you're running out of code-space... sometimes yah's gots to hack. Here are some ideas.

esot.ericesot.eric 12/09/2016 at 16:130 Comments

Here's a minimal makefile for tracking your code-size, etc...

(This doesn't yet create the hex-file for flashing!)

default: build lss size

#Compile, optimize for size
build:
        avr-gcc -mmcu=atmega8515 -Os -o main.out main.c

#Create an assembly-listing (with C code alongside)
#Check out main.lss!
lss:
        avr-objdump --disassemble-zeroes -h -S main.out > main.lss

#Output the sizes of the various sections 
# written to flash = .text + .data
size:
        avr-size main.out

clean:
        rm -f main.out main.lss

Discussions