1from building import * 2Import('rtconfig') 3 4src = [] 5cwd = GetCurrentDir() 6group = [] 7CPPPATH = [cwd + '/include'] 8CPPDEFINES = [] 9 10if rtconfig.PLATFORM in ['armcc', 'armclang']: 11 CPPDEFINES += ['__CLK_TCK=RT_TICK_PER_SECOND'] 12elif rtconfig.PLATFORM in ['iccarm']: 13 CPPDEFINES += ['CLOCKS_PER_SEC=RT_TICK_PER_SECOND'] # forcly revert to 1 by IAR 14elif rtconfig.PLATFORM in ['gcc'] and rtconfig.CPU in ['posix']: 15 CPPDEFINES += ['_GNU_SOURCE'] # linux x86 platform gcc use! 16 17src += Glob('*.c') 18 19group = DefineGroup('Compiler', src, depend = [''], CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES) 20 21list = os.listdir(cwd) 22for item in list: 23 if os.path.isfile(os.path.join(cwd, item, 'SConscript')): 24 group = group + SConscript(os.path.join(item, 'SConscript')) 25 26Return('group') 27