passkey_fw/tools/get_family_deps.py

22 lines
649 B
Python
Raw Normal View History

import sys
import subprocess
import os
2023-03-10 16:49:49 +01:00
# TOP is tinyusb root dir
TOP = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
def get_family_dep(family):
2023-03-10 16:49:49 +01:00
for entry in os.scandir("{}/hw/bsp/{}/boards".format(TOP, family)):
if entry.is_dir():
2023-03-10 16:49:49 +01:00
result = subprocess.run("make -C {}/examples/device/board_test BOARD={} get-deps".format(TOP, entry.name),
shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
print(result.stdout.decode("utf-8"))
return result.returncode
status = 0
for d in sys.argv[1:]:
status += get_family_dep(d)
sys.exit(status)