Remove unused Rake rules
Currently, the source file language in the core is C only, and C++,
Objective-C, and Assembly are not used, so Rake rules for them are removed.
MODIFY
lib/mruby/build.rb
lib/mruby/build.rb
@@ -277,8 +277,8 @@ EOS
compiler.defines += %w(MRB_NO_GEMS)
end
compiler.defines |= %w(MRB_USE_DEBUG_HOOK) if use_mrdb
- compiler.define_rules build_dir, File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))
end
+ cc.define_rules(build_dir, MRUBY_ROOT)
end
def filename(name)

MODIFY
lib/mruby/gem.rb
lib/mruby/gem.rb
@@ -81,12 +81,7 @@ module MRuby
@generate_functions = !(@rbfiles.empty? && @objs.empty?)
@objs << objfile("#{build_dir}/gem_init") if @generate_functions
- mgem = MRUBY_ROOT+"/mrbgems"
- if @dir[0,mgem.size] == mgem
- @cdump = true # OK to cdump core mrbgems
- else
- @cdump = false # use mrb dump by default
- end
+ @cdump = core? # by default core gems use cdump and others use mrb dump
if !name || !licenses || !authors
fail "#{name || dir} required to set name, license(s) and author(s)"
@@ -101,7 +96,7 @@ module MRuby
end
def setup_compilers
- compilers.each do |compiler|
+ (core? ? [cc] : compilers).each do |compiler|
compiler.define_rules build_dir, "#{dir}"
compiler.defines << %Q[MRBGEM_#{funcname.upcase}_VERSION=#{version}]
compiler.include_paths << "#{dir}/include" if File.directory? "#{dir}/include"
@@ -127,6 +122,10 @@ module MRuby
@cdump
end
+ def core?
+ @dir.start_with?("#{MRUBY_ROOT}/mrbgems/")
+ end
+
def add_dependency(name, *requirements)
default_gem = requirements.last.kind_of?(Hash) ? requirements.pop : nil
requirements = ['>= 0.0.0'] if requirements.empty?

Remove unused Rake rules

Currently, the source file language in the core is C only, and C++,
Objective-C, and Assembly are not used, so Rake rules for them are removed.