gen Rule, '.o' => '.c' do |t|
    sys "cc -c -o #{t.name} #{t.source}"
end

gen Rule, :tt => :t do |t|
    t.source =~ /\.t$/ or t.fail
    sys.touch t.name
end

gen Rule, :t do |t|
    test(?e, t.name) && t.fail
    sys.touch t.name
end

src = lambda { |target| [target.sub_ext("t"), target.sub_ext("tt")] }
gen Rule, :lt => src do |t|
    t.prerequisites[0] =~ /\.t$/ or t.fail
    t.prerequisites[1] =~ /\.tt$/ or t.fail
    sys.touch t.name
end

src = lambda { |target| target + "t" }
gen Rule, :rt => src do |t|
    t.prerequisites[0] =~ /\.rtt$/ or t.fail
    t.source =~ /\.rtt$/ or t.fail
    sys.touch t.name
end

gen Rule, :ett => :et do |t|
    sys.touch t.name
end

if var[:enhance_t]
    enhance "eh.t" do
	puts "eh.t created"
    end
end

# vim:ft=ruby
