-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
executable file
·43 lines (33 loc) · 1.01 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
MRUBY_CONFIG=File.expand_path(ENV["MRUBY_CONFIG"] || "build_config_sample.rb")
MRUBY_CONFIG_TEST=File.expand_path(ENV["MRUBY_CONFIG"] || "build_config_test.rb")
file :mruby do
sh "git clone --depth 1 git://github.com/mruby/mruby.git"
end
INPUT = 'tasks/generate.rb'
OUTPUT = 'src/mruby_float4.c'
file OUTPUT => INPUT do
sh "ruby #{INPUT} > #{OUTPUT}"
end
task :default => :test
desc "compile binary"
task :compile => :mruby do
sh "cd mruby && MRUBY_CONFIG=#{MRUBY_CONFIG} rake all"
end
desc "test"
task :test => [:mruby, OUTPUT] do
sh "cd mruby && MRUBY_CONFIG=#{MRUBY_CONFIG} rake test"
end
desc "ci_test"
task :ci_test => [:mruby, OUTPUT] do
sh "cd mruby && MRUBY_CONFIG=#{MRUBY_CONFIG_TEST} rake test"
end
desc "cleanup"
task :clean do
sh "cd mruby && rake deep_clean"
end
task :bench_ruby do
sh 'time ./mruby/build/bench/bin/mruby benchmark/bm_ao_render.rb > benchmark/ruby.ppm'
end
task :bench_float4 do
sh 'time ./mruby/build/bench/bin/mruby benchmark/bm_ao_render_float4.rb > benchmark/float4.ppm'
end