SConstruct 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  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-stm32.' + 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. if rtconfig.PLATFORM == 'iar':
  15. env.Replace(CCCOM = ['$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -o $TARGET $SOURCES'])
  16. env.Replace(ARFLAGS = [''])
  17. env.Replace(LINKCOM = ['$LINK $SOURCES $LINKFLAGS -o $TARGET --map project.map'])
  18. Export('RTT_ROOT')
  19. Export('rtconfig')
  20. # prepare building environment
  21. objs = PrepareBuilding(env, RTT_ROOT)
  22. # STM32 firemare library building script
  23. objs = objs + SConscript('Libraries/SConscript', variant_dir='build/bsp/Libraries', duplicate=0)
  24. # build program
  25. env.Program(TARGET, objs)
  26. # end building
  27. EndBuilding(TARGET)