Merge pull request #1324 from jevinskie/jev/bug/quartus-build-script-win32-fix

Quartus: Remove bashism from win32 bat script and add shebang on Linux
This commit is contained in:
enjoy-digital 2022-06-06 21:56:57 +02:00 committed by GitHub
commit d1d0f70b2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -150,13 +150,14 @@ def _build_qsf(device, ips, sources, vincpaths, named_sc, named_pc, build_name,
def _build_script(build_name, create_rbf):
if sys.platform in ["win32", "cygwin"]:
script_contents = "REM Autogenerated by LiteX / git: " + tools.get_litex_git_revision()
script_file = "build_" + build_name + ".bat"
script_contents = "REM Autogenerated by LiteX / git: " + tools.get_litex_git_revision() + "\n"
else:
script_contents = "# Autogenerated by LiteX / git: " + tools.get_litex_git_revision()
script_file = "build_" + build_name + ".sh"
script_contents = "#!/usr/bin/env bash\n"
script_contents += "# Autogenerated by LiteX / git: " + tools.get_litex_git_revision() + "\n"
script_contents += "set -e -u -x -o pipefail\n"
script_contents += """
set -e -u -x -o pipefail
quartus_map --read_settings_files=on --write_settings_files=off {build_name} -c {build_name}
quartus_fit --read_settings_files=off --write_settings_files=off {build_name} -c {build_name}
quartus_asm --read_settings_files=off --write_settings_files=off {build_name} -c {build_name}