Commit 0b6ba299 authored by Tristan Gingold's avatar Tristan Gingold

hdlmake: add command --list-deps

parent b27ba540
......@@ -234,3 +234,17 @@ class Commands(Action):
self._print_file_list(mod_aux.files)
self._print_comment("# MODULE END -> %s" % mod_aux.url)
self._print_comment("")
def list_deps(self):
self.build_file_set()
self.solve_file_set()
from ..sourcefiles.srcfile import DepFile
from ..sourcefiles.dep_file import DepRelation
fset = self.parseable_fileset.filter(DepFile)
for f in sorted(fset, key=(lambda x: x.path)):
print('{}:'.format(f.path))
for dep in sorted([str(x) for x in f.provides]):
print(' provide {}'.format(dep))
for dep in sorted([str(x) for x in f.requires]):
print(' require {}'.format(dep))
......@@ -94,6 +94,8 @@ def _action_runner(action):
action.list_files()
elif options.command == "list-json":
action.list_json()
elif options.command == "list-deps":
action.list_deps()
elif options.command == "tree":
action.generate_tree()
else:
......@@ -163,6 +165,10 @@ def _get_parser():
"--top", dest="top", default=None,
help="print only those files required to build 'top'")
subparsers.add_parser(
"list-deps",
help="print all dependencies")
tree = subparsers.add_parser(
"tree",
help="generate a module hierarchy tree graph")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment