 +}
 +
 +NINJA_BASE = """\
-+# Rules run in subdirectories but expect to be able to reach out to
-+# builddir, so use an absolute path.
-+builddir = %(cwd)s/ninja/
++builddir = $root/ninja
 +
 +cc = gcc
 +cxx = g++

+    print >>master_ninja, 'subninja', ninja
+
+  if all_outputs:
+    print >>master_ninja, 'build all: phony ' + ' '.join(all_outputs)
+
+  master_ninja.close()
+  OverPrint('done.\n')

+      # Then write out an edge using the rule.
+      self.WriteEdge(outputs, name, inputs)
+      all_outputs += outputs
+
+      # And a phony edge to run the action by name.
+      self.WriteEdge([name], 'phony', outputs)
+
+      self.WriteLn()
+
