From c62af0971d6d759f49e4cd39e931b3cc05a37cc4 Mon Sep 17 00:00:00 2001 From: Melody Horn Date: Thu, 25 Mar 2021 19:42:01 -0600 Subject: avoid duplicating prerequisites --- yapymake/makefile/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/yapymake/makefile/__init__.py b/yapymake/makefile/__init__.py index 6c7098d..006dfbe 100644 --- a/yapymake/makefile/__init__.py +++ b/yapymake/makefile/__init__.py @@ -159,7 +159,9 @@ class Makefile: # > If .SUFFIXES does not have any prerequisites, the list of known suffixes shall be cleared. if target in self._targets and len(commands) == 0 and \ not (target == '.SUFFIXES' and len(prerequisites) == 0): - self._targets[target].prerequisites += prerequisites + for new_prereq in prerequisites: + if new_prereq not in self._targets[target].prerequisites: + self._targets[target].prerequisites.append(new_prereq) else: self._targets[target] = Target(target, prerequisites, commands) elif line_type == 'macro': -- cgit v1.2.3