SConscript 770 B

12345678910111213141516171819202122232425262728293031
  1. import os
  2. from building import *
  3. from gcc import *
  4. Import('rtconfig')
  5. src = []
  6. cwd = GetCurrentDir()
  7. group = []
  8. LIBS = ['m'] # link libm
  9. CPPPATH = [cwd]
  10. if rtconfig.PLATFORM == 'gcc':
  11. LIBS += ['c'] # link libc
  12. src += Glob('*.c')
  13. #report newlib version
  14. print('Newlib version:' + GetNewLibVersion(rtconfig))
  15. # identify this is Newlib, and only enable POSIX.1-1990
  16. CPPDEFINES = ['RT_USING_NEWLIB', '_POSIX_C_SOURCE=1']
  17. group = DefineGroup('Compiler', src, depend = [''], CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES, LIBS = LIBS)
  18. list = os.listdir(cwd)
  19. for d in list:
  20. path = os.path.join(cwd, d)
  21. if os.path.isfile(os.path.join(path, 'SConscript')):
  22. group = group + SConscript(os.path.join(d, 'SConscript'))
  23. Return('group')