SConscript 1.1 KB

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