SConscript 840 B

123456789101112131415161718192021222324252627282930
  1. import os
  2. from building import *
  3. from gcc import *
  4. Import('rtconfig')
  5. src = []
  6. cwd = GetCurrentDir()
  7. group = []
  8. LIBS = []
  9. CPPPATH = [cwd]
  10. if rtconfig.PLATFORM in ['gcc']:
  11. LIBS += ['c', 'm'] # link libc and libm
  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_NEWLIBC', 'RT_USING_LIBC', '_POSIX_C_SOURCE=1']
  17. AddDepend(['RT_USING_NEWLIBC', 'RT_USING_LIBC'])
  18. group = DefineGroup('Compiler', src, depend = [''], CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES, LIBS = LIBS)
  19. list = os.listdir(cwd)
  20. for d in list:
  21. path = os.path.join(cwd, d)
  22. if os.path.isfile(os.path.join(path, 'SConscript')):
  23. group = group + SConscript(os.path.join(d, 'SConscript'))
  24. Return('group')