added %.ramprof and %.flashprof targets for easy memory profiling of linked binary (e.g. make hello-world.ramprof)

ico
simonduq 2012-03-26 22:55:57 +02:00
parent 63ea562568
commit 10b4105200
1 changed files with 6 additions and 0 deletions

View File

@ -228,6 +228,12 @@ ifndef CUSTOM_RULE_LINK
$(LD) $(LDFLAGS) $(TARGET_STARTFILES) ${filter-out %.a,$^} ${filter %.a,$^} $(TARGET_LIBFILES) -o $@
endif
%.ramprof: %.$(TARGET)
nm -S -td --size-sort $< | grep -i " [abdrw] " | cut -d' ' -f2,4
%.flashprof: %.$(TARGET)
nm -S -td --size-sort $< | grep -i " [t] " | cut -d' ' -f2,4
# Don't treat %.$(TARGET) as an intermediate file because it is
# in fact the primary target.
.PRECIOUS: %.$(TARGET)