REDRIVER2/PSXToolchain/psx_build.ps1
Ilya Shurumov 7d9b9616c5 - PSX_BUILD.BAT converted to Powershell
- updated readme
2022-04-09 19:00:17 +06:00

34 lines
941 B
PowerShell

$REDRIVER_FOLDER=[string](Get-Location) + "\.."
$cdDataPath = "$($REDRIVER_FOLDER)\PSXToolchain\CDSrc\0_CD_DATA\"
Write-Host $cdDataPath
# Make a symlink
$link_exist = Get-Item -Path "$($REDRIVER_FOLDER)\PSXToolchain\GameSRC" -ErrorAction Ignore
if (-Not $link_exist) {
New-Item -ItemType Junction -Path "$($REDRIVER_FOLDER)\PSXToolchain\GameSRC" -Target "$($REDRIVER_FOLDER)\src_rebuild"
}
# Create a virtual drive
Invoke-Expression "SUBST X: $($REDRIVER_FOLDER)\PSXToolchain"
# Set tools path
$envPath = $env:PATH
$env:PATH="$($envPath);X:\mipsel-unknown-elf\bin";
Write-Host $env:PATH
$folder_exist = Get-Item -Path $cdDataPath -ErrorAction Ignore
if (-Not $folder_exist) {
New-Item -ItemType Directory -Path "$($REDRIVER_FOLDER)\PSX]Toolchain\CDSrc\0_CD_DATA"
}
Write-Host "Starting build process..."
Invoke-Expression "make"
# Cleanup
Invoke-Expression "SUBST X: /D"
Read-Host -Prompt "Build completed, press any key"