summaryrefslogtreecommitdiff
path: root/cesar/common
diff options
context:
space:
mode:
authorschodet2009-12-08 12:16:18 +0000
committerschodet2009-12-08 12:16:18 +0000
commit718bb30cfa5656583638fab0825ca7aba1cbf36e (patch)
tree454e1f9919100bff496893951d9b3f7dc1542c88 /cesar/common
parent3dd77fc9b47c303b7fa288ad52aa1ba7d531d3c0 (diff)
cesar/common/{make,tools}: output lram total size in .size file
git-svn-id: svn+ssh://pessac/svn/cesar/trunk@6531 017c9cb6-072f-447c-8318-d5b54f68fe89
Diffstat (limited to 'cesar/common')
-rw-r--r--cesar/common/make/build.mk5
-rwxr-xr-xcesar/common/tools/lram-size11
2 files changed, 10 insertions, 6 deletions
diff --git a/cesar/common/make/build.mk b/cesar/common/make/build.mk
index 2ce35665e8..fd96779189 100644
--- a/cesar/common/make/build.mk
+++ b/cesar/common/make/build.mk
@@ -24,7 +24,7 @@ TARGET_LINK_CXX = $(TARGET_CXX) $(TARGET_CXXFLAGS) $(TARGET_LDFLAGS)
TARGET_MAKE_BIN = $(TARGET_OBJCOPY) -O binary
TARGET_MAKE_ROM = $(TOOLS_DIR)/bin2rom
TARGET_MAKE_LST = $(TARGET_OBJDUMP) -S
-TARGET_MAKE_SIZE = $(TOOLS_DIR)/lram-size
+TARGET_MAKE_SIZE = $(TOOLS_DIR)/lram-size -dt --total-stderr
.PHONY: build.all host.all target.all build.clean
@@ -90,8 +90,7 @@ MAKE_SIZE_rule_template_echo := "SIZE"
%.size: $(call prog2size,%)
$(call prog2size,%): $(call prog2exe,%,target)
@echo $(MAKE_SIZE_rule_template_echo)" [target] $@"
- $Q$(TARGET_MAKE_SIZE) -d $< > $@
- $Q$(TARGET_MAKE_SIZE) -t $<
+ $Q$(TARGET_MAKE_SIZE) $< > $@
# Include deps.
-include $(call src2dep,$(HOST_SOURCES),host)
diff --git a/cesar/common/tools/lram-size b/cesar/common/tools/lram-size
index d1c15b65f1..6f0ffe362f 100755
--- a/cesar/common/tools/lram-size
+++ b/cesar/common/tools/lram-size
@@ -8,6 +8,7 @@ use Pod::Usage;
my $help;
my $details;
my $total;
+my $total_stderr;
my $prefix = 'sparc-elf-';
my @rams;
my $nocheck = 0;
@@ -15,13 +16,14 @@ GetOptions (
'help|h' => \$help,
'details|d' => \$details,
'total|t' => \$total,
+ 'total-stderr' => \$total_stderr,
'prefix|p=s' => \$prefix,
'ram|r=s' => \@rams,
'no-check' => \$nocheck,
) or pod2usage (2);
pod2usage (1) if $help;
@ARGV == 1 or pod2usage (2);
-$details or $total or pod2usage (2);
+$details or $total or $total_stderr or pod2usage (2);
@rams = qw(ilram dlram_data dlram_bss) unless @rams;
my $file = shift @ARGV;
@@ -63,7 +65,7 @@ if ($details)
}
}
-if ($total)
+if ($total || $total_stderr)
{
# Memories hash.
my %rams;
@@ -86,7 +88,9 @@ if ($total)
# Dump.
my @o = map { "$_: " . $rams{$_} } @rams;
- print join (', ', @o), "\n";
+ my $o = join (', ', @o) . "\n";
+ print $o if $total;
+ print STDERR $o if $total_stderr;
# Check memory size.
if (!$nocheck)
@@ -113,6 +117,7 @@ lram-size [options] file.elf
-h, --help brief help message
-d, --details print detailed section usage
-t, --total print total section size
+ --total-stderr print total on standard error output
-p, --prefix=PREFIX compiler prefix
-r, --ram=RAM include specified RAM
--no-check do not check ram size