SConstruct 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import os
  2. import sys
  3. import rtconfig
  4. RTT_ROOT = os.path.normpath(os.getcwd() + '/../..')
  5. sys.path = sys.path + [os.path.join(RTT_ROOT, 'tools')]
  6. target = 'rtthread'
  7. projects = []
  8. env = Environment(tools = ['mingw'],
  9. AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
  10. CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS,
  11. AR = rtconfig.AR, ARFLAGS = '-rc',
  12. LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS)
  13. env.PrependENVPath('PATH', rtconfig.EXEC_PATH)
  14. Export('env')
  15. Export('RTT_ROOT')
  16. Export('rtconfig')
  17. Export('projects')
  18. # kernel building script
  19. objs = SConscript(RTT_ROOT + '/src/SConscript', variant_dir='build/src', duplicate=0)
  20. # arch building script
  21. objs = objs + SConscript(RTT_ROOT + '/libcpu/SConscript', variant_dir='build/libcpu', duplicate=0)
  22. # component script
  23. Repository(RTT_ROOT)
  24. objs = objs + SConscript('components/SConscript')
  25. # board build script
  26. objs = objs + SConscript('SConscript', variant_dir='build/bsp', duplicate=0)
  27. if rtconfig.RT_USING_RTGUI:
  28. objs = objs + SConscript(RTT_ROOT + '/examples/gui/SConscript', variant_dir='build/examples/gui', duplicate=0)
  29. TARGET = target + '.' + rtconfig.TARGET_EXT
  30. env.Program(TARGET, objs)
  31. env.AddPostAction(TARGET, rtconfig.POST_ACTION)