From: Florent Kermarrec Date: Fri, 2 Aug 2019 08:27:38 +0000 (+0200) Subject: build/altera/quartus: use .bat on win32/cygwin X-Git-Tag: 24jan2021_ls180~1073 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a496760cb698d3c313853d0f2b27f230a146a20e;p=litex.git build/altera/quartus: use .bat on win32/cygwin --- diff --git a/litex/build/altera/quartus.py b/litex/build/altera/quartus.py index ba771b58..a8a7f64a 100644 --- a/litex/build/altera/quartus.py +++ b/litex/build/altera/quartus.py @@ -5,6 +5,7 @@ import os import subprocess +import sys import math from migen.fhdl.structure import _Fragment @@ -113,7 +114,14 @@ def _build_files(device, sources, vincpaths, named_sc, named_pc, build_name): def _run_quartus(build_name, quartus_path, create_rbf): - build_script_contents = "# Autogenerated by LiteX / git: " + tools.get_litex_git_revision() + "\n" + if sys.platform == "win32" or sys.platform == "cygwin": + build_script_contents = "REM Autogenerated by LiteX / git: " + tools.get_litex_git_revision() + "\n" + build_script_file = "build_" + build_name + ".bat" + command = build_script_file + else: + build_script_contents = "# Autogenerated by LiteX / git: " + tools.get_litex_git_revision() + "\nset -e\n" + build_script_file = "build_" + build_name + ".sh" + command = ["bash", build_script_file] build_script_contents += """ set -e @@ -131,12 +139,11 @@ fi """ build_script_contents = build_script_contents.format(build_name=build_name) # noqa - build_script_file = "build_" + build_name + ".sh" tools.write_to_file(build_script_file, build_script_contents, force_unix=True) - if subprocess.call(["bash", build_script_file]): + if subprocess.call(command): raise OSError("Subprocess failed")