diff --git a/amaranth/build/plat.py b/amaranth/build/plat.py index d132178..7b22735 100644 --- a/amaranth/build/plat.py +++ b/amaranth/build/plat.py @@ -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 %} diff --git a/amaranth/vendor/_intel.py b/amaranth/vendor/_intel.py index 8f2ecc2..58f07eb 100644 --- a/amaranth/vendor/_intel.py +++ b/amaranth/vendor/_intel.py @@ -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 diff --git a/amaranth/vendor/_lattice_ecp5.py b/amaranth/vendor/_lattice_ecp5.py index 261ccbe..d75f629 100644 --- a/amaranth/vendor/_lattice_ecp5.py +++ b/amaranth/vendor/_lattice_ecp5.py @@ -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 diff --git a/amaranth/vendor/_lattice_ice40.py b/amaranth/vendor/_lattice_ice40.py index 34f2363..a4e1bc2 100644 --- a/amaranth/vendor/_lattice_ice40.py +++ b/amaranth/vendor/_lattice_ice40.py @@ -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 %} diff --git a/amaranth/vendor/_xilinx.py b/amaranth/vendor/_xilinx.py index e7c884b..0f033e2 100644 --- a/amaranth/vendor/_xilinx.py +++ b/amaranth/vendor/_xilinx.py @@ -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 diff --git a/docs/changes.rst b/docs/changes.rst index 34a251c..8dbb71a 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -35,6 +35,7 @@ Platform integration changes .. currentmodule:: amaranth.vendor +* Added: ``build.sh`` begins with ``#!/bin/sh``. * Removed: (deprecated in 0.4) :mod:`vendor.intel`, :mod:`vendor.lattice_ecp5`, :mod:`vendor.lattice_ice40`, :mod:`vendor.lattice_machxo2_3l`, :mod:`vendor.quicklogic`, :mod:`vendor.xilinx`. (`RFC 18`_)