aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMelody Horn <melody@boringcactus.com>2021-03-25 19:42:01 -0600
committerMelody Horn <melody@boringcactus.com>2021-03-25 19:42:01 -0600
commitc62af0971d6d759f49e4cd39e931b3cc05a37cc4 (patch)
tree6ef4d8d88f8f0cc21e5fbf5da75cf563813113ba
parentd838bcdf6f912f35d16ec04e5ed5267daab9c7eb (diff)
downloadyapymake-c62af0971d6d759f49e4cd39e931b3cc05a37cc4.tar.gz
yapymake-c62af0971d6d759f49e4cd39e931b3cc05a37cc4.zip
avoid duplicating prerequisites
-rw-r--r--yapymake/makefile/__init__.py4
1 files changed, 3 insertions, 1 deletions
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':