3 require "rake/testtask"
4 require "rake/rdoctask"
5 require "rake/packagetask"
6 require "rake/contrib/compositepublisher"
7 require "rake/contrib/sshpublisher"
9 CLOBBER.include("src/**/*.{s,}o")
11 ext_libs = ["container", "draggies", "trans_x11", "file_dialog"].map do |lib|
13 Library.new(lib, ENV["ESMART_PREFIX"] || "/usr/local", "src/#{lib}")
16 l = Library.new("esmart", ENV["ESMART_PREFIX"] || "/usr/local", "src", nil)
19 task :default => ext_libs.map { |l| l.so }
21 ext_libs.each do |lib|
22 file lib.so => lib.objects do |t|
23 sh "cc #{lib.ldflags} #{t.prerequisites.join(" ")} -o #{t.name}"
26 lib.objects.each do |object|
27 file object => object.sub(/\.[^.]+$/, ".c") do |t|
28 sh "cc #{lib.cflags} #{t.prerequisites.first} " +
34 task :install => ext_libs.map { |l| l.so } do |t|
35 destdir = "#{ENV["DESTDIR"]}"
36 sitearchdir = ENV["RUBYARCHDIR"] || Config::CONFIG['sitearchdir']
38 FileUtils::Verbose.install(t.prerequisites.to_a, destdir + sitearchdir,