+*.pyc
diff --git a/pylib/gyp/generator/ninja.py b/pylib/gyp/generator/ninja.py
new file mode 100644
-index 0000000..82992d9
+index 0000000..23f925b
--- /dev/null
+++ b/pylib/gyp/generator/ninja.py
-@@ -0,0 +1,542 @@
+@@ -0,0 +1,545 @@
+#!/usr/bin/python
+
+# Copyright (c) 2010 Google Inc. All rights reserved.
+}
+
+NINJA_BASE = """\
-+# Build directory.
++builddir = ninja
++# Short alias for builddir.
+b = ninja
+
+cc = %(cc)s
+ sources = spec.get('sources', []) + extra_sources
+ if sources:
+ link_deps = self.WriteSources(config, sources, sources_predepends)
++ # Some actions/rules output 'sources' that are already object files.
++ link_deps += [f for f in sources if f.endswith('.o')]
+
+ # The final output of our target depends on the last output of the
+ # above steps.
test.run_gyp('prog1.gyp', '--depth=..', chdir='src')
diff --git a/test/lib/TestGyp.py b/test/lib/TestGyp.py
-index fcdd12c..fb54760 100644
+index 23228d2..824b4a9 100644
--- a/test/lib/TestGyp.py
+++ b/test/lib/TestGyp.py
@@ -391,6 +391,47 @@ class TestGypMake(TestGypBase):
class TestGypMSVS(TestGypBase):
"""
Subclass for testing the GYP Visual Studio generator.
-@@ -670,6 +711,7 @@ format_class_list = [
+@@ -705,6 +746,7 @@ format_class_list = [
TestGypGypd,
TestGypMake,
TestGypMSVS,