1import os 2from building import * 3 4cwd = GetCurrentDir() 5 6# add general drivers 7src = Split(''' 8board.c 9CubeMX_Config/Src/stm32h5xx_hal_msp.c 10''') 11 12 13path = [cwd] 14path += [cwd + '/CubeMX_Config/Inc'] 15 16 17group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path) 18 19# if os.path.isfile(os.path.join(cwd, "ports", 'SConscript')): 20# group = group + SConscript(os.path.join("ports", 'SConscript')) 21 22list = os.listdir(cwd) 23for item in list: 24 if os.path.isfile(os.path.join(cwd, item, 'SConscript')): 25 group = group + SConscript(os.path.join(item, 'SConscript')) 26 27Return('group') 28 29