1# for module compiling
2import os
3Import('RTT_ROOT')
4Import('rtconfig')
5from building import *
6
7cwd = GetCurrentDir()
8src = []
9CPPPATH = []
10list = os.listdir(cwd)
11
12if rtconfig.PLATFORM in ['iccarm']:
13    print("\nThe current project does not support IAR build\n")
14    Return('group')
15elif rtconfig.PLATFORM in ['gcc', 'armclang']:
16    if GetOption('target') != 'mdk5':
17        CPPPATH = [cwd]
18        src = Glob('./src/*.c')
19
20group = 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