# # Rakefile – build the libraries #
require “autorake”
c = compiler “-O2”, “-fPIC” l = linker “-shared”
rule “.o” => “.c” do |t|
c.cc t.name, t.source
end
DLs = {
"pgsql.so" => %w(module.o conn.o conn_quote.o conn_exec.o result.o ),
}
DLs.each { |k,v|
task k => v do |t| l.cc t.name, t.prerequisites end
}
task :default => DLs.keys
task :clean do
FileList[ "*.o", "*.so"].each { |f| rm_f f } FileList[ "*.core"].each { |f| rm_f f }
end