SConscript 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  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"],"aarch64":["cortex-a"],"risc-v": ["rv64"]}
  7. platform_file = {'armcc': 'rvds.S', 'gcc': 'gcc.S', 'iar': 'iar.S'}
  8. platform = rtconfig.PLATFORM
  9. arch = rtconfig.ARCH
  10. cpu = rtconfig.CPU
  11. # fix the cpu for risc-v
  12. if arch == 'risc-v':
  13. rv64 = ['virt64', 'c906']
  14. if cpu in rv64:
  15. cpu = 'rv64'
  16. if GetDepend('LWP_UNIX98_PTY'):
  17. print("LWP_UNIX98_PTY")
  18. src += Glob('unix98pty/*.c')
  19. CPPPATH += ['unix98pty/']
  20. if platform in platform_file.keys(): # support platforms
  21. if arch in support_arch.keys() and cpu in support_arch[arch]:
  22. asm_path = 'arch/' + arch + '/' + cpu + '/*_' + platform_file[platform]
  23. arch_common = 'arch/' + arch + '/' + 'common/*.c'
  24. src += Glob('*.c') + Glob(asm_path) + Glob(arch_common)
  25. src += Glob('arch/' + arch + '/' + cpu + '/*.c')
  26. CPPPATH = [cwd]
  27. CPPPATH += ['arch/' + arch + '/' + cpu]
  28. group = DefineGroup('lwP', src, depend = ['RT_USING_LWP'], CPPPATH = CPPPATH)
  29. Return('group')