 +
 +  subninjas = set()
 +  target_outputs = {}
-+  target_links = {}
 +  for qualified_target in target_list:
 +    # qualified_target is like: third_party/icu/icu.gyp:icui18n#target
 +    #OverPrint(qualified_target)

+        config_name = spec['default_configuration']
+    config = spec['configurations'][config_name]
+
+    writer = NinjaWriter(target_outputs, target_links, base_path, output_file)
+    subninjas.add(ninja_path)
+
+    output, output_link_deps = writer.WriteSpec(spec, config)
+    if output:
+      target_outputs[qualified_target] = output
+
+      if qualified_target in all_targets:
+        all_outputs.add(output)
+
+    if output_link_deps:
+      target_links[qualified_target] = output_link_deps
+
+  for ninja in subninjas:
+    print >>master_ninja, 'subninja', ninja

+*.pyc
diff --git a/pylib/gyp/generator/ninja.py b/pylib/gyp/generator/ninja.py
new file mode 100644
index 0000000..41a0730
--- /dev/null
+++ b/pylib/gyp/generator/ninja.py
@@ -0,0 +1,534 @@
+#!/usr/bin/python
+
+# Copyright (c) 2010 Google Inc. All rights reserved.
