public
Description: LLVM bindings for Ruby
Homepage: http://llvmruby.org
Clone URL: git://github.com/tombagby/llvmruby.git
llvmruby / Rakefile
100644 32 lines (25 sloc) 0.753 kb
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
require 'rake/testtask'
 
desc "Run the tests"
Rake::TestTask.new(:test) do |t|
  t.libs << 'ext'
  t.test_files = FileList['test/test*.rb']
  t.warning = true
end
 
OBJ = "ext/llvmruby." + Config::CONFIG["DLEXT"]
 
file "ext/Makefile" do
  #cmd = "extconf.rb --with-llvm-include=`llvm-config --includedir` --with-llvm-lib=`llvm-config --libdir`"
  cmd = 'extconf.rb'
  Dir.chdir("ext") { ruby(cmd) }
end
 
file OBJ => %w(ext/Makefile) + FileList["ext/*.{cpp,c,h}"] do
  Dir.chdir("ext") { sh "make" }
end
 
desc "Compile llvmruby extensions"
task :compile => OBJ
task :default => :compile
 
desc "Remove compiled files"
task :clean do |t|
  for file in FileList.new("ext/*.o", "ext/Makefile", "ext/mkmf.log", OBJ)
    File.delete(file) rescue true
  end
end