1import os 2from building import * 3 4objs = [] 5cwd = GetCurrentDir() 6 7# add general drivers 8src = [] 9path = [cwd] 10if GetDepend(['BSP_USING_ETH']): 11 src += Glob('phy_reset.c') 12 13if GetDepend(['BSP_USING_SPI_FLASH']): 14 src += Glob('spi_flash_init.c') 15 16if GetDepend(['BSP_USING_SDCARD']): 17 src += Glob('sdcard_port.c') 18 19if GetDepend(['BSP_USING_EXT_FMC_IO']): 20 src += Glob('drv_ext_io.c') 21 22 23CPPDEFINES = ['STM32F429xx'] 24group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES) 25 26list = os.listdir(cwd) 27for item in list: 28 if os.path.isfile(os.path.join(cwd, item, 'SConscript')): 29 group = group + SConscript(os.path.join(item, 'SConscript')) 30 31Return('group') 32