SConstruct 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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 = 'rtt2m16c.' + 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. CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES'],
  14. LINKCOM = ['$LINK $SOURCES $LINKFLAGS -f lnkm30627fhp.xcl -l rtt2m16c.map -o rtt2m16c.d34 -Omotorola-s28=$TARGET'])
  15. env.PrependENVPath('PATH', rtconfig.EXEC_PATH)
  16. Export('RTT_ROOT')
  17. Export('rtconfig')
  18. # prepare building environment
  19. objs = PrepareBuilding(env, RTT_ROOT)
  20. if GetDepend('RT_USING_WEBSERVER'):
  21. objs = objs + SConscript(RTT_ROOT + '/components/net/webserver/SConscript', variant_dir='build/net/webserver', duplicate=0)
  22. if GetDepend('RT_USING_RTGUI'):
  23. objs = objs + SConscript(RTT_ROOT + '/examples/gui/SConscript', variant_dir='build/examples/gui', duplicate=0)
  24. # libc testsuite
  25. # objs = objs + SConscript(RTT_ROOT + '/examples/libc/SConscript', variant_dir='build/examples/libc', duplicate=0)
  26. # build program
  27. env.Program(TARGET, objs)
  28. # end building
  29. EndBuilding(TARGET)