SConscript 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. from building import *
  2. from gcc import GetGCCLikePLATFORM
  3. import os
  4. src = Glob('*.c')
  5. cwd = GetCurrentDir()
  6. inc = [os.path.join(cwd, '..', 'include')]
  7. LOCAL_CFLAGS = ''
  8. if GetDepend('RT_USING_SMALL_MEM') == False:
  9. SrcRemove(src, ['mem.c'])
  10. if GetDepend('RT_USING_SLAB') == False:
  11. SrcRemove(src, ['slab.c'])
  12. if GetDepend('RT_USING_MEMPOOL') == False:
  13. SrcRemove(src, ['mempool.c'])
  14. if GetDepend('RT_USING_MEMHEAP') == False:
  15. SrcRemove(src, ['memheap.c'])
  16. if GetDepend('RT_USING_SIGNALS') == False:
  17. SrcRemove(src, ['signal.c'])
  18. if GetDepend('RT_USING_DEVICE') == False:
  19. SrcRemove(src, ['device.c'])
  20. if GetDepend('RT_USING_SMP') == False:
  21. SrcRemove(src, ['cpu.c', 'scheduler_mp.c'])
  22. if GetDepend('RT_USING_SMP') == True:
  23. SrcRemove(src, ['scheduler_up.c'])
  24. if rtconfig.PLATFORM in GetGCCLikePLATFORM():
  25. LOCAL_CFLAGS += ' -Wstrict-prototypes -Wmissing-prototypes -Wunused-parameter -Wunused -Wreturn-type -Wformat -Wswitch'
  26. group = DefineGroup('Kernel', src, depend = [''], CPPPATH = inc, CPPDEFINES = ['__RTTHREAD__'], LOCAL_CFLAGS=LOCAL_CFLAGS)
  27. Return('group')