Skip to content

Commit 3b2fa47

Browse files
committed
[BSP] add Libraries when scons --dist
1 parent f406aab commit 3b2fa47

File tree

2 files changed

+25
-7
lines changed

2 files changed

+25
-7
lines changed

bsp/at32/at32f403a-start/rtconfig.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
else:
5858
CFLAGS += ' -O2'
5959

60-
CXXFLAGS = CFLAGS
60+
CXXFLAGS = CFLAGS
6161

6262
POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n'
6363

@@ -88,7 +88,7 @@
8888
else:
8989
CFLAGS += ' -O2'
9090

91-
CXXFLAGS = CFLAGS
91+
CXXFLAGS = CFLAGS
9292
CFLAGS += ' -std=c99'
9393

9494
POST_ACTION = 'fromelf --bin $TARGET --output rtthread.bin \nfromelf -z $TARGET'
@@ -136,7 +136,7 @@
136136

137137
LFLAGS = ' --config "board/linker_scripts/link.icf"'
138138
LFLAGS += ' --entry __iar_program_start'
139-
139+
140140
CXXFLAGS = CFLAGS
141141

142142
EXEC_PATH = EXEC_PATH + '/arm/bin/'

tools/mkdist.py

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def bsp_update_kconfig(dist_dir):
122122
line = line[0:position] + 'default "rt-thread"\n'
123123
found = 0
124124
f.write(line)
125-
125+
126126
def bsp_update_kconfig_library(dist_dir):
127127
# change RTT_ROOT in Kconfig
128128
if not os.path.isfile(os.path.join(dist_dir, 'Kconfig')):
@@ -141,7 +141,7 @@ def bsp_update_kconfig_library(dist_dir):
141141
found = 0
142142
f.write(line)
143143

144-
# change board/kconfig path
144+
# change board/kconfig path
145145
if not os.path.isfile(os.path.join(dist_dir, 'board/Kconfig')):
146146
return
147147

@@ -214,12 +214,21 @@ 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+
217226
# do bsp special dist handle
218-
if 'dist_handle' in Env:
227+
if 'dist_handle' in Env:
219228
print("=> start dist handle")
220229
dist_handle = Env['dist_handle']
221230
dist_handle(BSP_ROOT)
222-
231+
223232
# get all source files from program
224233
for item in program:
225234
walk_children(item)
@@ -345,6 +354,15 @@ def MkDist(program, BSP_ROOT, RTT_ROOT, Env, rttide = None):
345354
bsp_copy_files(os.path.join(library_path, Env['bsp_lib_type']), os.path.join(library_dir, Env['bsp_lib_type']))
346355
shutil.copyfile(os.path.join(library_path, 'Kconfig'), os.path.join(library_dir, 'Kconfig'))
347356

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+
348366
# do bsp special dist handle
349367
if 'dist_handle' in Env:
350368
print("=> start dist handle")

0 commit comments

Comments
 (0)