add "functionsbysize" make target

This commit is contained in:
Michael Moon 2011-04-29 10:55:42 +10:00
parent e2cb6aef72
commit 143398705c
1 changed files with 6 additions and 3 deletions

View File

@ -67,10 +67,10 @@ PROGPORT = /dev/arduino
# atmega328p, 644p, 1280
PROGBAUD = 57600
# atmega 2560
#PROGBAUD = 115200
# PROGBAUD = 115200
# at least mega2560 needs stk500v2
PROGID = stk500v1
PROGID = arduino
##############################################################################
# #
@ -106,7 +106,7 @@ endif
OBJ = $(patsubst %.c,%.o,${SOURCES})
.PHONY: all program clean size subdirs
.PHONY: all program clean size subdirs program-fuses doc functionsbysize
.PRECIOUS: %.o %.elf
all: config.h subdirs $(PROGRAM).hex $(PROGRAM).lst $(PROGRAM).sym size
@ -156,6 +156,9 @@ config.h: config.h.dist
doc: Doxyfile *.c *.h
doxygen $<
functionsbysize: $(OBJ)
@avr-objdump -h $^ | grep '\.text\.' | perl -ne '/\.text\.(\S+)\s+([0-9a-f]+)/ && printf "%u\t%s\n", eval("0x$$2"), $$1;' | sort -n
%.o: %.c config.h Makefile
@echo " CC $@"
@$(CC) -c $(CFLAGS) -Wa,-adhlns=$(<:.c=.al) -o $@ $(subst .o,.c,$@)