SConscript 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. if GetDepend(['RT_USING_SERIAL_X']):
  12. src += ['drv_usartX.c']
  13. else:
  14. src += ['drv_usart.c']
  15. if GetDepend('RT_USING_SDIO'):
  16. src += ['drv_sdio.c']
  17. if GetDepend('RT_USING_I2C'):
  18. src += ['drv_soft_i2c.c']
  19. if GetDepend('RT_USING_WDT'):
  20. src += ['drv_wdt.c']
  21. if GetDepend('RT_USING_HWTIMER'):
  22. src += ['drv_hwtimer.c']
  23. if GetDepend('RT_USING_PWM'):
  24. src += ['drv_pwm.c']
  25. if GetDepend('RT_USING_RTC'):
  26. src += ['drv_rtc.c']
  27. if GetDepend('RT_USING_ADC'):
  28. src += ['drv_adc.c']
  29. if GetDepend('BSP_USING_IRRX'):
  30. src += ['drv_irrx.c']
  31. if GetDepend('BSP_USING_ON_CHIP_FLASH'):
  32. src += ['drv_flash.c']
  33. group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path)
  34. objs = [group]
  35. list = os.listdir(cwd)
  36. for item in list:
  37. if os.path.isfile(os.path.join(cwd, item, 'SConscript')):
  38. objs = objs + SConscript(os.path.join(item, 'SConscript'))
  39. Return('objs')