2 current_dir = File.dirname(__FILE__)
3 relative_from_root = File.dirname(__FILE__).relative_path_from(MRUBY_ROOT)
4 current_build_dir = "#{build_dir}/#{relative_from_root}"
6 self.libmruby_objs << objfile("#{current_build_dir}/mrblib")
8 file objfile("#{current_build_dir}/mrblib") => "#{current_build_dir}/mrblib.c"
9 file "#{current_build_dir}/mrblib.c" => [mrbcfile, __FILE__] + Dir.glob("#{current_dir}/*.rb").sort do |t|
10 _, _, *rbfiles = t.prerequisites
11 FileUtils.mkdir_p File.dirname(t.name)
12 open(t.name, 'w') do |f|
13 _pp "GEN", "*.rb", "#{t.name.relative_path}"
14 f.puts File.read("#{current_dir}/init_mrblib.c")
15 mrbc.run f, rbfiles, 'mrblib_irep'