1 # $Id: Rakefile 336 2005-05-02 17:29:52Z tilman $
5 require "rake/testtask"
6 require "rake/rdoctask"
7 require "rake/packagetask"
8 require "rake/contrib/compositepublisher"
9 require "rake/contrib/sshpublisher"
11 CLOBBER.include("src/**/*.{s,}o")
13 ext_libs = ["container", "draggies", "trans_x11", "file_dialog"].map do |lib|
15 Library.new(lib, ENV["ESMART_PREFIX"] || "/usr/local", "src/#{lib}")
18 l = Library.new("esmart", ENV["ESMART_PREFIX"] || "/usr/local", "src", nil)
21 task :default => ext_libs.map { |l| l.so }
23 ext_libs.each do |lib|
24 file lib.so => lib.objects do |t|
25 sh "cc #{lib.ldflags} #{t.prerequisites.join(" ")} -o #{t.name}"
28 lib.objects.each do |object|
29 file object => object.sub(/\.[^.]+$/, ".c") do |t|
30 sh "cc #{lib.cflags} #{t.prerequisites.first} " +
36 task :install => ext_libs.map { |l| l.so } do |t|
37 destdir = "#{ENV["DESTDIR"]}"
38 sitearchdir = Config::CONFIG['sitearchdir']
40 FileUtils::Verbose.install(t.prerequisites.to_a, destdir + sitearchdir,