 +NINJA_BASE = """\
 +builddir = $root/ninja
 +
-+cc = gcc
-+cxx = g++
++cc = ccache gcc
++cxx = ccache g++
 +
 +rule cc
 +  depfile = $out.d

===================================================================
--- pylib/gyp/generator/ninja.py	(revision 0)
+++ pylib/gyp/generator/ninja.py	(revision 0)
@@ -0,0 +1,497 @@
+#!/usr/bin/python
+
+# Copyright (c) 2010 Google Inc. All rights reserved.

+  def ComputeOutput(self, spec):
+    filename = self.ComputeOutputFileName(spec)
+
+    assert 'product_prefix' not in spec
+    if 'product_name' in spec:
+      print 'XXX ignoring product_name', spec['product_name']
+    assert 'product_extension' not in spec
+
+    if 'product_dir' in spec:
+      path = os.path.join(spec['product_dir'], filename)
+      print 'pdir', path
+      return path
+
+    # Executables and loadable modules go into the output root,
+    # libraries go into shared library dir, and everything else
+    # goes into the normal place.
+    if spec['type'] in ('executable', 'loadable_module'):
+      return os.path.join('@', filename)
+    elif spec['type'] == 'shared_library':
+      return os.path.join('@lib', filename)
+    else:
+      return self.OutputPath(filename)
+
+  def WriteRule(self, name, command, description=None):
+    self.WriteLn('rule %s' % name)
