sdk_dist.py 859 B

1234567891011121314151617181920212223
  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. if rtconfig.BSP_LIBRARY_TYPE is not None:
  14. bsp_copy_files(os.path.join(library_path, rtconfig.BSP_LIBRARY_TYPE),
  15. os.path.join(library_dir, rtconfig.BSP_LIBRARY_TYPE))
  16. print("=> copy bsp drivers")
  17. bsp_copy_files(os.path.join(library_path, 'HAL_Drivers'), os.path.join(library_dir, 'HAL_Drivers'))
  18. shutil.copyfile(os.path.join(library_path, 'Kconfig'), os.path.join(library_dir, 'Kconfig'))