SConscript 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. import rtconfig
  2. from building import *
  3. # get current directory
  4. cwd = GetCurrentDir()
  5. # The set of source files associated with this SConscript file.
  6. src = Split('''
  7. CMSIS/GD/GD32F4xx/Source/system_gd32f4xx.c
  8. GD32F4xx_standard_peripheral/Source/gd32f4xx_gpio.c
  9. GD32F4xx_standard_peripheral/Source/gd32f4xx_rcu.c
  10. GD32F4xx_standard_peripheral/Source/gd32f4xx_exti.c
  11. GD32F4xx_standard_peripheral/Source/gd32f4xx_misc.c
  12. GD32F4xx_standard_peripheral/Source/gd32f4xx_syscfg.c
  13. ''')
  14. if GetDepend(['RT_USING_SERIAL']):
  15. src += ['GD32F4xx_standard_peripheral/Source/gd32f4xx_usart.c']
  16. if GetDepend(['RT_USING_I2C']):
  17. src += ['GD32F4xx_standard_peripheral/Source/gd32f4xx_i2c.c']
  18. if GetDepend(['RT_USING_SPI']):
  19. src += ['GD32F4xx_standard_peripheral/Source/gd32f4xx_spi.c']
  20. if GetDepend(['RT_USING_CAN']):
  21. src += ['GD32F4xx_standard_peripheral/Source/gd32f4xx_can.c']
  22. if GetDepend(['BSP_USING_ETH']):
  23. src += ['GD32F4xx_standard_peripheral/Source/gd32f4xx_enet.c']
  24. if GetDepend(['RT_USING_ADC']):
  25. src += ['GD32F4xx_standard_peripheral/Source/gd32f4xx_adc.c']
  26. if GetDepend(['RT_USING_DAC']):
  27. src += ['GD32F4xx_standard_peripheral/Source/gd32f4xx_dac.c']
  28. if GetDepend(['RT_USING_RTC']):
  29. src += ['GD32F4xx_standard_peripheral/Source/gd32f4xx_rtc.c']
  30. src += ['GD32F4xx_standard_peripheral/Source/gd32f4xx_pmu.c']
  31. if GetDepend(['RT_USING_WDT']):
  32. src += ['GD32F4xx_standard_peripheral/Source/gd32f4xx_wwdgt.c']
  33. src += ['GD32F4xx_standard_peripheral/Source/gd32f4xx_fwdgt.c']
  34. if GetDepend(['RT_USING_SDIO']):
  35. src += ['GD32F4xx_standard_peripheral/Source/gd32f4xx_sdio.c']
  36. src += ['GD32F4xx_standard_peripheral/Source/gd32f4xx_dma.c']
  37. if GetDepend(['BSP_USING_SDRAM']):
  38. src += ['GD32F4xx_standard_peripheral/Source/gd32f4xx_fmc.c']
  39. src += ['GD32F4xx_standard_peripheral/Source/gd32f4xx_exmc.c']
  40. path = [
  41. cwd + '/CMSIS/GD/GD32F4xx/Include',
  42. cwd + '/CMSIS',
  43. cwd + '/GD32F4xx_standard_peripheral/Include',]
  44. CPPDEFINES = ['USE_STDPERIPH_DRIVER']
  45. group = DefineGroup('Libraries', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
  46. Return('group')