2020-11-27 14:30:25 +08:00
|
|
|
# RT-Thread building script for component
|
2020-05-25 17:30:05 +08:00
|
|
|
from building import *
|
|
|
|
|
|
|
|
cwd = GetCurrentDir()
|
2020-11-29 17:31:51 +08:00
|
|
|
src = Glob('*.c') + Glob('*.cpp') + Glob('*.a')
|
2020-05-25 17:30:05 +08:00
|
|
|
CPPPATH = [cwd, str(Dir('#'))]
|
|
|
|
|
2020-11-27 14:30:25 +08:00
|
|
|
if not GetDepend('BSP_USING_ETH'):
|
|
|
|
SrcRemove(src, ['drv_eth.c'])
|
|
|
|
if not GetDepend('BSP_USING_SPI'):
|
|
|
|
SrcRemove(src, ['drv_spi.c'])
|
|
|
|
if not GetDepend('BSP_USING_WDT'):
|
|
|
|
SrcRemove(src, ['drv_wdt.c'])
|
|
|
|
|
2020-07-04 22:32:02 +08:00
|
|
|
group = DefineGroup('driver', src, depend = [''], CPPPATH = CPPPATH)
|
|
|
|
|
|
|
|
# build for sub-directory
|
|
|
|
list = os.listdir(cwd)
|
|
|
|
objs = []
|
|
|
|
|
|
|
|
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'))
|
|
|
|
group = group + objs
|
2020-05-25 17:30:05 +08:00
|
|
|
|
|
|
|
Return('group')
|