mini-rv32ima/windows/winrundoom.ps1

24 lines
661 B
PowerShell
Raw Permalink Normal View History

2022-12-05 14:27:50 -08:00
$archive = 'Image-emdoom-MAX_ORDER_14.zip';
2022-12-05 14:28:52 -08:00
$image = 'Image-emdoom-MAX_ORDER_14';
2022-12-05 14:27:50 -08:00
2022-12-05 14:28:52 -08:00
if( !(Test-Path -Path $image) )
2022-12-05 14:27:50 -08:00
{
Invoke-WebRequest -Uri https://github.com/cnlohr/mini-rv32ima-images/raw/master/images/$archive -UseBasicParsing -OutFile $archive;
2022-12-05 14:28:52 -08:00
Expand-Archive $archive -DestinationPath . -ErrorAction SilentlyContinue;
2022-12-05 14:27:50 -08:00
}
$compiler = "tcc";
if( !(Get-Command $compiler -ErrorAction Stop) )
{
Write-Host 'No TCC. Please get it with installer here: https://github.com/cnlohr/tinycc-win64-installer or by powershell here: https://github.com/cntools/Install-TCC';
}
& $compiler ..\mini-rv32ima\mini-rv32ima.c
if( $? )
{
2022-12-05 14:28:52 -08:00
.\mini-rv32ima.exe -f $image
2022-12-05 14:27:50 -08:00
}