aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--yapymake/makefile/__init__.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/yapymake/makefile/__init__.py b/yapymake/makefile/__init__.py
index b5f96f1..483b071 100644
--- a/yapymake/makefile/__init__.py
+++ b/yapymake/makefile/__init__.py
@@ -279,7 +279,11 @@ class Makefile:
macro_tokens = TokenString.text(' '.join(macro_pieces))
else:
- _, macro_tokens = self._macros[this_token.name]
+ if this_token.name in self._macros:
+ _, macro_tokens = self._macros[this_token.name]
+ else:
+ self._warn(f'warning: undefined macro {this_token.name}')
+ macro_tokens = TokenString.text('')
macro_value = self.expand_macros(macro_tokens, current_target)
if this_token.replacement is not None:
replaced, replacement = (self.expand_macros(t, current_target) for t in this_token.replacement)