build.plat,vendor: start build.sh with #!/bin/sh.
The build scripts generated by Amaranth are designed to be invoked by directly running them with any shell (some of them will re-invoke themselves with `bash` specifically, when it's a toolchain requirement), and they're not currently marked executable, so there's no shebang. Add a shebang line to improve compatibility with cases where they are treated as executables in their own right.
This commit is contained in:
parent
0849e1af0b
commit
5d9ad62f36
6 changed files with 6 additions and 0 deletions
|
|
@ -276,6 +276,7 @@ class TemplatedPlatform(Platform):
|
|||
|
||||
build_script_templates = {
|
||||
"build_{{name}}.sh": """
|
||||
#!/bin/sh
|
||||
# {{autogenerated}}
|
||||
set -e{{verbose("x")}}
|
||||
{% for var in platform._all_toolchain_env_vars %}
|
||||
|
|
|
|||
|
|
@ -80,6 +80,7 @@ class IntelPlatform(TemplatedPlatform):
|
|||
quartus_file_templates = {
|
||||
**TemplatedPlatform.build_script_templates,
|
||||
"build_{{name}}.sh": r"""
|
||||
#!/bin/sh
|
||||
# {{autogenerated}}
|
||||
{% for var in platform._all_toolchain_env_vars %}
|
||||
if [ -n "${{var}}" ]; then
|
||||
|
|
|
|||
|
|
@ -182,6 +182,7 @@ class LatticeECP5Platform(TemplatedPlatform):
|
|||
_diamond_file_templates = {
|
||||
**TemplatedPlatform.build_script_templates,
|
||||
"build_{{name}}.sh": r"""
|
||||
#!/bin/sh
|
||||
# {{autogenerated}}
|
||||
set -e{{verbose("x")}}
|
||||
if [ -z "$BASH" ] ; then exec /bin/bash "$0" "$@"; fi
|
||||
|
|
|
|||
|
|
@ -175,6 +175,7 @@ class LatticeICE40Platform(TemplatedPlatform):
|
|||
_icecube2_file_templates = {
|
||||
**TemplatedPlatform.build_script_templates,
|
||||
"build_{{name}}.sh": r"""
|
||||
#!/bin/sh
|
||||
# {{autogenerated}}
|
||||
set -e{{verbose("x")}}
|
||||
{% for var in platform._all_toolchain_env_vars %}
|
||||
|
|
|
|||
|
|
@ -139,6 +139,7 @@ class XilinxPlatform(TemplatedPlatform):
|
|||
_vivado_file_templates = {
|
||||
**TemplatedPlatform.build_script_templates,
|
||||
"build_{{name}}.sh": r"""
|
||||
#!/bin/sh
|
||||
# {{autogenerated}}
|
||||
set -e{{verbose("x")}}
|
||||
if [ -z "$BASH" ] ; then exec /bin/bash "$0" "$@"; fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue