blob: 99c1e8520b2742a38272a1ed6812958119b5a7e7 [file] [log] [blame]
#!/usr/bin/env python3.8
# Copyright 2021 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
import os
import subprocess
import sys
import pipes
def main():
parser = argparse.ArgumentParser("Generate media driver dep file")
parser.add_argument("--input-dir", action='append')
args = parser.parse_args()
find_args = ["find"]
find_args += args.input_dir
find_args += ["-path", "*/.git", "-prune", "-o", "-type", "f", "-print"]
files = subprocess.check_output(find_args)
file_lines = files.splitlines()
va_install_dir = "build-intel-media-driver/install"
output_files = [
"strip/", "strip/", "strip/",
debug_output_files = [x + ".debug " for x in output_files]
with open(args.depsfile, "wb") as depsfile:
for output_file in output_files + debug_output_files:
depsfile.write((os.path.join(va_install_dir, output_file) + ": ").encode("utf-8"))
depsfile.write(b" ".join(x.replace(b' ', b'\\ ') for x in file_lines))
return 0
if __name__ == "__main__":