File: mrblib.rake

package info (click to toggle)
mruby 1.2.0%2B20161228%2Bgit30d5424a-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 2,792 kB
  • ctags: 4,125
  • sloc: ansic: 29,570; ruby: 13,100; yacc: 5,883; sh: 16; makefile: 12
file content (18 lines) | stat: -rw-r--r-- 720 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
MRuby.each_target do
  current_dir = File.dirname(__FILE__)
  relative_from_root = File.dirname(__FILE__).relative_path_from(MRUBY_ROOT)
  current_build_dir = "#{build_dir}/#{relative_from_root}"

  self.libmruby << objfile("#{current_build_dir}/mrblib")

  file objfile("#{current_build_dir}/mrblib") => "#{current_build_dir}/mrblib.c"
  file "#{current_build_dir}/mrblib.c" => [mrbcfile, __FILE__] + Dir.glob("#{current_dir}/*.rb").sort do |t|
    _, _, *rbfiles = t.prerequisites
    FileUtils.mkdir_p File.dirname(t.name)
    open(t.name, 'w') do |f|
      _pp "GEN", "*.rb", "#{t.name.relative_path}"
      f.puts File.read("#{current_dir}/init_mrblib.c")
      mrbc.run f, rbfiles, 'mrblib_irep'
    end
  end
end