Commit 300f0d54 authored by Daniel Bovensiepen's avatar Daniel Bovensiepen

Beautify the output of rake

parent 9d9e784a
...@@ -7,6 +7,7 @@ MRuby.each_target do ...@@ -7,6 +7,7 @@ MRuby.each_target do
mrbc_, *rbfiles = t.prerequisites mrbc_, *rbfiles = t.prerequisites
FileUtils.mkdir_p File.dirname(t.name) FileUtils.mkdir_p File.dirname(t.name)
open(t.name, 'w') do |f| open(t.name, 'w') do |f|
_pp "GEN *.rb > #{t.name}"
f.puts File.read("#{dir}/init_mrblib.c") f.puts File.read("#{dir}/init_mrblib.c")
mrbc.run f, rbfiles, 'mrblib_irep' mrbc.run f, rbfiles, 'mrblib_irep'
end end
......
...@@ -52,6 +52,7 @@ module MRuby ...@@ -52,6 +52,7 @@ module MRuby
include_path_flags = [include_paths, _include_paths, File.dirname(infile)].flatten.map do |f| include_path_flags = [include_paths, _include_paths, File.dirname(infile)].flatten.map do |f|
option_include_path % filename(f) option_include_path % filename(f)
end end
_pp "CC #{filename(infile)} > #{filename(outfile)}"
_run compile_options, { :flags => (flags + define_flags + include_path_flags + _flags).join(' '), _run compile_options, { :flags => (flags + define_flags + include_path_flags + _flags).join(' '),
:infile => filename(infile), :outfile => filename(outfile) } :infile => filename(infile), :outfile => filename(outfile) }
end end
...@@ -115,6 +116,7 @@ module MRuby ...@@ -115,6 +116,7 @@ module MRuby
FileUtils.mkdir_p File.dirname(outfile) FileUtils.mkdir_p File.dirname(outfile)
library_flags = [libraries, _libraries].flatten.reverse.map{ |d| option_library % d } library_flags = [libraries, _libraries].flatten.reverse.map{ |d| option_library % d }
library_path_flags = [library_paths, _library_paths].flatten.map{ |f| option_library_path % filename(f) } library_path_flags = [library_paths, _library_paths].flatten.map{ |f| option_library_path % filename(f) }
_pp "LD #{filename(outfile)}"
_run link_options, { :flags => (flags + library_path_flags + _flags).join(' '), _run link_options, { :flags => (flags + library_path_flags + _flags).join(' '),
:outfile => filename(outfile) , :objs => filename(objfiles).join(' '), :outfile => filename(outfile) , :objs => filename(objfiles).join(' '),
:libs => library_flags.join(' ') } :libs => library_flags.join(' ') }
...@@ -132,6 +134,7 @@ module MRuby ...@@ -132,6 +134,7 @@ module MRuby
def run(outfile, objfiles) def run(outfile, objfiles)
FileUtils.mkdir_p File.dirname(outfile) FileUtils.mkdir_p File.dirname(outfile)
_pp "AR #{filename(outfile)}"
_run archive_options, { :outfile => filename(outfile), :objs => filename(objfiles).join(' ') } _run archive_options, { :outfile => filename(outfile), :objs => filename(objfiles).join(' ') }
end end
end end
...@@ -147,6 +150,7 @@ module MRuby ...@@ -147,6 +150,7 @@ module MRuby
def run(outfile, infile) def run(outfile, infile)
FileUtils.mkdir_p File.dirname(outfile) FileUtils.mkdir_p File.dirname(outfile)
_pp "YACC #{filename(infile)} > #{filename(outfile)}"
_run compile_options, { :outfile => filename(outfile) , :infile => filename(infile) } _run compile_options, { :outfile => filename(outfile) , :infile => filename(infile) }
end end
end end
...@@ -162,6 +166,7 @@ module MRuby ...@@ -162,6 +166,7 @@ module MRuby
def run(outfile, infile) def run(outfile, infile)
FileUtils.mkdir_p File.dirname(outfile) FileUtils.mkdir_p File.dirname(outfile)
_pp "GPERF #{filename(infile)} > #{filename(outfile)}"
_run compile_options, { :outfile => filename(outfile) , :infile => filename(infile) } _run compile_options, { :outfile => filename(outfile) , :infile => filename(infile) }
end end
end end
...@@ -178,6 +183,7 @@ module MRuby ...@@ -178,6 +183,7 @@ module MRuby
end end
def run_clone(dir, url, _flags = []) def run_clone(dir, url, _flags = [])
_pp "GIT #{url} > #{filename(dir)}"
_run clone_options, { :flags => [flags, _flags].flatten.join(' '), :url => url, :dir => filename(dir) } _run clone_options, { :flags => [flags, _flags].flatten.join(' '), :url => url, :dir => filename(dir) }
end end
end end
...@@ -193,6 +199,7 @@ module MRuby ...@@ -193,6 +199,7 @@ module MRuby
@command ||= @build.mrbcfile @command ||= @build.mrbcfile
IO.popen("#{filename @command} #{@compile_options % {:funcname => funcname}}", 'r+') do |io| IO.popen("#{filename @command} #{@compile_options % {:funcname => funcname}}", 'r+') do |io|
[infiles].flatten.each do |f| [infiles].flatten.each do |f|
_pp " MRBC #{f}"
io.write IO.read(f) io.write IO.read(f)
end end
io.close_write io.close_write
......
...@@ -19,6 +19,7 @@ MRuby.each_target do ...@@ -19,6 +19,7 @@ MRuby.each_target do
file mlib => [clib] file mlib => [clib]
file clib => [mrbcfile, init, asslib] + mrbs do |t| file clib => [mrbcfile, init, asslib] + mrbs do |t|
_pp "GEN *.rb > #{clib}"
open(clib, 'w') do |f| open(clib, 'w') do |f|
f.puts IO.read(init) f.puts IO.read(init)
mrbc.run f, [asslib] + mrbs, 'mrbtest_irep' mrbc.run f, [asslib] + mrbs, 'mrbtest_irep'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment