diff options
| author | Yuichiro MASUI <[email protected]> | 2013-01-24 11:21:39 +0900 |
|---|---|---|
| committer | Yuichiro MASUI <[email protected]> | 2013-01-24 11:21:39 +0900 |
| commit | b1623b9e58544996b02a8a0050546521d7f738eb (patch) | |
| tree | bf6859ec1006dd2108efa0c2d285509cd0ec06c7 /tasks/mruby_build_commands.rake | |
| parent | a1c4992905e6e3df1e6841085c552b33cf525b0f (diff) | |
| parent | 65623d7d66c2ef4e3136ab90077ece988c451750 (diff) | |
| download | mruby-b1623b9e58544996b02a8a0050546521d7f738eb.tar.gz mruby-b1623b9e58544996b02a8a0050546521d7f738eb.zip | |
merge master
Diffstat (limited to 'tasks/mruby_build_commands.rake')
| -rw-r--r-- | tasks/mruby_build_commands.rake | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/tasks/mruby_build_commands.rake b/tasks/mruby_build_commands.rake index abaf3a72c..23d2c31ae 100644 --- a/tasks/mruby_build_commands.rake +++ b/tasks/mruby_build_commands.rake @@ -56,8 +56,12 @@ module MRuby def run(outfile, infile, _defineds=[], _include_paths=[], _flags=[]) FileUtils.mkdir_p File.dirname(outfile) - _pp "CC #{filename(infile)} > #{filename(outfile)}" - _run compile_options, { :flags => all_flags(_defineds, [_include_paths, File.dirname(infile)], _flags), + define_flags = [defines, _defineds].flatten.map{ |d| option_define % d } + 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 => all_flags(_defineds, _include_paths, _flags), :infile => filename(infile), :outfile => filename(outfile) } end @@ -125,14 +129,12 @@ module MRuby end def library_flags(_libraries) - [libraries, _libraries].flatten.reverse.map do |d| - option_library % d - end.join(' ') + [libraries, _libraries].flatten.map{ |d| option_library % d }.join(' ') end def run(outfile, objfiles, _libraries=[], _library_paths=[], _flags=[], _flags_before_libraries=[]) FileUtils.mkdir_p File.dirname(outfile) - library_flags = [libraries, _libraries].flatten.reverse.map { |d| option_library % d } + library_flags = [libraries, _libraries].flatten.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 => all_flags(_library_paths, _flags), @@ -153,7 +155,7 @@ module MRuby def run(outfile, objfiles) FileUtils.mkdir_p File.dirname(outfile) - _pp "AR #{filename(outfile)}" + _pp "AR", "#{filename(outfile)}" _run archive_options, { :outfile => filename(outfile), :objs => filename(objfiles).join(' ') } end end @@ -169,7 +171,7 @@ module MRuby def run(outfile, infile) FileUtils.mkdir_p File.dirname(outfile) - _pp "YACC #{filename(infile)} > #{filename(outfile)}" + _pp "YACC", "#{filename(infile)}", "#{filename(outfile)}" _run compile_options, { :outfile => filename(outfile) , :infile => filename(infile) } end end @@ -185,7 +187,7 @@ module MRuby def run(outfile, infile) FileUtils.mkdir_p File.dirname(outfile) - _pp "GPERF #{filename(infile)} > #{filename(outfile)}" + _pp "GPERF", "#{filename(infile)}", "#{filename(outfile)}" _run compile_options, { :outfile => filename(outfile) , :infile => filename(infile) } end end @@ -202,7 +204,7 @@ module MRuby end def run_clone(dir, url, _flags = []) - _pp "GIT #{url} > #{filename(dir)}" + _pp "GIT", "#{url}", "#{filename(dir)}" _run clone_options, { :flags => [flags, _flags].flatten.join(' '), :url => url, :dir => filename(dir) } end end @@ -218,7 +220,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}" + _pp "MRBC", "#{f}", nil, :indent => 2 io.write IO.read(f) end io.close_write |
