build.plat: fold emit_prelude() into emit_commands().
Commit a783e464
broke all toolchains using bash.
This commit is contained in:
parent
a783e4645d
commit
b8b8e0ba0b
|
@ -247,14 +247,12 @@ class TemplatedPlatform(Platform):
|
||||||
# {{autogenerated}}
|
# {{autogenerated}}
|
||||||
set -e{{verbose("x")}}
|
set -e{{verbose("x")}}
|
||||||
[ -n "${{platform._toolchain_env_var}}" ] && . "${{platform._toolchain_env_var}}"
|
[ -n "${{platform._toolchain_env_var}}" ] && . "${{platform._toolchain_env_var}}"
|
||||||
{{emit_prelude("sh")}}
|
|
||||||
{{emit_commands("sh")}}
|
{{emit_commands("sh")}}
|
||||||
""",
|
""",
|
||||||
"build_{{name}}.bat": """
|
"build_{{name}}.bat": """
|
||||||
@rem {{autogenerated}}
|
@rem {{autogenerated}}
|
||||||
{{quiet("@echo off")}}
|
{{quiet("@echo off")}}
|
||||||
if defined {{platform._toolchain_env_var}} call %{{platform._toolchain_env_var}}%
|
if defined {{platform._toolchain_env_var}} call %{{platform._toolchain_env_var}}%
|
||||||
{{emit_prelude("bat")}}
|
|
||||||
{{emit_commands("bat")}}
|
{{emit_commands("bat")}}
|
||||||
""",
|
""",
|
||||||
}
|
}
|
||||||
|
@ -288,8 +286,9 @@ class TemplatedPlatform(Platform):
|
||||||
return verilog._convert_rtlil_text(rtlil_text,
|
return verilog._convert_rtlil_text(rtlil_text,
|
||||||
strip_internal_attrs=False, write_verilog_opts=opts)
|
strip_internal_attrs=False, write_verilog_opts=opts)
|
||||||
|
|
||||||
def emit_prelude(syntax):
|
def emit_commands(syntax):
|
||||||
commands = []
|
commands = []
|
||||||
|
|
||||||
for name in self.required_tools:
|
for name in self.required_tools:
|
||||||
env_var = tool_env_var(name)
|
env_var = tool_env_var(name)
|
||||||
if syntax == "sh":
|
if syntax == "sh":
|
||||||
|
@ -301,10 +300,7 @@ class TemplatedPlatform(Platform):
|
||||||
else:
|
else:
|
||||||
assert False
|
assert False
|
||||||
commands.append(template.format(env_var=env_var, name=name))
|
commands.append(template.format(env_var=env_var, name=name))
|
||||||
return "\n".join(commands)
|
|
||||||
|
|
||||||
def emit_commands(syntax):
|
|
||||||
commands = []
|
|
||||||
for index, command_tpl in enumerate(self.command_templates):
|
for index, command_tpl in enumerate(self.command_templates):
|
||||||
command = render(command_tpl, origin="<command#{}>".format(index + 1),
|
command = render(command_tpl, origin="<command#{}>".format(index + 1),
|
||||||
syntax=syntax)
|
syntax=syntax)
|
||||||
|
@ -315,6 +311,7 @@ class TemplatedPlatform(Platform):
|
||||||
commands.append(command + " || exit /b")
|
commands.append(command + " || exit /b")
|
||||||
else:
|
else:
|
||||||
assert False
|
assert False
|
||||||
|
|
||||||
return "\n".join(commands)
|
return "\n".join(commands)
|
||||||
|
|
||||||
def get_override(var):
|
def get_override(var):
|
||||||
|
@ -379,7 +376,6 @@ class TemplatedPlatform(Platform):
|
||||||
"emit_rtlil": emit_rtlil,
|
"emit_rtlil": emit_rtlil,
|
||||||
"emit_verilog": emit_verilog,
|
"emit_verilog": emit_verilog,
|
||||||
"emit_debug_verilog": emit_debug_verilog,
|
"emit_debug_verilog": emit_debug_verilog,
|
||||||
"emit_prelude": emit_prelude,
|
|
||||||
"emit_commands": emit_commands,
|
"emit_commands": emit_commands,
|
||||||
"syntax": syntax,
|
"syntax": syntax,
|
||||||
"invoke_tool": invoke_tool,
|
"invoke_tool": invoke_tool,
|
||||||
|
|
Loading…
Reference in a new issue