diff --git a/share/machdeps/make_machdep/make_machdep.py b/share/machdeps/make_machdep/make_machdep.py
index 76bc99e30476776a12419108b6234d3182e7993b..e1e9db4c677e03e13d0bc31d72b158cd56056b84 100755
--- a/share/machdeps/make_machdep/make_machdep.py
+++ b/share/machdeps/make_machdep/make_machdep.py
@@ -400,7 +400,7 @@ if proc.returncode == 0:
         macro_var = macro.group(1)
         macro_val = macro.group(2)
         # Python >= 3.7: dict is guaranteed to preserve insertion order
-        dict[macro_var] = macro_val
+        custom[macro_var] = macro_val
     machdep["custom_defs"] = custom
 else:
     logging.warning(f"could not determine predefined macros. compiler output is:\n{proc.stderr}")