SConscript 912 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. from building import *
  2. group = []
  3. if not GetDepend(['RT_SERIAL_VIRTUAL']):
  4. Return('group')
  5. cwd = GetCurrentDir()
  6. CPPPATH = [cwd + '/../../include']
  7. CPPDEFINES = []
  8. src = []
  9. font_path = None
  10. if GetDepend(['RT_SERIAL_VIRTUAL_FONT_UNI2_FIXED16']):
  11. font_path = cwd + '/font-uni2-fixed16.psf'
  12. if GetDepend(['RT_SERIAL_VIRTUAL_FONT_UNI2_VGA16']):
  13. font_path = cwd + '/font-uni2-vga16.psf'
  14. if font_path != None:
  15. with open(font_path, 'rb') as psf:
  16. psf_data = psf.read()
  17. first_byte = True
  18. with open(cwd + '/psf.inc', 'w') as font:
  19. for byte in psf_data:
  20. if not first_byte:
  21. font.write(", ")
  22. font.write("0x{:02x}".format(byte))
  23. first_byte = False
  24. src += ['psf.c', 'render.c', 'virtual.c']
  25. group = DefineGroup('DeviceDrivers', src, depend = [''], CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES)
  26. Return('group')