| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- from building import *
- from gcc import GetGCCLikePLATFORM
- import os
- src = Glob('*.c')
- cwd = GetCurrentDir()
- inc = [os.path.join(cwd, '..', 'include')]
- if GetDepend('RT_USING_SMALL_MEM') == False:
- SrcRemove(src, ['mem.c'])
- if GetDepend('RT_USING_SLAB') == False:
- SrcRemove(src, ['slab.c'])
- if GetDepend('RT_USING_MEMPOOL') == False:
- SrcRemove(src, ['mempool.c'])
- if GetDepend('RT_USING_MEMHEAP') == False:
- SrcRemove(src, ['memheap.c'])
- if GetDepend('RT_USING_SIGNALS') == False:
- SrcRemove(src, ['signal.c'])
- if GetDepend('RT_USING_DEVICE') == False:
- SrcRemove(src, ['device.c'])
- if GetDepend('RT_USING_SMP') == False:
- SrcRemove(src, ['cpu.c', 'scheduler_mp.c'])
- else:
- SrcRemove(src, ['scheduler_up.c'])
- LOCAL_CFLAGS = ''
- if rtconfig.PLATFORM in GetGCCLikePLATFORM():
- LOCAL_CFLAGS += ' -Wunused' # unused warning
- LOCAL_CFLAGS += ' -Wformat -Wformat-security' # printf/scanf format warning
- LOCAL_CFLAGS += ' -Warray-bounds -Wuninitialized' # memory access warning
- LOCAL_CFLAGS += ' -Wreturn-type -Wcomment -Wswitch' # code style warning
- LOCAL_CFLAGS += ' -Wparentheses -Wlogical-op ' # operation warning
- LOCAL_CFLAGS += ' -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes' # function declaration warning
- if 'mips' not in rtconfig.PREFIX: # mips toolchain does not support
- LOCAL_CFLAGS += ' -Wimplicit-fallthrough' # implicit fallthrough warning
- LOCAL_CFLAGS += ' -Wduplicated-cond -Wduplicated-branches' # duplicated condition warning
- group = DefineGroup('Kernel', src, depend=[''], CPPPATH=inc, CPPDEFINES=['__RTTHREAD__'], LOCAL_CFLAGS=LOCAL_CFLAGS, LOCAL_CPPDEFINES=['__RT_KERNEL_SOURCE__'])
- Return('group')
|