Skip to content

Commit e1bd367

Browse files
committed
[AT32 BSP] do bsp special dist handle
1 parent 964cbe6 commit e1bd367

File tree

4 files changed

+27
-20
lines changed

4 files changed

+27
-20
lines changed

bsp/at32/at32f403a-start/Kconfig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,5 @@ config PKGS_DIR
1717

1818
source "$RTT_DIR/Kconfig"
1919
source "$PKGS_DIR/Kconfig"
20-
source "../libraries/Kconfig"
20+
source "../Libraries/Kconfig"
2121
source "board/Kconfig"
22-

bsp/at32/at32f403a-start/rtconfig.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
import sys
23

34
# toolchains options
45
ARCH='arm'
@@ -141,3 +142,9 @@
141142

142143
EXEC_PATH = EXEC_PATH + '/arm/bin/'
143144
POST_ACTION = 'ielftool --bin $TARGET rtthread.bin'
145+
146+
def dist_handle(BSP_ROOT):
147+
cwd_path = os.getcwd()
148+
sys.path.append(os.path.join(os.path.dirname(BSP_ROOT), 'tools'))
149+
from sdk_dist import dist_do_building
150+
dist_do_building(BSP_ROOT)

bsp/at32/tools/sdk_dist.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
7+
# BSP dist function
8+
def dist_do_building(BSP_ROOT):
9+
from mkdist import bsp_copy_files
10+
import rtconfig
11+
12+
dist_dir = os.path.join(BSP_ROOT, 'dist', os.path.basename(BSP_ROOT))
13+
library_path = os.path.join(os.path.dirname(BSP_ROOT), 'Libraries')
14+
library_dir = os.path.join(dist_dir, 'Libraries')
15+
print("=> copy bsp drivers")
16+
bsp_copy_files(os.path.join(library_path, 'rt_drivers'), os.path.join(library_dir, 'rt_drivers'))
17+
print("=> copy bsp library")
18+
bsp_copy_files(os.path.join(library_path, rtconfig.BSP_LIBRARY_TYPE), os.path.join(library_dir, rtconfig.BSP_LIBRARY_TYPE))
19+
shutil.copyfile(os.path.join(library_path, 'Kconfig'), os.path.join(library_dir, 'Kconfig'))

tools/mkdist.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -214,15 +214,6 @@ def MkDist_Strip(program, BSP_ROOT, RTT_ROOT, Env):
214214
bsp_copy_files(os.path.join(library_path, Env['bsp_lib_type']), os.path.join(library_dir, Env['bsp_lib_type']))
215215
shutil.copyfile(os.path.join(library_path, 'Kconfig'), os.path.join(library_dir, 'Kconfig'))
216216

217-
# copy at32 bsp libiary files
218-
if os.path.basename(os.path.dirname(BSP_ROOT)) == 'at32':
219-
print("=> copy at32 bsp library")
220-
library_path = os.path.join(os.path.dirname(BSP_ROOT), 'Libraries')
221-
library_dir = os.path.join(dist_dir, 'Libraries')
222-
bsp_copy_files(os.path.join(library_path, 'rt_drivers'), os.path.join(library_dir, 'rt_drivers'))
223-
bsp_copy_files(os.path.join(library_path, 'AT32_Std_Driver'), os.path.join(library_dir, 'AT32_Std_Driver'))
224-
shutil.copyfile(os.path.join(library_path, 'Kconfig'), os.path.join(library_dir, 'Kconfig'))
225-
226217
# do bsp special dist handle
227218
if 'dist_handle' in Env:
228219
print("=> start dist handle")
@@ -354,15 +345,6 @@ def MkDist(program, BSP_ROOT, RTT_ROOT, Env, rttide = None):
354345
bsp_copy_files(os.path.join(library_path, Env['bsp_lib_type']), os.path.join(library_dir, Env['bsp_lib_type']))
355346
shutil.copyfile(os.path.join(library_path, 'Kconfig'), os.path.join(library_dir, 'Kconfig'))
356347

357-
# copy at32 bsp libiary files
358-
if os.path.basename(os.path.dirname(BSP_ROOT)) == 'at32':
359-
print("=> copy at32 bsp library")
360-
library_path = os.path.join(os.path.dirname(BSP_ROOT), 'Libraries')
361-
library_dir = os.path.join(dist_dir, 'Libraries')
362-
bsp_copy_files(os.path.join(library_path, 'rt_drivers'), os.path.join(library_dir, 'rt_drivers'))
363-
bsp_copy_files(os.path.join(library_path, 'AT32_Std_Driver'), os.path.join(library_dir, 'AT32_Std_Driver'))
364-
shutil.copyfile(os.path.join(library_path, 'Kconfig'), os.path.join(library_dir, 'Kconfig'))
365-
366348
# copy nuclei bsp libiary files
367349
if os.path.basename(os.path.dirname(BSP_ROOT)) == 'nuclei':
368350
print("=> copy nuclei bsp library")

0 commit comments

Comments
 (0)