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"