SConstruct 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. import mdk
  7. target = 'rtthread-jz47xx'
  8. projects = []
  9. env = Environment(tools = ['mingw'],
  10. AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
  11. CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS,
  12. AR = rtconfig.AR, ARFLAGS = '-rc',
  13. LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS)
  14. env.PrependENVPath('PATH', rtconfig.EXEC_PATH)
  15. Export('env')
  16. Export('RTT_ROOT')
  17. Export('rtconfig')
  18. Export('projects')
  19. # kernel building script
  20. objs = SConscript(RTT_ROOT + '/src/SConscript', variant_dir='build/src', duplicate=0)
  21. # arch building script
  22. objs = objs + SConscript(RTT_ROOT + '/libcpu/SConscript', variant_dir='build/libcpu', duplicate=0)
  23. # component script
  24. Repository(RTT_ROOT)
  25. objs = objs + SConscript('components/SConscript')
  26. # board build script
  27. objs = objs + SConscript('SConscript', variant_dir='build/bsp', duplicate=0)
  28. TARGET = target + '.' + rtconfig.TARGET_EXT
  29. env.Program(TARGET, objs)
  30. env.AddPostAction(TARGET, rtconfig.POST_ACTION)