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

+rule solink
+  description = SOLINK $out
+  command = g++ -shared $ldflags -o $out -Wl,-soname=$soname \\
+    -Wl,--whole-archive -Wl,--start-group $in -Wl,--end-group -Wl,--whole-archive $libs
+
+rule link
+  description = LINK $out

+      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:
+      print output, '=>', output_link_deps
+      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
