<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -19,10 +19,10 @@ module Ono
       target = @repository.target(name)
       return nil unless target &amp;&amp; target.valid?
       if target.type == :executable
-        return build_executable(target.abs_path)
+        return build_executable(target)
       else
         source = target.src
-        deps = find_deps target.src.abs_path
+        deps = find_deps target
         deps.each {|dep| build_target dep}
         compiler = @compiler_factory.get_compiler_for source
         args = []
@@ -34,27 +34,24 @@ module Ono
     private
 
     def build_executable(target)
-      objname = target + &quot;.o&quot;
-      return false unless build_target(objname)
+      return false unless build_target(target.name + &quot;.o&quot;)
       deps = find_deps target
       deps.each {|dep| build_target dep}
       deps.map! {|dep| @repository.abs_path dep}
-      compiler = @compiler_factory.get_compiler_for objname
-      deps &lt;&lt; objname
-      compiler.link deps, target
+      compiler = @compiler_factory.get_compiler_for(target.name + &quot;.o&quot;)
+      deps &lt;&lt; target.abs_path + &quot;.o&quot;
+      compiler.link deps, target.abs_path
     end
 
     def find_deps(target)
-      abs_target = @repository.abs_path target
-      src = find_source_for target
+      abs_target = target.abs_path
       candidate_deps = []
       include_re = Regexp.new '^#include &quot;(.*)&quot;'
-      File.open(src).each_line do |line|
+      File.open(target.src.abs_path).each_line do |line|
         if include_re =~ line
           header = @repository.abs_path Regexp.last_match(1)
-          # TODO: Should compare absolute path here.
           basename = header.chomp(File.extname header)
-          unless basename == abs_target.chomp(File.extname target)
+          unless basename == abs_target.chomp(File.extname target.abs_path)
             obj = basename + &quot;.o&quot;
             candidate_deps &lt;&lt; obj if find_source_for(@repository.abs_path(obj))
           end</diff>
      <filename>lib/ono/builder.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>c01c9b2234b9c79a87f623e706d0a7ba01fe449d</id>
    </parent>
  </parents>
  <author>
    <name>Hong Jiang</name>
    <email>hong@hjiang.net</email>
  </author>
  <url>http://github.com/hjiang/ono/commit/35fa77ec7b3a1474476a53598fcb399b9817f74d</url>
  <id>35fa77ec7b3a1474476a53598fcb399b9817f74d</id>
  <committed-date>2009-10-18T00:45:49-07:00</committed-date>
  <authored-date>2009-10-18T00:45:49-07:00</authored-date>
  <message>more refactoring</message>
  <tree>95676433ee3ad238fa5e34aadae0dd470173e8f6</tree>
  <committer>
    <name>Hong Jiang</name>
    <email>hong@hjiang.net</email>
  </committer>
</commit>
