Added Rakefile

This commit is contained in:
mbloch
2012-05-16 01:27:14 +01:00
parent c6099f78ea
commit c796a526d0

27
Rakefile Normal file
View File

@@ -0,0 +1,27 @@
DEBUG = true
LIBS = %w( pthread )
CCFLAGS = %w( -Wall )
LDFLAGS = []
if DEBUG
LDFLAGS << ["-g"]
CCFLAGS << ["-g -DDEBUG"]
LIBS << ["efence"]
end
rule 'default' => 'flexnbd'
rule 'flexnbd' => 'flexnbd.o' do |t|
sh "gcc #{LDFLAGS.join(' ')} "+
LIBS.map { |l| "-l#{l}" }.join(" ")+
" -o #{t.name} #{t.source}"
end
rule '.o' => '.c' do |t|
sh "gcc -c #{CCFLAGS.join(' ')} -o #{t.name} #{t.source} "
end
rule 'clean' do
sh "rm -f flexnbd.o flexnbd"
end