From 10b41052008041bf7805baa740103756c5372345 Mon Sep 17 00:00:00 2001 From: simonduq Date: Mon, 26 Mar 2012 22:55:57 +0200 Subject: [PATCH] added %.ramprof and %.flashprof targets for easy memory profiling of linked binary (e.g. make hello-world.ramprof) --- Makefile.include | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Makefile.include b/Makefile.include index cf2d67d2c..64f3be221 100644 --- a/Makefile.include +++ b/Makefile.include @@ -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)