From 46b9118562667d5f1a78452c8c531cf8ed27a664 Mon Sep 17 00:00:00 2001 From: Daniel Bovensiepen Date: Mon, 21 Jan 2013 14:08:30 +0800 Subject: Fix Visual Studio Toolchain --- tasks/toolchains/vs2012.rake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/toolchains/vs2012.rake b/tasks/toolchains/vs2012.rake index 8b4212468..1f6ea2d65 100644 --- a/tasks/toolchains/vs2012.rake +++ b/tasks/toolchains/vs2012.rake @@ -12,8 +12,8 @@ MRuby::Toolchain.new(:vs2012) do |conf| conf.linker do |linker| linker.command = ENV['LD'] || 'link.exe' linker.flags = [ENV['LDFLAGS'] || %w(/nologo)] - linkerraries = %w(kernel32 user32 gdi32 winspool comdlg32 advapi32 shell32 ole32 oleaut32 uuid odbc32 odbccp32) - linkerrary_paths = [] + linker.libraries = %w(kernel32 user32 gdi32 winspool comdlg32 advapi32 shell32 ole32 oleaut32 uuid odbc32 odbccp32) + linker.library_paths = [] linker.option_library = '-l%s' linker.option_library_path = '-L%s' linker.link_options = "%{flags} /OUT:%{outfile} %{objs} %{libs}" -- cgit v1.2.3 From 73eba4d4e86e3bbad0b9c0b24ce88561921470ab Mon Sep 17 00:00:00 2001 From: Daniel Bovensiepen Date: Mon, 21 Jan 2013 14:13:17 +0800 Subject: Reduce line length --- tasks/mrbgem_spec.rake | 8 ++++++-- tasks/mruby_build_commands.rake | 13 +++++++++---- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/tasks/mrbgem_spec.rake b/tasks/mrbgem_spec.rake index e21e0b670..bf381cf33 100644 --- a/tasks/mrbgem_spec.rake +++ b/tasks/mrbgem_spec.rake @@ -46,11 +46,15 @@ module MRuby end @rbfiles = Dir.glob("#{dir}/mrblib/*.rb") - @objs = Dir.glob("#{dir}/src/*.{c,cpp,m,asm,S}").map { |f| objfile(f.relative_path_from(@dir).to_s.pathmap("#{build_dir}/%X")) } + @objs = Dir.glob("#{dir}/src/*.{c,cpp,m,asm,S}").map do |f| + objfile(f.relative_path_from(@dir).to_s.pathmap("#{build_dir}/%X")) + end @objs << objfile("#{build_dir}/gem_init") @test_rbfiles = Dir.glob("#{dir}/test/*.rb") - @test_objs = Dir.glob("#{dir}/test/*.{c,cpp,m,asm,S}").map { |f| objfile(f.relative_path_from(dir).to_s.pathmap("#{build_dir}/%X")) } + @test_objs = Dir.glob("#{dir}/test/*.{c,cpp,m,asm,S}").map do |f| + objfile(f.relative_path_from(dir).to_s.pathmap("#{build_dir}/%X")) + end @test_preload = 'test/assert.rb' instance_eval(&@initializer) diff --git a/tasks/mruby_build_commands.rake b/tasks/mruby_build_commands.rake index 023b23763..5db86a942 100644 --- a/tasks/mruby_build_commands.rake +++ b/tasks/mruby_build_commands.rake @@ -49,8 +49,11 @@ module MRuby def run(outfile, infile, _defineds=[], _include_paths=[], _flags=[]) FileUtils.mkdir_p File.dirname(outfile) define_flags = [defines, _defineds].flatten.map{ |d| option_define % d } - include_path_flags = [include_paths, _include_paths, File.dirname(infile)].flatten.map{ |f| option_include_path % filename(f) } - _run compile_options, { :flags => (flags + define_flags + include_path_flags + _flags).join(' '), :infile => filename(infile), :outfile => filename(outfile) } + include_path_flags = [include_paths, _include_paths, File.dirname(infile)].flatten.map do |f| + option_include_path % filename(f) + end + _run compile_options, { :flags => (flags + define_flags + include_path_flags + _flags).join(' '), + :infile => filename(infile), :outfile => filename(outfile) } end def define_rules(build_dir, source_dir='') @@ -112,7 +115,9 @@ module MRuby FileUtils.mkdir_p File.dirname(outfile) 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) } - _run link_options, { :flags => (flags + library_path_flags + _flags).join(' '), :outfile => filename(outfile) , :objs => filename(objfiles).join(' '), :libs => library_flags.join(' ') } + _run link_options, { :flags => (flags + library_path_flags + _flags).join(' '), + :outfile => filename(outfile) , :objs => filename(objfiles).join(' '), + :libs => library_flags.join(' ') } end end @@ -195,4 +200,4 @@ module MRuby end end end -end \ No newline at end of file +end -- cgit v1.2.3 From 56928e9fee2d6d604d72b767826b3ee1d43502b0 Mon Sep 17 00:00:00 2001 From: Daniel Bovensiepen Date: Mon, 21 Jan 2013 15:57:45 +0800 Subject: make minirake respect verbose and set verbose to false by default --- minirake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/minirake b/minirake index 00a2e6486..430e730cb 100755 --- a/minirake +++ b/minirake @@ -277,7 +277,7 @@ module MiniRake # Run the system command +cmd+. def sh(cmd) - puts cmd + puts cmd if $verbose system(cmd) or fail "Command Failed: [#{cmd}]" end @@ -418,7 +418,7 @@ class RakeApp # Read and handle the command line options. def handle_options - $verbose = true + $verbose = false opts = GetoptLong.new(*command_line_options) opts.each { |opt, value| do_option(opt, value) } end -- cgit v1.2.3 From 9d9e784a56a43b3b5752fdab8031684f8399c084 Mon Sep 17 00:00:00 2001 From: Daniel Bovensiepen Date: Mon, 21 Jan 2013 15:58:20 +0800 Subject: Set default rake to not verbose --- tasks/ruby_ext.rake | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tasks/ruby_ext.rake b/tasks/ruby_ext.rake index ebd499063..22a8409d4 100644 --- a/tasks/ruby_ext.rake +++ b/tasks/ruby_ext.rake @@ -33,3 +33,26 @@ class Symbol proc { |obj, *args| obj.send(self, *args) } end end + +$pp_show = true + +if $verbose.nil? + unless Rake.verbose.nil? + if Rake.verbose.class == TrueClass + # verbose message logging + $pp_show = false + else + $pp_show = true + Rake.verbose(false) + end + else + # could not identify rake version + $pp_show = false + end +else + $pp_show = false if $verbose +end + +def _pp(msg) + puts msg if $pp_show +end -- cgit v1.2.3 From 300f0d548b956aa6d36e1768a96fd8ec6d400297 Mon Sep 17 00:00:00 2001 From: Daniel Bovensiepen Date: Mon, 21 Jan 2013 15:58:47 +0800 Subject: Beautify the output of rake --- mrblib/mrblib.rake | 1 + tasks/mruby_build_commands.rake | 7 +++++++ test/mrbtest.rake | 1 + 3 files changed, 9 insertions(+) diff --git a/mrblib/mrblib.rake b/mrblib/mrblib.rake index 493207db4..46d8c5a79 100644 --- a/mrblib/mrblib.rake +++ b/mrblib/mrblib.rake @@ -7,6 +7,7 @@ MRuby.each_target do mrbc_, *rbfiles = t.prerequisites FileUtils.mkdir_p File.dirname(t.name) open(t.name, 'w') do |f| + _pp "GEN *.rb > #{t.name}" f.puts File.read("#{dir}/init_mrblib.c") mrbc.run f, rbfiles, 'mrblib_irep' end diff --git a/tasks/mruby_build_commands.rake b/tasks/mruby_build_commands.rake index 5db86a942..6c160784b 100644 --- a/tasks/mruby_build_commands.rake +++ b/tasks/mruby_build_commands.rake @@ -52,6 +52,7 @@ module MRuby include_path_flags = [include_paths, _include_paths, File.dirname(infile)].flatten.map do |f| option_include_path % filename(f) end + _pp "CC #{filename(infile)} > #{filename(outfile)}" _run compile_options, { :flags => (flags + define_flags + include_path_flags + _flags).join(' '), :infile => filename(infile), :outfile => filename(outfile) } end @@ -115,6 +116,7 @@ module MRuby FileUtils.mkdir_p File.dirname(outfile) 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) } + _pp "LD #{filename(outfile)}" _run link_options, { :flags => (flags + library_path_flags + _flags).join(' '), :outfile => filename(outfile) , :objs => filename(objfiles).join(' '), :libs => library_flags.join(' ') } @@ -132,6 +134,7 @@ module MRuby def run(outfile, objfiles) FileUtils.mkdir_p File.dirname(outfile) + _pp "AR #{filename(outfile)}" _run archive_options, { :outfile => filename(outfile), :objs => filename(objfiles).join(' ') } end end @@ -147,6 +150,7 @@ module MRuby def run(outfile, infile) FileUtils.mkdir_p File.dirname(outfile) + _pp "YACC #{filename(infile)} > #{filename(outfile)}" _run compile_options, { :outfile => filename(outfile) , :infile => filename(infile) } end end @@ -162,6 +166,7 @@ module MRuby def run(outfile, infile) FileUtils.mkdir_p File.dirname(outfile) + _pp "GPERF #{filename(infile)} > #{filename(outfile)}" _run compile_options, { :outfile => filename(outfile) , :infile => filename(infile) } end end @@ -178,6 +183,7 @@ module MRuby end def run_clone(dir, url, _flags = []) + _pp "GIT #{url} > #{filename(dir)}" _run clone_options, { :flags => [flags, _flags].flatten.join(' '), :url => url, :dir => filename(dir) } end end @@ -193,6 +199,7 @@ module MRuby @command ||= @build.mrbcfile IO.popen("#{filename @command} #{@compile_options % {:funcname => funcname}}", 'r+') do |io| [infiles].flatten.each do |f| + _pp " MRBC #{f}" io.write IO.read(f) end io.close_write diff --git a/test/mrbtest.rake b/test/mrbtest.rake index 591b737cd..88d959995 100644 --- a/test/mrbtest.rake +++ b/test/mrbtest.rake @@ -19,6 +19,7 @@ MRuby.each_target do file mlib => [clib] file clib => [mrbcfile, init, asslib] + mrbs do |t| + _pp "GEN *.rb > #{clib}" open(clib, 'w') do |f| f.puts IO.read(init) mrbc.run f, [asslib] + mrbs, 'mrbtest_irep' -- cgit v1.2.3