SConscript 934 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # RT-Thread building script for component
  2. from building import *
  3. Import('rtconfig')
  4. cwd = GetCurrentDir()
  5. src = Glob('*.c') + Glob('*.cpp') + Glob('*.S')
  6. CPPPATH = [cwd, cwd + '/include']
  7. if GetDepend('RT_USING_SMP'):
  8. core_model = 'mp'
  9. else:
  10. core_model = 'up'
  11. src += Glob(core_model + '/*.S')
  12. if GetDepend('RT_USING_OFW') == False:
  13. SrcRemove(src, ['setup.c', 'cpu_psci.c', 'psci.c'])
  14. if GetDepend('RT_USING_PIC') == True:
  15. SrcRemove(src, ['gicv3.c', 'gic.c', 'gtimer.c', 'interrupt.c'])
  16. if GetDepend('RT_HWTIMER_ARM_ARCH') == True:
  17. SrcRemove(src, ['gtimer.c'])
  18. group = DefineGroup('libcpu', src, depend = [''], CPPPATH = CPPPATH)
  19. # build for sub-directory
  20. list = os.listdir(cwd)
  21. objs = []
  22. for d in list:
  23. path = os.path.join(cwd, d)
  24. if os.path.isfile(os.path.join(path, 'SConscript')):
  25. objs = objs + SConscript(os.path.join(d, 'SConscript'))
  26. group = group + objs
  27. Return('group')