sdk_dist.py 808 B

12345678910111213141516171819202122
  1. import os
  2. import sys
  3. import shutil
  4. cwd_path = os.getcwd()
  5. sys.path.append(os.path.join(os.path.dirname(cwd_path), 'rt-thread', 'tools'))
  6. # BSP dist function
  7. def dist_do_building(BSP_ROOT, dist_dir):
  8. from mkdist import bsp_copy_files
  9. import rtconfig
  10. print("=> copy stm32 bsp library")
  11. library_dir = os.path.join(dist_dir, 'libraries')
  12. library_path = os.path.join(os.path.dirname(BSP_ROOT), 'libraries')
  13. bsp_copy_files(os.path.join(library_path, rtconfig.BSP_LIBRARY_TYPE),
  14. os.path.join(library_dir, rtconfig.BSP_LIBRARY_TYPE))
  15. print("=> copy bsp drivers")
  16. bsp_copy_files(os.path.join(library_path, 'HAL_Drivers'), os.path.join(library_dir, 'HAL_Drivers'))
  17. shutil.copyfile(os.path.join(library_path, 'Kconfig'), os.path.join(library_dir, 'Kconfig'))