1 # $Id: Rakefile 340 2005-05-07 11:02:41Z 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_obj = Dir["src/*.c"].map { |f| f.sub(/\.[^.]+$/, ".o") }
14 ext_lib = Library.new("evas", ENV["EVAS_PREFIX"] || "/usr/local", "src")
16 task :default => [ext_lib.so]
18 file ext_lib.so => ext_lib.objects do |t|
19 sh "cc #{ext_lib.ldflags} -shared -Wl " +
20 "-L #{Config::CONFIG['libdir']} " +
21 Config::CONFIG["LIBRUBYARG_SHARED"] +
22 " #{t.prerequisites.join(" ")} -o #{t.name}"
25 ext_lib.objects.each do |object|
26 file object => object.sub(/\.[^.]+$/, ".c") do |t|
27 source = t.prerequisites.first
28 sh "cc #{ext_lib.cflags} -fPIC #{source} -c -o #{t.name}"
32 task :install => [ext_lib.so] do |t|
33 destdir = "#{ENV["DESTDIR"]}"
34 sitearchdir = ENV["RUBYARCHDIR"] || Config::CONFIG['sitearchdir']
36 FileUtils::Verbose.install(ext_lib.so, destdir + sitearchdir,
39 ddir = destdir + sitearchdir + "/evas"
40 FileUtils::Verbose.mkdir(ddir) unless File.directory?(ddir)
42 headers = ["src/rb_evas.h", "src/rb_evas_object.h"]
43 FileUtils::Verbose.install(headers, ddir, :mode => 0644)