Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

36 lines
1.2KB

  1. <#
  2. .SYNOPSIS
  3. Build every target (or one target) listed in project.json.
  4. .DESCRIPTION
  5. Reads resolved.targets from project.json. cc65 targets compile every .c and .s file in the
  6. target's source folders; BASIC targets tokenize the listing with petcat. Targets with a disk
  7. section also get a disk image built with c1541. Outputs go to build/ (ignored by Git).
  8. Exit codes: 0 = built, 1 = build error, 2 = a required tool is missing.
  9. .EXAMPLE
  10. pwsh -File tools/build.ps1
  11. pwsh -File tools/build.ps1 -Target c64
  12. pwsh -File tools/build.ps1 -Define FIXED_SEED=12345 # extra cl65 -D define(s) for this build
  13. #>
  14. [CmdletBinding()]
  15. param([string]$Target, [string[]]$Define)
  16. . (Join-Path $PSScriptRoot 'lib.ps1')
  17. try {
  18. $project = Get-ProjectConfig
  19. $done = @{}
  20. foreach ($t in Get-ProjectTargets $project $Target) {
  21. if ($Define) { $t.build.defines = @($t.build.defines) + $Define }
  22. Invoke-TargetBuild $project $t $done
  23. }
  24. Write-Host "Build complete."
  25. } catch [MissingToolException] {
  26. Write-Host $_.Exception.Message -ForegroundColor Yellow
  27. exit 2
  28. } catch {
  29. Write-Host "BUILD FAILED: $($_.Exception.Message)" -ForegroundColor Red
  30. exit 1
  31. }

Powered by TurnKey Linux.