SConscript 1006 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. # RT-Thread building script for component
  2. from building import *
  3. cwd = GetCurrentDir()
  4. src = []
  5. path = [cwd]
  6. path += [cwd + '/config']
  7. if GetDepend('RT_USING_PIN'):
  8. src += ['drv_gpio.c']
  9. if GetDepend('RT_USING_SERIAL'):
  10. src += ['drv_usart.c']
  11. if GetDepend('RT_USING_SDIO'):
  12. src += ['drv_sdio.c']
  13. if GetDepend('RT_USING_I2C'):
  14. src += ['drv_soft_i2c.c']
  15. if GetDepend('RT_USING_WDT'):
  16. src += ['drv_wdt.c']
  17. if GetDepend('RT_USING_HWTIMER'):
  18. src += ['drv_hwtimer.c']
  19. if GetDepend('RT_USING_PWM'):
  20. src += ['drv_pwm.c']
  21. if GetDepend('RT_USING_RTC'):
  22. src += ['drv_rtc.c']
  23. if GetDepend('RT_USING_ADC'):
  24. src += ['drv_adc.c']
  25. if GetDepend('BSP_USING_IRRX'):
  26. src += ['drv_irrx.c']
  27. group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path)
  28. objs = [group]
  29. list = os.listdir(cwd)
  30. for item in list:
  31. if os.path.isfile(os.path.join(cwd, item, 'SConscript')):
  32. objs = objs + SConscript(os.path.join(item, 'SConscript'))
  33. Return('objs')