SConstruct 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  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(LINKCOM = ['$LINK $SOURCES $LINKFLAGS -o $TARGET --map project.map'])
  17. Export('RTT_ROOT')
  18. Export('rtconfig')
  19. # prepare building environment
  20. objs = PrepareBuilding(env, RTT_ROOT)
  21. # STM32 firemare library building script
  22. objs = objs + SConscript(RTT_ROOT + '/bsp/stm32f10x/Libraries/SConscript', variant_dir='build/bsp/Libraries', duplicate=0)
  23. # build program
  24. env.Program(TARGET, objs)
  25. # end building
  26. EndBuilding(TARGET)