Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

65 lines (50 sloc) 1.32 kb
require 'rake'
require 'rake/clean'
require 'rake/rdoctask'
require 'rake/gempackagetask'
require 'rake/testtask'
require 'fileutils'
include FileUtils
# Default Rake task is compile
task :default => :compile
def make(makedir)
Dir.chdir(makedir) { sh 'make' }
end
def extconf(dir)
Dir.chdir(dir) { ruby "extconf.rb" }
end
def setup_extension(dir, extension)
ext = "ext/#{dir}"
ext_so = "#{ext}/#{extension}.#{Config::CONFIG['DLEXT']}"
ext_files = FileList[
"#{ext}/*.c",
"#{ext}/*.h",
"#{ext}/extconf.rb",
"#{ext}/Makefile",
"lib"
]
task "lib" do
directory "lib"
end
desc "Builds just the #{extension} extension"
task extension.to_sym => ["#{ext}/Makefile", ext_so ]
file "#{ext}/Makefile" => ["#{ext}/extconf.rb"] do
extconf "#{ext}"
end
file ext_so => ext_files do
make "#{ext}"
cp ext_so, "lib"
end
end
setup_extension("", "sbloomfilter")
task :compile => [:sbloomfilter]
CLEAN.include ['build/*', '**/*.o', '**/*.so', '**/*.a', '**/*.log', 'pkg']
CLEAN.include ['ext/Makefile']
Rake::TestTask.new do |t|
%w[ ext lib test ].each do |dir|
t.libs << dir
end
t.test_files = FileList['test/test_*.rb']
t.verbose = true
end
Rake::Task[:test].prerequisites << :compile
Jump to Line
Something went wrong with that request. Please try again.