You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.8KB

  1. # E07-S05: build the on-machine compiler driver and publish it as
  2. # build/n128c.prg - the exact file prepare-disk.ps1 injects as n128c and
  3. # launch-compiler.ps1 autostarts.
  4. [CmdletBinding()]
  5. param()
  6. $ErrorActionPreference = "Stop"
  7. $project = Split-Path $PSScriptRoot -Parent
  8. Import-Module (Join-Path $PSScriptRoot "lib\Nova128Test.psm1") -Force
  9. $out = Join-Path $project "build\driver"
  10. $link = Invoke-Nova128Link -Name "n128c" -BuildDir $out `
  11. -Config (Join-Path $project "cfg\compiler.cfg") -Sources @(
  12. (Join-Path $project "src\compiler\mmu.s"),
  13. (Join-Path $project "src\compiler\diskio.s"),
  14. (Join-Path $project "src\compiler\source.s"),
  15. (Join-Path $project "src\compiler\lexer.s"),
  16. (Join-Path $project "src\compiler\names.s"),
  17. (Join-Path $project "src\compiler\diagnostics.s"),
  18. (Join-Path $project "src\compiler\parser.s"),
  19. (Join-Path $project "src\compiler\codegen.s"),
  20. (Join-Path $project "src\compiler\flow.s"),
  21. (Join-Path $project "src\compiler\members.s"),
  22. (Join-Path $project "src\compiler\sizing.s"),
  23. (Join-Path $project "src\compiler\emit.s"),
  24. (Join-Path $project "src\compiler\interfaces.s"),
  25. (Join-Path $project "src\compiler\iftables.s"),
  26. (Join-Path $project "src\compiler\types.s"),
  27. (Join-Path $project "src\compiler\output.s"),
  28. (Join-Path $project "src\runtime\startup.s"),
  29. (Join-Path $project "src\compiler\main.s"))
  30. if ((Get-Nova128Label $link.Labels "driver_entry") -ne 0x1C0D) {
  31. throw "driver_entry is not at `$1C0D"
  32. }
  33. $published = Join-Path $project "build\n128c.prg"
  34. Copy-Item -LiteralPath $link.Program -Destination $published -Force
  35. Write-Host ("built {0} ({1} bytes) -> {2}" -f $link.Program,
  36. (Get-Item -LiteralPath $published).Length, $published)

Powered by TurnKey Linux.