2011-06-02 04:42:57 +00:00
|
|
|
Import('RTT_ROOT')
|
2011-06-19 02:47:51 +00:00
|
|
|
Import('rtconfig')
|
2011-06-02 04:42:57 +00:00
|
|
|
from building import *
|
|
|
|
|
2012-09-20 03:17:26 +00:00
|
|
|
src = Glob('*.c')
|
2011-09-25 02:28:07 +00:00
|
|
|
|
2011-06-02 04:42:57 +00:00
|
|
|
CPPPATH = [RTT_ROOT + '/include']
|
2011-06-19 02:47:51 +00:00
|
|
|
if rtconfig.CROSS_TOOL == 'keil' and GetDepend('RT_USING_MODULE') == True:
|
|
|
|
LINKFLAGS = ' --keep __rtmsym_* '
|
|
|
|
else:
|
2012-09-20 03:17:26 +00:00
|
|
|
LINKFLAGS = ''
|
2011-09-25 02:28:07 +00:00
|
|
|
|
2011-12-27 05:41:04 +00:00
|
|
|
if GetDepend('RT_USING_MODULE') == False:
|
2012-09-20 03:17:26 +00:00
|
|
|
SrcRemove(src, ['module.c'])
|
2011-09-25 02:28:07 +00:00
|
|
|
|
2011-12-27 05:41:04 +00:00
|
|
|
if GetDepend('RT_USING_HEAP') == False or GetDepend('RT_USING_SMALL_MEM') == False:
|
|
|
|
SrcRemove(src, ['mem.c'])
|
|
|
|
|
|
|
|
if GetDepend('RT_USING_HEAP') == False or GetDepend('RT_USING_SLAB') == False:
|
|
|
|
SrcRemove(src, ['slab.c'])
|
2011-09-25 02:28:07 +00:00
|
|
|
|
2012-06-02 07:45:48 +00:00
|
|
|
if GetDepend('RT_USING_MEMPOOL') == False:
|
|
|
|
SrcRemove(src, ['mempool.c'])
|
|
|
|
|
|
|
|
if GetDepend('RT_USING_MEMHEAP') == False:
|
|
|
|
SrcRemove(src, ['memheap.c'])
|
2012-12-29 12:29:03 +00:00
|
|
|
if GetDepend('RT_USING_MEMHEAP_AS_HEAP'):
|
|
|
|
SrcRemove(src, ['mem.c'])
|
2012-06-02 07:45:48 +00:00
|
|
|
|
|
|
|
if GetDepend('RT_USING_DEVICE') == False:
|
|
|
|
SrcRemove(src, ['device.c'])
|
|
|
|
|
2012-09-20 03:17:26 +00:00
|
|
|
group = DefineGroup('Kernel', src, depend = [''], CPPPATH = CPPPATH, LINKFLAGS = LINKFLAGS)
|
2011-06-02 04:42:57 +00:00
|
|
|
|
|
|
|
Return('group')
|