2018-10-26 14:10:38 +08:00
|
|
|
from building import *
|
|
|
|
|
|
|
|
Import('rtconfig')
|
|
|
|
|
2019-08-22 15:34:50 +08:00
|
|
|
src = []
|
2018-10-26 14:10:38 +08:00
|
|
|
cwd = GetCurrentDir()
|
|
|
|
group = []
|
|
|
|
CPPPATH = [cwd]
|
|
|
|
|
2019-08-22 15:34:50 +08:00
|
|
|
if GetDepend('RT_USING_LIBC'):
|
2020-09-09 00:53:53 +08:00
|
|
|
src += Glob('*.c')
|
2019-08-22 15:34:50 +08:00
|
|
|
else:
|
2020-09-08 11:12:56 +08:00
|
|
|
if GetDepend('RT_LIBC_USING_TIME') and not GetDepend('RT_USING_MINILIBC'):
|
2019-08-22 15:34:50 +08:00
|
|
|
src += ['time.c']
|
|
|
|
|
2020-09-09 08:59:39 +08:00
|
|
|
if GetDepend('RT_USING_POSIX') == False:
|
|
|
|
SrcRemove(src, ['unistd.c'])
|
2020-09-08 10:52:02 +08:00
|
|
|
|
2021-02-15 07:17:16 +08:00
|
|
|
if rtconfig.CROSS_TOOL == 'keil':
|
|
|
|
CPPDEFINES = ['__CLK_TCK=RT_TICK_PER_SECOND']
|
|
|
|
else:
|
|
|
|
CPPDEFINES = []
|
|
|
|
|
2020-09-08 16:29:47 +08:00
|
|
|
if not GetDepend('RT_USING_MINILIBC') and (GetDepend('RT_USING_LIBC') or GetDepend('RT_LIBC_USING_TIME')):
|
2021-02-15 07:17:16 +08:00
|
|
|
group = DefineGroup('libc', src, depend = [''], CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES)
|
2018-10-26 14:10:38 +08:00
|
|
|
|
|
|
|
Return('group')
|