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