source: EcnlProtoTool/trunk/mruby-1.2.0/mrbgems/mruby-bin-mruby-config/mrbgem.rake@ 270

Last change on this file since 270 was 270, checked in by coas-nagasima, 7 years ago

mruby版ECNLプロトタイピング・ツールを追加

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-ruby
File size: 982 bytes
Line 
1module MRuby
2 class Build
3 def exefile(name)
4 if name.is_a?(Array)
5 name.flatten.map { |n| exefile(n) }
6 elsif name !~ /\./
7 "#{name}#{exts.executable}"
8 else
9 name
10 end
11 end
12 end
13end
14
15MRuby.each_target do
16 next if kind_of? MRuby::CrossBuild
17
18 mruby_config = 'mruby-config' + (ENV['OS'] == 'Windows_NT' ? '.bat' : '')
19 mruby_config_path = "#{build_dir}/bin/#{mruby_config}"
20 @bins << mruby_config
21
22 file mruby_config_path => libfile("#{build_dir}/lib/libmruby") do |t|
23 FileUtils.copy "#{File.dirname(__FILE__)}/#{mruby_config}", t.name
24 config = Hash[open("#{build_dir}/lib/libmruby.flags.mak").read.split("\n").map {|x| a = x.split(/\s*=\s*/, 2); [a[0], a[1].gsub('\\"', '"') ]}]
25 IO.write(t.name, File.open(t.name) {|f|
26 f.read.gsub (/echo (MRUBY_CFLAGS|MRUBY_LIBS|MRUBY_LDFLAGS_BEFORE_LIBS|MRUBY_LDFLAGS)/) {|x| config[$1].empty? ? '' : "echo #{config[$1]}"}
27 })
28 FileUtils.chmod(0755, t.name)
29 end
30end
Note: See TracBrowser for help on using the repository browser.