from building import * cwd = GetCurrentDir() list = os.listdir(cwd) src = [] src += ['drv_timer.c'] if GetDepend('BSP_USING_UART'): src += ['drv_uart_v2.c'] if GetDepend('BSP_USING_PINMUX'): src += ['drv_pinmux.c'] if GetDepend('BSP_USING_GPIO'): src += ['drv_gpio.c'] if GetDepend('BSP_USING_CAN'): src += ['drv_can.c'] objs = DefineGroup('drivers', src, depend=[''], CPPPATH=[cwd]) for d in list: path = os.path.join(cwd, d) if os.path.isfile(os.path.join(path, 'SConscript')): objs = objs + SConscript(os.path.join(d, 'SConscript')) Return('objs')