-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.ps1
23 lines (18 loc) · 867 Bytes
/
build.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
$curPath = Get-Location
$env:path += ";$curPath\cc65\"
$programsOutPath = "out"
Remove-Item "${programsOutPath}/*" -Recurse -Force -Confirm:$false | Out-Null
function Compile($type) {
"# Compiling $type programs"
$programs = Get-ChildItem "$type/*.s" | Select-Object -ExpandProperty Name
New-Item -Type Directory "${programsOutPath}/$type" | Out-Null
foreach ($program in $programs)
{
$p = [System.IO.Path]::GetFileNameWithoutExtension($program)
"Compiling $p"
Invoke-Expression "ca65 -g $type/$p.s -o ${programsOutPath}/$type/$p.o -l ${programsOutPath}/$type/$p.lst --list-bytes 0"
Invoke-Expression "ld65 -o ${programsOutPath}/$type/$p.bin -Ln ${programsOutPath}/$type/$p.labels -m ${programsOutPath}/$type/$p.map -C $type/system.cfg ${programsOutPath}/$type/$p.o"
}
}
Compile "SBC1"
"*** DONE ***"