SConscript 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. from building import *
  2. import rtconfig
  3. import os
  4. import shutil
  5. # get current dir path
  6. cwd = GetCurrentDir()
  7. src = []
  8. inc = []
  9. lvgl_cwd = cwd + '/../'
  10. lvgl_src_cwd = lvgl_cwd + 'src/'
  11. inc = inc + [lvgl_src_cwd]
  12. for root, dirs, files in os.walk(lvgl_src_cwd):
  13. for dir in dirs:
  14. src = src + Glob(os.path.join(root,dir,'*.c'))
  15. inc = inc + [os.path.join(root,dir)]
  16. LOCAL_CCFLAGS = ''
  17. if rtconfig.PLATFORM == 'gcc': # GCC
  18. LOCAL_CCFLAGS += ' -std=c99'
  19. elif rtconfig.PLATFORM == 'armcc': # Keil AC5
  20. LOCAL_CCFLAGS += ' --c99 --gnu -g -W'
  21. elif rtconfig.PLATFORM == 'armclang': # Keil AC6
  22. LOCAL_CCFLAGS += ' -std=c99 -g -w'
  23. group = DefineGroup('LVGL', src, depend = ['PKG_USING_LVGL'], CPPPATH = inc, LOCAL_CCFLAGS = LOCAL_CCFLAGS)
  24. port_src = Glob('*.c')
  25. port_inc = [cwd]
  26. group = group + DefineGroup('LVGL-port', port_src, depend = ['PKG_USING_LVGL'], CPPPATH = port_inc)
  27. list = os.listdir(cwd)
  28. for d in list:
  29. path = os.path.join(cwd, d)
  30. if os.path.isfile(os.path.join(path, 'SConscript')):
  31. group = group + SConscript(os.path.join(d, 'SConscript'))
  32. #
  33. # try:
  34. # shutil.rmtree(os.path.join(lvgl_cwd, '.github'))
  35. # shutil.rmtree(os.path.join(lvgl_cwd, 'docs'))
  36. # shutil.rmtree(os.path.join(lvgl_cwd, 'scripts'))
  37. # shutil.rmtree(os.path.join(lvgl_cwd, 'tests'))
  38. # shutil.rmtree(os.path.join(lvgl_cwd, 'zephyr'))
  39. # os.remove(os.path.join(lvgl_cwd, '.codecov.yml'))
  40. # os.remove(os.path.join(lvgl_cwd, '.editorconfig'))
  41. # os.remove(os.path.join(lvgl_cwd, '.gitignore'))
  42. # os.remove(os.path.join(lvgl_cwd, '.gitmodules'))
  43. # os.remove(os.path.join(lvgl_cwd, 'CMakeLists.txt'))
  44. # os.remove(os.path.join(lvgl_cwd, 'component.mk'))
  45. # os.remove(os.path.join(lvgl_cwd, 'idf_component.yml'))
  46. # os.remove(os.path.join(lvgl_cwd, 'Kconfig'))
  47. # os.remove(os.path.join(lvgl_cwd, 'library.json'))
  48. # os.remove(os.path.join(lvgl_cwd, 'library.properties'))
  49. # os.remove(os.path.join(lvgl_cwd, 'lv_conf_template.h'))
  50. # os.remove(os.path.join(lvgl_cwd, 'lvgl.mk'))
  51. # except:
  52. # pass
  53. #
  54. Return('group')