SConscript 697 B

12345678910111213141516171819202122232425262728
  1. # RT-Thread building script for component
  2. from building import *
  3. cwd = GetCurrentDir()
  4. src = Glob('*.c') + Glob('*.S')
  5. CPPPATH = [cwd, str(Dir('#'))]
  6. if not GetDepend('RT_USING_I2C'):
  7. SrcRemove(src, ['drv_i2c.c'])
  8. if not GetDepend('RT_USING_SPI'):
  9. SrcRemove(src, ['drv_spi.c'])
  10. if not GetDepend('RT_USING_WDT'):
  11. SrcRemove(src, ['drv_reset.c'])
  12. group = DefineGroup('Drivers', src, depend = [''], CPPPATH = CPPPATH)
  13. # build for sub-directory
  14. list = os.listdir(cwd)
  15. objs = []
  16. for d in list:
  17. path = os.path.join(cwd, d)
  18. if os.path.isfile(os.path.join(path, 'SConscript')):
  19. objs = objs + SConscript(os.path.join(d, 'SConscript'))
  20. group = group + objs
  21. Return('group')