cpu2flags.py 401 B

12345678910111213141516171819
  1. from cpu import getCPU
  2. import sys
  3. def getCPUFlags(cpuName):
  4. cpu = getCPU(cpuName)
  5. return ' '.join(cpu.gccFlags)
  6. if __name__ == '__main__':
  7. if len(sys.argv) == 2:
  8. cpuName = sys.argv[1]
  9. try:
  10. print(getCPUFlags(cpuName))
  11. except KeyError:
  12. print('Unknown CPU "%s"' % cpuName, file=sys.stderr)
  13. else:
  14. print('Usage: python3 cpu2flags.py OPENMSX_TARGET_CPU', file=sys.stderr)
  15. sys.exit(2)