Add support for Ninja

Add support for Ninja buider under both Linux and Windows.

Updating generate_binaries.py to produce dependencies file. Removing
files by wild card does not work with Ninja under Windows.

Change-Id: I486463603de7413e09edcd959c329253867f4564
diff --git a/scripts/generate_binaries.py b/scripts/generate_binaries.py
index 8eccc14..705bff8 100755
--- a/scripts/generate_binaries.py
+++ b/scripts/generate_binaries.py
@@ -26,7 +26,8 @@
 import elftools.elf.elffile as elffile
 
 def generate_binaries(args):
-    load_segments = [];
+    outfiles = []
+
     with open(args.input, 'rb') as f:
         elf = elffile.ELFFile(f)
         for segment in elf.iter_segments():
@@ -38,9 +39,16 @@
                 with open(out, 'wb') as of:
                     of.write(segment.data())
 
+                outfiles.append(out)
+
+    if args.d:
+        with open(args.d, 'w') as f:
+            f.writelines(outfiles)
+
 if __name__ == '__main__':
     parser = argparse.ArgumentParser(description='Generate binaries from ELF file')
     parser.add_argument('-o', '--output', default='.', required=False, help='Output directory for binaries')
+    parser.add_argument('-d', help='Dependency file')
     parser.add_argument('input', metavar='inputfile', type=str, help='ELF file to extract binaries from')
 
     args = parser.parse_args()