]> git.cryptolib.org Git - avr-crypto-lib.git/blob - host/sumsize.rb
adjusting make-system for AEAD-Ciphers
[avr-crypto-lib.git] / host / sumsize.rb
1 #!/usr/local/bin/ruby
2
3 def scanFile (filename)
4 bytes = 0
5
6 #   text           data     bss     dec     hex filename
7 #    420              0       0     420     1a4 shabea.o
8 #   1600              0       0    1600     640 sha256-asm.o
9
10
11 file=File.open(filename)
12 name= /(.*)_size.txt/.match(filename)[1]
13 if (not name)
14   name=filename
15 end
16
17 while line=file.gets do
18   m = /^\s*\d+\s+\d+\s+\d+\s+(\d+)\s+.*/.match(line)
19   if m
20     bytes += m[1].to_i
21   end 
22 end
23
24 #puts "#{name}:\t#{bytes} bytes"
25 printf("%6d bytes\t%s\n", bytes, name)
26
27 end
28
29
30
31 #========================================================
32 # MAIN
33 #========================================================
34
35 ARGV.each do |x| scanFile(x) end
36