From 05b5167d0d785568419f8979812514221908d8ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?King=20K=C3=A9vin?= Date: Tue, 19 Nov 2019 10:23:48 +0100 Subject: [PATCH] Makefile show better memory usage --- Rakefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index e50609f..3d56ea7 100644 --- a/Rakefile +++ b/Rakefile @@ -73,6 +73,8 @@ ldflags << "-nostartfiles" ldflags_linker = [ENV["LDFLAGS"]] # only keep used sections ldflags_linker = ["--gc-sections"] +# show memory usage +ldflags_linker << "--print-memory-usage" # add libopencm3 libraries library_paths = [LIBOPENCM3_LIB] # project libraries @@ -153,7 +155,6 @@ end desc "link binary" rule '.elf' => ['.o', proc{|f| dependencies(f)}, '.ld', "#{LIBOPENCM3_LIB}/lib#{STM32F1_LIB}.a"] do |t| sh "#{LD} #{archflags} #{ldflags.join(' ')} #{t.prerequisites[0..-3].join(' ')} -T#{t.name.ext('ld')} #{ldflags_linker.collect{|flag| "-Wl,"+flag}.join(' ')} #{library_paths.collect{|path| "-L"+path}.join(' ')} #{ldlibs.collect{|lib| "-l"+lib}.join(' ')} -Wl,--start-group #{ldlibs_linker.collect{|lib| "-l"+lib}.join(' ')} -Wl,--end-group --output #{t.name}" - sh "size #{t.name}" end desc "export binary"