SConstruct 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. from building import *
  7. TARGET = 'rtthread-lpc176x.' + rtconfig.TARGET_EXT
  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('RTT_ROOT')
  15. Export('rtconfig')
  16. # prepare building environment
  17. objs = PrepareBuilding(env, RTT_ROOT)
  18. if GetDepend('RT_USING_WEBSERVER'):
  19. objs = objs + SConscript(RTT_ROOT + '/components/net/webserver/SConscript', variant_dir='build/net/webserver', duplicate=0)
  20. if GetDepend('RT_USING_RTGUI'):
  21. objs = objs + SConscript(RTT_ROOT + '/examples/gui/SConscript', variant_dir='build/examples/gui', duplicate=0)
  22. cwd = str(Dir('#'))
  23. list = os.listdir(cwd)
  24. for d in list:
  25. path = os.path.join(cwd, d)
  26. if os.path.isfile(os.path.join(path, 'SConscript')):
  27. objs = objs + SConscript(os.path.join(d, 'SConscript'))
  28. # libc testsuite
  29. # objs = objs + SConscript(RTT_ROOT + '/examples/libc/SConscript', variant_dir='build/examples/libc', duplicate=0)
  30. # build program
  31. env.Program(TARGET, objs)
  32. # end building
  33. EndBuilding(TARGET)