require 'rake' desc 'Run all the tests' task :default => [ :test ] file 'tests' => Dir['php2ruby.*'] do |t| rm_rf t.name mkdir t.name ruby 'php2ruby.rb' end task :extconf => ['Makefile'] file 'Makefile' => ['extconf.rb'] do ruby 'extconf.rb' end task :lib => 'ibm_db2.so' file 'ibm_db2.so' => [:extconf, 'ibm_db2.c'] do sh 'make' end task :test => [:lib, 'tests.rb', 'tests'] do ruby 'tests.rb' end task :clean do sh 'make clean' if File.exists? 'Makefile' rm_rf ['Makefile','tests','mkmf.log'] end