Files
flexnbd-c/Rakefile

61 lines
1.2 KiB
Ruby
Raw Normal View History

# encoding: utf-8
def make(*targets)
sh "make #{targets.map{|t| t.to_s}.join(" ")}"
2014-01-22 11:42:00 +00:00
end
def maketask( opts )
case opts
when Symbol
maketask opts => opts
else
opts.each do |name, targets|
task( name ){make *[*targets]}
end
end
2012-05-16 01:27:14 +01:00
end
desc "Build the binary and man page"
maketask :build => [:all, :doc]
desc "Build just the flexnbd binary"
maketask :flexnbd => [:server]
file "build/flexnbd" => :flexnbd
2012-05-16 01:27:14 +01:00
desc "Build just the flexnbd-proxy binary"
maketask :flexnbd_proxy => [:proxy]
file "build/flexnbd-proxy" => :flexnbd_proxy
desc "Build just the man page"
maketask :man => :doc
namespace "test" do
desc "Run all tests"
task 'run' => ["unit", "scenarios"]
desc "Build C tests"
maketask :build => :check_bins
desc "Run C tests"
maketask :unit => :check
desc "Run NBD test scenarios"
task 'scenarios' => ["build/flexnbd", "build/flexnbd-proxy"] do
sh "cd tests/acceptance && RUBYOPT='-I.' ruby nbd_scenarios -v"
end
end
desc "Remove all build targets, binaries and temporary files"
maketask :clean
file "debian/changelog" do
FileUtils.mkdir_p "debian"
sh "hg log --style=changelog.template > debian/changelog"
end
desc "Generate the changelog"
task :changelog => "debian/changelog"