# -*- mode: ruby; coding: utf-8 -*- namespace :ext do dir = "#{EXTDIR}/#{NAME}" name = "#{NAME}/tester" outname = "#{name}.#{EXTEXT}" out = File.join EXTDIR, outname extconf = File.join dir, "extconf.rb" makefile = File.join dir, "Makefile" depends = File.join dir, "depends" cpps = Dir.glob("#{dir}/**/*.cpp") task :build => out task :clean do sh %( cd #{dir} && #{MAKE} clean ) if File.exist? makefile sh %( rm -f #{makefile} #{depends} ) end file out => makefile do sh %( cd #{dir} && #{MAKE} ) end file makefile => [extconf, "lib:build"] do #, depends] do sh %( cd #{dir} && #{RUBY} #{File.basename extconf} ) end file depends => cpps do sh %( cd #{dir} && touch #{depends} ) end end# :ext