-
Notifications
You must be signed in to change notification settings - Fork 5
/
Rakefile
41 lines (36 loc) · 1 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
MRUBY_CONFIG=File.expand_path(ENV["MRUBY_CONFIG"] || "build_config/host.rb")
MRUBY_VERSION=ENV["MRUBY_VERSION"] || "3.0.0"
file :mruby do
sh "git clone --depth=1 https://github.com/mruby/mruby.git"
if MRUBY_VERSION != 'master'
Dir.chdir 'mruby' do
sh "git fetch --tags"
rev = %x{git rev-parse #{MRUBY_VERSION}}
sh "git checkout #{rev}"
end
end
end
desc "compile binary"
task :compile => :mruby do
sh "cd mruby && rake all MRUBY_CONFIG=#{MRUBY_CONFIG}"
end
desc "test"
task :test => :mruby do
sh "cd mruby && rake all test MRUBY_CONFIG=#{MRUBY_CONFIG}"
end
desc "cleanup"
task :clean do
rm_rf "include/atom_helper.h"
rm_rf "include/keyword_helper.h"
rm_rf "include/token_helper.h"
rm_rf "include/tokenizer_helper.h"
rm_rf "include/parse.h"
rm_rf "lib/lemon"
rm_rf "src/parse.out"
rm_rf "src/parse.c"
rm_rf "src/parse.h"
exit 0 unless File.directory?('mruby')
sh "cd mruby && MRUBY_CONFIG="" rake deep_clean"
rm_rf "mruby/bin/picorbc"
end
task :default => :compile