SConscript 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. from building import *
  2. import rtconfig
  3. def get_path_files(dirs, file_ext):
  4. path_files = []
  5. # print('dir: ' + str(dirs))
  6. for dir in dirs:
  7. # print('dir: ' + dir)
  8. path_files += Glob(dir + '/' + file_ext)
  9. return path_files
  10. cwd = GetCurrentDir()
  11. path = []
  12. src = []
  13. C_DIRS = []
  14. app = GetConfigValue('PKG_ZEPHYR_POLLING_EXAMPLE').replace('"', '')
  15. chipset = GetConfigValue('PKG_ZEPHYR_POLLING_CHIPSET').replace('"', '')
  16. porting = GetConfigValue('PKG_ZEPHYR_POLLING_PORTING').replace('"', '')
  17. # print("app: %s" % app)
  18. # print("chipset: %s" % chipset)
  19. # print("porting: %s" % porting)
  20. # Include stack info
  21. stack_path = cwd + '/src'
  22. path.append(stack_path)
  23. C_DIRS.append(stack_path)
  24. C_DIRS.append(stack_path + '/base')
  25. C_DIRS.append(stack_path + '/bluetooth')
  26. C_DIRS.append(stack_path + '/common')
  27. C_DIRS.append(stack_path + '/drivers')
  28. C_DIRS.append(stack_path + '/host')
  29. C_DIRS.append(stack_path + '/logging')
  30. C_DIRS.append(stack_path + '/utils')
  31. C_DIRS.append(stack_path + '/services')
  32. tmp_path = cwd + '/example/' + app
  33. path.append(tmp_path)
  34. C_DIRS.append(tmp_path)
  35. tmp_path = cwd + '/chipset/'
  36. path.append(tmp_path)
  37. tmp_path = tmp_path + chipset
  38. path.append(tmp_path)
  39. C_DIRS.append(tmp_path)
  40. tmp_path = cwd + '/platform/'
  41. path.append(tmp_path)
  42. tmp_path = tmp_path + 'rtthread'
  43. path.append(tmp_path)
  44. C_DIRS.append(tmp_path)
  45. tmp_path = cwd + '/porting/'
  46. path.append(tmp_path)
  47. tmp_path = tmp_path + porting
  48. path.append(tmp_path)
  49. C_DIRS.append(tmp_path)
  50. src = get_path_files(C_DIRS, '*.c')
  51. # print("src: %s" % src)
  52. # if rtconfig.CROSS_TOOL == 'keil':
  53. # LOCAL_CCFLAGS += ' --gnu --diag_suppress=111'
  54. group = DefineGroup('zephyr_polling', src, depend = ['PKG_USING_ZEPHYR_POLLING'], CPPPATH = path)
  55. Return('group')