Skip to content

Commit 59feb97

Browse files
[bsp][hpmicro] fix 'scons -dist' issue in the hpmicro bsps. (#10013)
- added tools and dist_handle function Signed-off-by: Fan YANG <[email protected]>
1 parent a5b26bb commit 59feb97

File tree

10 files changed

+88
-8
lines changed

10 files changed

+88
-8
lines changed

bsp/hpmicro/hpm5300evk/rtconfig.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,11 @@
107107

108108
# module setting
109109
CXXFLAGS = CFLAGS + ' -Woverloaded-virtual -fno-exceptions -fno-rtti '
110-
CFLAGS = CFLAGS + ' -std=gnu11'
110+
CFLAGS = CFLAGS + ' -std=gnu11'
111+
112+
def dist_handle(BSP_ROOT, dist_dir):
113+
import sys
114+
cwd_path = os.getcwd()
115+
sys.path.append(os.path.join(os.path.dirname(BSP_ROOT), 'tools'))
116+
from sdk_dist import dist_do_building
117+
dist_do_building(BSP_ROOT, dist_dir)

bsp/hpmicro/hpm5301evklite/rtconfig.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,11 @@
107107

108108
# module setting
109109
CXXFLAGS = CFLAGS + ' -Woverloaded-virtual -fno-exceptions -fno-rtti '
110-
CFLAGS = CFLAGS + ' -std=gnu11'
110+
CFLAGS = CFLAGS + ' -std=gnu11'
111+
112+
def dist_handle(BSP_ROOT, dist_dir):
113+
import sys
114+
cwd_path = os.getcwd()
115+
sys.path.append(os.path.join(os.path.dirname(BSP_ROOT), 'tools'))
116+
from sdk_dist import dist_do_building
117+
dist_do_building(BSP_ROOT, dist_dir)

bsp/hpmicro/hpm6200evk/rtconfig.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,11 @@
107107

108108
# module setting
109109
CXXFLAGS = CFLAGS + ' -Woverloaded-virtual -fno-exceptions -fno-rtti '
110-
CFLAGS = CFLAGS + ' -std=gnu11'
110+
CFLAGS = CFLAGS + ' -std=gnu11'
111+
112+
def dist_handle(BSP_ROOT, dist_dir):
113+
import sys
114+
cwd_path = os.getcwd()
115+
sys.path.append(os.path.join(os.path.dirname(BSP_ROOT), 'tools'))
116+
from sdk_dist import dist_do_building
117+
dist_do_building(BSP_ROOT, dist_dir)

bsp/hpmicro/hpm6300evk/rtconfig.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,11 @@
107107

108108
# module setting
109109
CXXFLAGS = CFLAGS + ' -Woverloaded-virtual -fno-exceptions -fno-rtti '
110-
CFLAGS = CFLAGS + ' -std=gnu11'
110+
CFLAGS = CFLAGS + ' -std=gnu11'
111+
112+
def dist_handle(BSP_ROOT, dist_dir):
113+
import sys
114+
cwd_path = os.getcwd()
115+
sys.path.append(os.path.join(os.path.dirname(BSP_ROOT), 'tools'))
116+
from sdk_dist import dist_do_building
117+
dist_do_building(BSP_ROOT, dist_dir)

bsp/hpmicro/hpm6750evk/rtconfig.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,11 @@
107107

108108
# module setting
109109
CXXFLAGS = CFLAGS + ' -Woverloaded-virtual -fno-exceptions -fno-rtti '
110-
CFLAGS = CFLAGS + ' -std=gnu11'
110+
CFLAGS = CFLAGS + ' -std=gnu11'
111+
112+
def dist_handle(BSP_ROOT, dist_dir):
113+
import sys
114+
cwd_path = os.getcwd()
115+
sys.path.append(os.path.join(os.path.dirname(BSP_ROOT), 'tools'))
116+
from sdk_dist import dist_do_building
117+
dist_do_building(BSP_ROOT, dist_dir)

bsp/hpmicro/hpm6750evk2/rtconfig.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,11 @@
107107

108108
# module setting
109109
CXXFLAGS = CFLAGS + ' -Woverloaded-virtual -fno-exceptions -fno-rtti '
110-
CFLAGS = CFLAGS + ' -std=gnu11'
110+
CFLAGS = CFLAGS + ' -std=gnu11'
111+
112+
def dist_handle(BSP_ROOT, dist_dir):
113+
import sys
114+
cwd_path = os.getcwd()
115+
sys.path.append(os.path.join(os.path.dirname(BSP_ROOT), 'tools'))
116+
from sdk_dist import dist_do_building
117+
dist_do_building(BSP_ROOT, dist_dir)

bsp/hpmicro/hpm6750evkmini/rtconfig.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,11 @@
107107

108108
# module setting
109109
CXXFLAGS = CFLAGS + ' -Woverloaded-virtual -fno-exceptions -fno-rtti '
110-
CFLAGS = CFLAGS + ' -std=gnu11'
110+
CFLAGS = CFLAGS + ' -std=gnu11'
111+
112+
def dist_handle(BSP_ROOT, dist_dir):
113+
import sys
114+
cwd_path = os.getcwd()
115+
sys.path.append(os.path.join(os.path.dirname(BSP_ROOT), 'tools'))
116+
from sdk_dist import dist_do_building
117+
dist_do_building(BSP_ROOT, dist_dir)

bsp/hpmicro/hpm6800evk/rtconfig.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,11 @@
107107

108108
# module setting
109109
CXXFLAGS = CFLAGS + ' -Woverloaded-virtual -fno-exceptions -fno-rtti '
110-
CFLAGS = CFLAGS + ' -std=gnu11'
110+
CFLAGS = CFLAGS + ' -std=gnu11'
111+
112+
def dist_handle(BSP_ROOT, dist_dir):
113+
import sys
114+
cwd_path = os.getcwd()
115+
sys.path.append(os.path.join(os.path.dirname(BSP_ROOT), 'tools'))
116+
from sdk_dist import dist_do_building
117+
dist_do_building(BSP_ROOT, dist_dir)

bsp/hpmicro/hpm6e00evk/rtconfig.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,3 +108,10 @@
108108
# module setting
109109
CXXFLAGS = CFLAGS + ' -Woverloaded-virtual -fno-exceptions -fno-rtti '
110110
CFLAGS = CFLAGS + ' -std=gnu11'
111+
112+
def dist_handle(BSP_ROOT, dist_dir):
113+
import sys
114+
cwd_path = os.getcwd()
115+
sys.path.append(os.path.join(os.path.dirname(BSP_ROOT), 'tools'))
116+
from sdk_dist import dist_do_building
117+
dist_do_building(BSP_ROOT, dist_dir)

bsp/hpmicro/tools/sdk_dist.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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, dist_dir):
9+
from mkdist import bsp_copy_files
10+
import rtconfig
11+
12+
library_dir = os.path.join(dist_dir, 'libraries')
13+
14+
print("=> copy HPMicro bsp libraries")
15+
library_path = os.path.join(os.path.dirname(BSP_ROOT), 'libraries')
16+
17+
bsp_copy_files(library_path, library_dir)

0 commit comments

Comments
 (0)