File: bin.rake

package info (click to toggle)
mruby 3.4.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,584 kB
  • sloc: ansic: 51,933; ruby: 29,510; yacc: 7,077; cpp: 517; makefile: 51; sh: 42
file content (23 lines) | stat: -rw-r--r-- 813 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
MRuby.each_target do |build|
  if build.host? && build.mrbc_build && !build.gems["mruby-bin-mrbc"]
    exe = build.exefile("#{build.mrbc_build.build_dir}/bin/mrbc")
    build.products << build.define_installer(exe)
  end

  build.bins.each{|bin| build.products << define_installer_if_needed(bin)}

  build.gems.each do |gem|
    linker_attrs = build.gems.linker_attrs(gem)
    gem.bins.each do |bin|
      exe = build.exefile("#{build.build_dir}/bin/#{bin}")
      objs = Dir["#{gem.dir}/tools/#{bin}/*.{c,cpp,cxx,cc}"].map do |f|
        build.objfile(f.pathmap("#{gem.build_dir}/tools/#{bin}/%n"))
      end
      file exe => objs.concat(build.libraries) do |t|
        build.linker.run t.name, t.prerequisites, *linker_attrs
      end

      build.products << define_installer_if_needed(bin)
    end
  end
end