Skip to content

Commit 4313ee6

Browse files
committed
[BSP][AT32] fixed scons --dist
1 parent eae89d1 commit 4313ee6

File tree

3 files changed

+17
-9
lines changed

3 files changed

+17
-9
lines changed

bsp/at32/at32f403a-start/rtconfig.py

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

43
# toolchains options
54
ARCH='arm'
@@ -143,8 +142,9 @@
143142
EXEC_PATH = EXEC_PATH + '/arm/bin/'
144143
POST_ACTION = 'ielftool --bin $TARGET rtthread.bin'
145144

146-
def dist_handle(BSP_ROOT):
145+
def dist_handle(BSP_ROOT, dist_dir):
146+
import sys
147147
cwd_path = os.getcwd()
148148
sys.path.append(os.path.join(os.path.dirname(BSP_ROOT), 'tools'))
149149
from sdk_dist import dist_do_building
150-
dist_do_building(BSP_ROOT)
150+
dist_do_building(BSP_ROOT, dist_dir)

bsp/at32/at32f407-start/rtconfig.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,3 +141,10 @@
141141

142142
EXEC_PATH = EXEC_PATH + '/arm/bin/'
143143
POST_ACTION = 'ielftool --bin $TARGET rtthread.bin'
144+
145+
def dist_handle(BSP_ROOT, dist_dir):
146+
import sys
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, dist_dir)

bsp/at32/tools/sdk_dist.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,16 @@
55
sys.path.append(os.path.join(os.path.dirname(cwd_path), 'rt-thread', 'tools'))
66

77
# BSP dist function
8-
def dist_do_building(BSP_ROOT):
8+
def dist_do_building(BSP_ROOT, dist_dir):
99
from mkdist import bsp_copy_files
1010
import rtconfig
11-
12-
dist_dir = os.path.join(BSP_ROOT, 'dist', os.path.basename(BSP_ROOT))
11+
12+
print("=> copy at32 bsp library")
13+
library_dir = os.path.join(dist_dir, 'Libraries')
1314
library_path = os.path.join(os.path.dirname(BSP_ROOT), 'Libraries')
14-
library_dir = os.path.join(dist_dir, 'Libraries')
15+
bsp_copy_files(os.path.join(library_path, rtconfig.BSP_LIBRARY_TYPE),
16+
os.path.join(library_dir, rtconfig.BSP_LIBRARY_TYPE))
17+
1518
print("=> copy bsp drivers")
1619
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))
1920
shutil.copyfile(os.path.join(library_path, 'Kconfig'), os.path.join(library_dir, 'Kconfig'))

0 commit comments

Comments
 (0)