SConscript 769 B

123456789101112131415161718192021222324252627
  1. # for module compiling
  2. Import('RTT_ROOT')
  3. Import('rtconfig')
  4. from building import *
  5. import os, fnmatch
  6. cwd = GetCurrentDir()
  7. src = []
  8. CPPPATH = [cwd + '/include']
  9. def add_all_source_file(path):
  10. s = []
  11. for filename in os.listdir(path):
  12. pathname = os.path.join(path, filename)
  13. if os.path.isfile(pathname):
  14. if fnmatch.fnmatchcase(filename, '*.c') or fnmatch.fnmatchcase(filename, '*.cpp'):
  15. s.append(pathname)
  16. elif os.path.isdir(pathname):
  17. s = s + add_all_source_file(pathname)
  18. return s
  19. # Add all source files in src directory
  20. src = add_all_source_file("src")
  21. group = DefineGroup('cBOX', src, depend = ['PKG_USING_CBOX'], CPPPATH = CPPPATH)
  22. Return('group')