SConscript 793 B

123456789101112131415161718192021222324252627282930313233
  1. from building import *
  2. Import('rtconfig')
  3. src = []
  4. cwd = GetCurrentDir()
  5. group = []
  6. CPPPATH = [cwd]
  7. if GetDepend('RT_USING_LIBC'):
  8. src += Glob('*.c')
  9. else:
  10. if GetDepend('RT_LIBC_USING_TIME'):
  11. src += ['time.c']
  12. if GetDepend('RT_USING_POSIX') == False:
  13. SrcRemove(src, ['unistd.c'])
  14. if rtconfig.CROSS_TOOL == 'keil':
  15. CPPDEFINES = ['__CLK_TCK=RT_TICK_PER_SECOND']
  16. else:
  17. CPPDEFINES = []
  18. if GetDepend('RT_USING_LIBC') or GetDepend('RT_LIBC_USING_TIME'):
  19. group = DefineGroup('libc', src, depend = [''], CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES)
  20. list = os.listdir(cwd)
  21. for d in list:
  22. path = os.path.join(cwd, d)
  23. if os.path.isfile(os.path.join(path, 'SConscript')):
  24. group = group + SConscript(os.path.join(d, 'SConscript'))
  25. Return('group')