build.py 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #!/usr/bin/python3
  2. # -*- coding: utf-8 -*-
  3. from enum import Enum
  4. from matrix_runner import main, matrix_axis, matrix_action, matrix_command
  5. @matrix_axis("device", "d", "Device(s) to be considered.")
  6. class Device(Enum):
  7. CM0 = ('CM0', 'CM0_LE')
  8. CM3 = ('CM3', 'CM3_LE')
  9. CM4F = ('CM4F', 'CM4F_LE')
  10. V8MB = ('V8MB', 'ARMv8MBL_LE')
  11. V8MBN = ('V8MBN', 'ARMv8MBL_NS_LE')
  12. V8MM = ('V8MM', 'ARMv8MML_LE')
  13. V8MMF = ('V8MMF', 'ARMv8MML_SP_LE')
  14. V8MMFN = ('V8MMFN', 'ARMv8MML_SP_NS_LE')
  15. V8MMN = ('V8MMN', 'ARMv8MML_NS_LE')
  16. @matrix_axis("compiler", "c", "Compiler(s) to be considered.")
  17. class CompilerAxis(Enum):
  18. AC6 = ('AC6', 'ArmCompiler6', 'armclang')
  19. GCC = ('GCC',)
  20. @property
  21. def project(self):
  22. return {
  23. CompilerAxis.AC6: "ARM/MDK/RTX_CM.uvprojx",
  24. CompilerAxis.GCC: "GCC/MDK/RTX_CM.uvprojx"
  25. }[self]
  26. @matrix_action
  27. def build(config, results):
  28. """Build the selected configurations."""
  29. yield uvision(config)
  30. @matrix_command()
  31. def uvision(config):
  32. return ['uvision.com',
  33. '-r', config.compiler.project,
  34. '-t', config.device[1],
  35. '-j0']
  36. if __name__ == "__main__":
  37. main()