Commit 2241c39a authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto

Merge pull request #1245 from NARKOZ/fix-warnings

remove unused variables
parents 2e3e5d9c 9dd539bb
......@@ -101,7 +101,7 @@ module MiniRake
puts "Execute #{name}" if $trace
self.class.enhance_with_matching_rule(name) if @actions.empty?
unless $dryrun
@actions.each { |act| result = act.call(self) }
@actions.each { |act| act.call(self) }
end
end
......@@ -160,14 +160,14 @@ module MiniRake
lookup(task_name).enhance([deps].flatten, &block)
end
# Define a rule for synthesizing tasks.
# Define a rule for synthesizing tasks.
def create_rule(args, &block)
pattern, deps = resolve_args(args)
pattern = Regexp.new(Regexp.quote(pattern) + '$') if String === pattern
RULES << [pattern, deps, block]
end
# Lookup a task. Return an existing task if found, otherwise
# create a task of the current type.
def lookup(task_name)
......@@ -181,7 +181,7 @@ module MiniRake
# the enhanced task or nil of no rule was found.
def enhance_with_matching_rule(task_name)
RULES.each do |pattern, extensions, block|
if md = pattern.match(task_name)
if pattern.match(task_name)
ext = extensions.first
deps = extensions[1..-1]
case ext
......@@ -201,8 +201,8 @@ module MiniRake
end
nil
end
private
private
# Resolve the arguments for a task/rule.
def resolve_args(args)
......@@ -256,7 +256,7 @@ module MiniRake
# demand.
def directory(dir)
path = []
Sys.split_all(dir).each do |p|
Sys.split_all(dir).each do |p|
path << p
FileTask.define_task(File.join(path)) do |t|
Sys.makedirs(t.name)
......@@ -415,7 +415,7 @@ class RakeApp
fail "Unknown option: #{opt}"
end
end
# Read and handle the command line options.
def handle_options
$verbose = false
......
MRuby.each_target do
current_dir = File.dirname(__FILE__).relative_path_from(Dir.pwd)
relative_from_root = File.dirname(__FILE__).relative_path_from(MRUBY_ROOT)
if enable_gems?
# set up all gems
gems.each(&:setup)
gems.check
# loader all gems
self.libmruby << objfile("#{build_dir}/mrbgems/gem_init")
file objfile("#{build_dir}/mrbgems/gem_init") => ["#{build_dir}/mrbgems/gem_init.c", "#{build_dir}/LEGAL"]
......@@ -75,7 +72,7 @@ Additional Licenses
Due to the reason that you choosed additional mruby packages (GEMS),
please check the following additional licenses too:
GEMS_LEGAL
gems.map do |g|
f.puts
f.puts "GEM: #{g.name}"
......
MRuby.each_target do
current_dir = File.dirname(__FILE__).relative_path_from(Dir.pwd)
relative_from_root = File.dirname(__FILE__).relative_path_from(MRUBY_ROOT)
current_build_dir = "#{build_dir}/#{relative_from_root}"
gems.each do |g|
test_rbobj = g.test_rbireps.ext(exts.object)
......@@ -52,8 +48,8 @@ MRuby.each_target do
f.puts %Q[ mrb_const_set(mrb2, mrb_obj_value(mrb2->object_class), mrb_intern(mrb2, "TEST_ARGS"), test_args_hash); ]
end
f.puts %Q[ mrb_#{g.funcname}_gem_test(mrb2);] unless g.test_objs.empty?
f.puts %Q[ mrb_#{g.funcname}_gem_test(mrb2);] unless g.test_objs.empty?
f.puts %Q[ mrb_load_irep(mrb2, gem_test_irep_#{g.funcname}_#{i});]
f.puts %Q[ if (mrb2->exc) {]
f.puts %Q[ mrb_p(mrb2, mrb_obj_value(mrb2->exc));]
......
......@@ -29,7 +29,7 @@ module MRuby
sh build.filename(command) + ' ' + ( options % params )
end
end
class Command::Compiler < Command
attr_accessor :flags, :include_paths, :defines, :source_exts
attr_accessor :compile_options, :option_define, :option_include_path, :out_ext
......@@ -57,13 +57,9 @@ module MRuby
end
[flags, define_flags, include_path_flags, _flags].flatten.join(' ')
end
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 do |f|
option_include_path % filename(f)
end
_pp "CC", infile.relative_path, outfile.relative_path
if MRUBY_BUILD_HOST_IS_CYGWIN
_run compile_options, { :flags => all_flags(_defineds, _include_paths, _flags),
......@@ -152,7 +148,6 @@ module MRuby
def run(outfile, objfiles, _libraries=[], _library_paths=[], _flags=[], _flags_before_libraries=[], _flags_after_libraries=[])
FileUtils.mkdir_p File.dirname(outfile)
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", outfile.relative_path
if MRUBY_BUILD_HOST_IS_CYGWIN
......
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