2021-04-21 00:56:36 +08:00
|
|
|
from building import *
|
2021-04-25 21:10:31 +08:00
|
|
|
Import('rtconfig')
|
|
|
|
|
|
|
|
src = []
|
|
|
|
cwd = GetCurrentDir()
|
|
|
|
group = []
|
2022-06-19 09:56:24 -04:00
|
|
|
CPPPATH = [cwd + '/include']
|
2021-10-20 21:44:01 -04:00
|
|
|
CPPDEFINES = []
|
2021-04-25 21:10:31 +08:00
|
|
|
|
2022-04-19 21:56:04 -04:00
|
|
|
if rtconfig.PLATFORM in ['armcc', 'armclang']:
|
2021-10-28 02:48:51 -04:00
|
|
|
CPPDEFINES += ['__CLK_TCK=RT_TICK_PER_SECOND']
|
2022-05-30 18:11:15 -04:00
|
|
|
elif rtconfig.PLATFORM in ['iccarm']:
|
2022-04-21 14:03:04 -04:00
|
|
|
CPPDEFINES += ['CLOCKS_PER_SEC=RT_TICK_PER_SECOND'] # forcly revert to 1 by IAR
|
2023-06-07 11:46:18 +08:00
|
|
|
elif rtconfig.PLATFORM in ['gcc'] and rtconfig.CPU in ['posix']:
|
|
|
|
CPPDEFINES += ['_GNU_SOURCE'] # linux x86 platform gcc use!
|
2021-10-28 02:48:51 -04:00
|
|
|
|
2021-12-26 09:41:24 -05:00
|
|
|
src += Glob('*.c')
|
2021-04-25 21:10:31 +08:00
|
|
|
|
2021-12-28 23:25:16 -05:00
|
|
|
group = DefineGroup('Compiler', src, depend = [''], CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES)
|
2021-05-15 21:27:31 +08:00
|
|
|
|
|
|
|
list = os.listdir(cwd)
|
2021-10-24 13:08:48 -04:00
|
|
|
for item in list:
|
|
|
|
if os.path.isfile(os.path.join(cwd, item, 'SConscript')):
|
|
|
|
group = group + SConscript(os.path.join(item, 'SConscript'))
|
2021-05-15 21:27:31 +08:00
|
|
|
|
2021-04-25 21:10:31 +08:00
|
|
|
Return('group')
|