SConscript 670 B

123456789101112131415161718192021222324252627
  1. # RT-Thread building script for bridge
  2. import os
  3. from building import *
  4. Import('rtconfig')
  5. cwd = GetCurrentDir()
  6. group = []
  7. list = os.listdir(cwd)
  8. bsp_path = Dir('#').abspath
  9. if not os.path.exists(bsp_path + "/link.lds"):
  10. Env['LINKFLAGS'] = Env['LINKFLAGS'].replace('link.lds', cwd + "/link.lds")
  11. Preprocessing("link.lds.S", ".lds", CPPPATH=[bsp_path])
  12. # fix the linker with crtx.o
  13. Env['LINKFLAGS'] += ' -nostartfiles'
  14. # add common code files
  15. group = group + SConscript(os.path.join('common', 'SConscript'))
  16. # cpu porting code files
  17. if rtconfig.CPU != 'common':
  18. group = group + SConscript(os.path.join(rtconfig.CPU, 'SConscript'))
  19. Return('group')