SConscript 802 B

12345678910111213141516171819202122232425262728
  1. from building import *
  2. import os
  3. Import('rtconfig')
  4. cwd = GetCurrentDir()
  5. src = Glob('src/*.c')
  6. objs = []
  7. list = os.listdir(cwd)
  8. CPPPATH = [cwd + '/include']
  9. CPPPATH += [cwd + '/src/internal']
  10. CPPDEFINES = ['RT_USING_MLIBC', 'RT_USING_LIBC']
  11. LIBS = ['gcc']
  12. CCFLAGS = ""
  13. LINKFLAGS = " -nostartfiles -nostdlib -nostdinc -lgcc "
  14. if GetDepend('PKG_USING_MLIBC'):
  15. AddDepend(['RT_USING_MLIBC', 'RT_USING_LIBC'])
  16. group = DefineGroup('Compiler', src, depend = ['PKG_USING_MLIBC'], CPPPATH = CPPPATH, LINKFLAGS = LINKFLAGS, CPPDEFINES = CPPDEFINES, LIBS = LIBS, CCFLAGS=CCFLAGS)
  17. objs += group
  18. for d in list:
  19. path = os.path.join(cwd, d)
  20. if os.path.isfile(os.path.join(path, 'SConscript')):
  21. objs = objs + SConscript(os.path.join(d, 'SConscript'))
  22. Return('objs')