aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMelody Horn <melody@boringcactus.com>2021-03-25 22:17:59 -0600
committerMelody Horn <melody@boringcactus.com>2021-03-25 22:17:59 -0600
commitdfbeba22a437bb2134f696f0d266dbf734944012 (patch)
tree0e977827ac0acd0e1f8fc66227f130104d1cfc9a
parentb4d26560138b37cefe12105d137214a33a1672c8 (diff)
downloadyapymake-dfbeba22a437bb2134f696f0d266dbf734944012.tar.gz
yapymake-dfbeba22a437bb2134f696f0d266dbf734944012.zip
skip rule if there are no targets
-rw-r--r--yapymake/makefile/__init__.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/yapymake/makefile/__init__.py b/yapymake/makefile/__init__.py
index cb6fe85..609281e 100644
--- a/yapymake/makefile/__init__.py
+++ b/yapymake/makefile/__init__.py
@@ -161,6 +161,9 @@ class Makefile:
command_token_strings.append(tokenize(next_line.lstrip('\t').rstrip('\n')))
commands = [CommandLine(c) for c in command_token_strings]
+ # apparently we can have no targets? if so, don't do anything
+ if len(targets) == 0:
+ continue
# we don't know yet if it's a target rule or an inference rule
match = re.fullmatch(r'(?P<s2>(\.[^/.]+)?)(?P<s1>\.[^/.]+)', targets[0])
# we don't want to catch special targets, though