Commit 17f86de3 authored by Tristan Gingold's avatar Tristan Gingold

makefilesim.py: minor rewrite.

parent b94cc58d
...@@ -103,13 +103,14 @@ TOP_MODULE := {top_module} ...@@ -103,13 +103,14 @@ TOP_MODULE := {top_module}
"""Print dummy targets to handle file dependencies""" """Print dummy targets to handle file dependencies"""
fileset = self.fileset.sort() fileset = self.fileset.sort()
for file_aux in fileset: for file_aux in fileset:
if any(isinstance(file_aux, file_type) # Consider only HDL files.
for file_type in self._hdl_files): if isinstance(file_aux, tuple(self._hdl_files)):
self.write("%s: %s" % (self.get_stamp_file(file_aux), file_aux.rel_path())) self.write("{}: {}".format(self.get_stamp_file(file_aux), file_aux.rel_path()))
# list dependencies, do not include the target file # list dependencies, do not include the target file
for dep_file in sorted([dfile for dfile in file_aux.depends_on for dep_file in sorted(file_aux.depends_on, key=(lambda x: x.file_path)):
if dfile is not file_aux], if dep_file is file_aux:
key=(lambda x: x.file_path)): # Do not depend on itself.
continue
if dep_file in fileset: if dep_file in fileset:
self.write(" \\\n" + self.get_stamp_file(dep_file)) self.write(" \\\n" + self.get_stamp_file(dep_file))
else: else:
......
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