SConscript 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. Import('rtconfig')
  2. from building import *
  3. cwd = GetCurrentDir()
  4. src = []
  5. CPPPATH = [cwd]
  6. support_arch = {"arm": ["cortex-m3", "cortex-m4", "cortex-m7", "arm926", "cortex-a"],
  7. "aarch64":["cortex-a"],
  8. "risc-v": ["rv64"],
  9. "x86": ["i386"]}
  10. platform_file = {'armcc': 'rvds.S', 'gcc': 'gcc.S', 'iar': 'iar.S'}
  11. platform = rtconfig.PLATFORM
  12. arch = rtconfig.ARCH
  13. cpu = rtconfig.CPU
  14. # fix the cpu for risc-v
  15. if arch == 'risc-v':
  16. rv64 = ['virt64', 'c906']
  17. if cpu in rv64:
  18. cpu = 'rv64'
  19. if GetDepend('LWP_UNIX98_PTY'):
  20. # print("LWP_UNIX98_PTY")
  21. src += Glob('unix98pty/*.c')
  22. CPPPATH += ['unix98pty/']
  23. if platform in platform_file.keys(): # support platforms
  24. if arch in support_arch.keys() and cpu in support_arch[arch]:
  25. asm_path = 'arch/' + arch + '/' + cpu + '/*_' + platform_file[platform]
  26. arch_common = 'arch/' + arch + '/' + 'common/*.c'
  27. src += Glob('*.c') + Glob(asm_path) + Glob(arch_common)
  28. src += Glob('arch/' + arch + '/' + cpu + '/*.c')
  29. CPPPATH = [cwd]
  30. CPPPATH += ['arch/' + arch + '/' + cpu]
  31. group = DefineGroup('lwP', src, depend = ['RT_USING_LWP'], CPPPATH = CPPPATH)
  32. Return('group')