1# for module compiling
2import os
3Import('RTT_ROOT')
4Import('rtconfig')
5from building import *
6from gcc import *
7
8cwd = GetCurrentDir()
9src = []
10CPPPATH = [cwd]
11group = []
12list = os.listdir(cwd)
13
14if rtconfig.PLATFORM in ['iccarm']:
15    group = DefineGroup('', src, depend = [''], CPPPATH = CPPPATH)
16elif rtconfig.PLATFORM in GetGCCLikePLATFORM():
17    if GetOption('target') != 'mdk5':
18        CPPPATH = [cwd]
19        src = Glob('./src/*.c')
20        group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH)
21
22for d in list:
23    path = os.path.join(cwd, d)
24    if os.path.isfile(os.path.join(path, 'SConscript')):
25        group = group + SConscript(os.path.join(d, 'SConscript'))
26
27Return('group')
28