From 59feb97ced4d92ed80fd34019f32e0b0ee2f510c Mon Sep 17 00:00:00 2001 From: Fan Yang <93824713+helloeagleyang@users.noreply.github.com> Date: Fri, 21 Feb 2025 16:45:38 +0800 Subject: [PATCH] [bsp][hpmicro] fix 'scons -dist' issue in the hpmicro bsps. (#10013) - added tools and dist_handle function Signed-off-by: Fan YANG --- bsp/hpmicro/hpm5300evk/rtconfig.py | 9 ++++++++- bsp/hpmicro/hpm5301evklite/rtconfig.py | 9 ++++++++- bsp/hpmicro/hpm6200evk/rtconfig.py | 9 ++++++++- bsp/hpmicro/hpm6300evk/rtconfig.py | 9 ++++++++- bsp/hpmicro/hpm6750evk/rtconfig.py | 9 ++++++++- bsp/hpmicro/hpm6750evk2/rtconfig.py | 9 ++++++++- bsp/hpmicro/hpm6750evkmini/rtconfig.py | 9 ++++++++- bsp/hpmicro/hpm6800evk/rtconfig.py | 9 ++++++++- bsp/hpmicro/hpm6e00evk/rtconfig.py | 7 +++++++ bsp/hpmicro/tools/sdk_dist.py | 17 +++++++++++++++++ 10 files changed, 88 insertions(+), 8 deletions(-) create mode 100644 bsp/hpmicro/tools/sdk_dist.py diff --git a/bsp/hpmicro/hpm5300evk/rtconfig.py b/bsp/hpmicro/hpm5300evk/rtconfig.py index 7b3f3b8ca7..610c915fd3 100644 --- a/bsp/hpmicro/hpm5300evk/rtconfig.py +++ b/bsp/hpmicro/hpm5300evk/rtconfig.py @@ -107,4 +107,11 @@ if PLATFORM == 'gcc': # module setting CXXFLAGS = CFLAGS + ' -Woverloaded-virtual -fno-exceptions -fno-rtti ' - CFLAGS = CFLAGS + ' -std=gnu11' \ No newline at end of file + CFLAGS = CFLAGS + ' -std=gnu11' + +def dist_handle(BSP_ROOT, dist_dir): + import sys + cwd_path = os.getcwd() + sys.path.append(os.path.join(os.path.dirname(BSP_ROOT), 'tools')) + from sdk_dist import dist_do_building + dist_do_building(BSP_ROOT, dist_dir) \ No newline at end of file diff --git a/bsp/hpmicro/hpm5301evklite/rtconfig.py b/bsp/hpmicro/hpm5301evklite/rtconfig.py index 73d2d3549b..7dfd2e32bb 100644 --- a/bsp/hpmicro/hpm5301evklite/rtconfig.py +++ b/bsp/hpmicro/hpm5301evklite/rtconfig.py @@ -107,4 +107,11 @@ if PLATFORM == 'gcc': # module setting CXXFLAGS = CFLAGS + ' -Woverloaded-virtual -fno-exceptions -fno-rtti ' - CFLAGS = CFLAGS + ' -std=gnu11' \ No newline at end of file + CFLAGS = CFLAGS + ' -std=gnu11' + +def dist_handle(BSP_ROOT, dist_dir): + import sys + cwd_path = os.getcwd() + sys.path.append(os.path.join(os.path.dirname(BSP_ROOT), 'tools')) + from sdk_dist import dist_do_building + dist_do_building(BSP_ROOT, dist_dir) \ No newline at end of file diff --git a/bsp/hpmicro/hpm6200evk/rtconfig.py b/bsp/hpmicro/hpm6200evk/rtconfig.py index a75c36b306..c45d5ed584 100644 --- a/bsp/hpmicro/hpm6200evk/rtconfig.py +++ b/bsp/hpmicro/hpm6200evk/rtconfig.py @@ -107,4 +107,11 @@ if PLATFORM == 'gcc': # module setting CXXFLAGS = CFLAGS + ' -Woverloaded-virtual -fno-exceptions -fno-rtti ' - CFLAGS = CFLAGS + ' -std=gnu11' \ No newline at end of file + CFLAGS = CFLAGS + ' -std=gnu11' + +def dist_handle(BSP_ROOT, dist_dir): + import sys + cwd_path = os.getcwd() + sys.path.append(os.path.join(os.path.dirname(BSP_ROOT), 'tools')) + from sdk_dist import dist_do_building + dist_do_building(BSP_ROOT, dist_dir) \ No newline at end of file diff --git a/bsp/hpmicro/hpm6300evk/rtconfig.py b/bsp/hpmicro/hpm6300evk/rtconfig.py index da3d3b00bc..5ef6eea284 100644 --- a/bsp/hpmicro/hpm6300evk/rtconfig.py +++ b/bsp/hpmicro/hpm6300evk/rtconfig.py @@ -107,4 +107,11 @@ if PLATFORM == 'gcc': # module setting CXXFLAGS = CFLAGS + ' -Woverloaded-virtual -fno-exceptions -fno-rtti ' - CFLAGS = CFLAGS + ' -std=gnu11' \ No newline at end of file + CFLAGS = CFLAGS + ' -std=gnu11' + +def dist_handle(BSP_ROOT, dist_dir): + import sys + cwd_path = os.getcwd() + sys.path.append(os.path.join(os.path.dirname(BSP_ROOT), 'tools')) + from sdk_dist import dist_do_building + dist_do_building(BSP_ROOT, dist_dir) \ No newline at end of file diff --git a/bsp/hpmicro/hpm6750evk/rtconfig.py b/bsp/hpmicro/hpm6750evk/rtconfig.py index 567e958622..0f29ec0518 100644 --- a/bsp/hpmicro/hpm6750evk/rtconfig.py +++ b/bsp/hpmicro/hpm6750evk/rtconfig.py @@ -107,4 +107,11 @@ if PLATFORM == 'gcc': # module setting CXXFLAGS = CFLAGS + ' -Woverloaded-virtual -fno-exceptions -fno-rtti ' - CFLAGS = CFLAGS + ' -std=gnu11' \ No newline at end of file + CFLAGS = CFLAGS + ' -std=gnu11' + +def dist_handle(BSP_ROOT, dist_dir): + import sys + cwd_path = os.getcwd() + sys.path.append(os.path.join(os.path.dirname(BSP_ROOT), 'tools')) + from sdk_dist import dist_do_building + dist_do_building(BSP_ROOT, dist_dir) \ No newline at end of file diff --git a/bsp/hpmicro/hpm6750evk2/rtconfig.py b/bsp/hpmicro/hpm6750evk2/rtconfig.py index f2dc9809da..b32af3b14f 100644 --- a/bsp/hpmicro/hpm6750evk2/rtconfig.py +++ b/bsp/hpmicro/hpm6750evk2/rtconfig.py @@ -107,4 +107,11 @@ if PLATFORM == 'gcc': # module setting CXXFLAGS = CFLAGS + ' -Woverloaded-virtual -fno-exceptions -fno-rtti ' - CFLAGS = CFLAGS + ' -std=gnu11' \ No newline at end of file + CFLAGS = CFLAGS + ' -std=gnu11' + +def dist_handle(BSP_ROOT, dist_dir): + import sys + cwd_path = os.getcwd() + sys.path.append(os.path.join(os.path.dirname(BSP_ROOT), 'tools')) + from sdk_dist import dist_do_building + dist_do_building(BSP_ROOT, dist_dir) \ No newline at end of file diff --git a/bsp/hpmicro/hpm6750evkmini/rtconfig.py b/bsp/hpmicro/hpm6750evkmini/rtconfig.py index 567e958622..0f29ec0518 100644 --- a/bsp/hpmicro/hpm6750evkmini/rtconfig.py +++ b/bsp/hpmicro/hpm6750evkmini/rtconfig.py @@ -107,4 +107,11 @@ if PLATFORM == 'gcc': # module setting CXXFLAGS = CFLAGS + ' -Woverloaded-virtual -fno-exceptions -fno-rtti ' - CFLAGS = CFLAGS + ' -std=gnu11' \ No newline at end of file + CFLAGS = CFLAGS + ' -std=gnu11' + +def dist_handle(BSP_ROOT, dist_dir): + import sys + cwd_path = os.getcwd() + sys.path.append(os.path.join(os.path.dirname(BSP_ROOT), 'tools')) + from sdk_dist import dist_do_building + dist_do_building(BSP_ROOT, dist_dir) \ No newline at end of file diff --git a/bsp/hpmicro/hpm6800evk/rtconfig.py b/bsp/hpmicro/hpm6800evk/rtconfig.py index 15e2bab96e..5e40026924 100644 --- a/bsp/hpmicro/hpm6800evk/rtconfig.py +++ b/bsp/hpmicro/hpm6800evk/rtconfig.py @@ -107,4 +107,11 @@ if PLATFORM == 'gcc': # module setting CXXFLAGS = CFLAGS + ' -Woverloaded-virtual -fno-exceptions -fno-rtti ' - CFLAGS = CFLAGS + ' -std=gnu11' \ No newline at end of file + CFLAGS = CFLAGS + ' -std=gnu11' + +def dist_handle(BSP_ROOT, dist_dir): + import sys + cwd_path = os.getcwd() + sys.path.append(os.path.join(os.path.dirname(BSP_ROOT), 'tools')) + from sdk_dist import dist_do_building + dist_do_building(BSP_ROOT, dist_dir) \ No newline at end of file diff --git a/bsp/hpmicro/hpm6e00evk/rtconfig.py b/bsp/hpmicro/hpm6e00evk/rtconfig.py index 0ef49a45d8..17038267b2 100644 --- a/bsp/hpmicro/hpm6e00evk/rtconfig.py +++ b/bsp/hpmicro/hpm6e00evk/rtconfig.py @@ -108,3 +108,10 @@ if PLATFORM == 'gcc': # module setting CXXFLAGS = CFLAGS + ' -Woverloaded-virtual -fno-exceptions -fno-rtti ' CFLAGS = CFLAGS + ' -std=gnu11' + +def dist_handle(BSP_ROOT, dist_dir): + import sys + cwd_path = os.getcwd() + sys.path.append(os.path.join(os.path.dirname(BSP_ROOT), 'tools')) + from sdk_dist import dist_do_building + dist_do_building(BSP_ROOT, dist_dir) \ No newline at end of file diff --git a/bsp/hpmicro/tools/sdk_dist.py b/bsp/hpmicro/tools/sdk_dist.py new file mode 100644 index 0000000000..38da0b7230 --- /dev/null +++ b/bsp/hpmicro/tools/sdk_dist.py @@ -0,0 +1,17 @@ +import os +import sys +import shutil +cwd_path = os.getcwd() +sys.path.append(os.path.join(os.path.dirname(cwd_path), 'rt-thread', 'tools')) + +# BSP dist function +def dist_do_building(BSP_ROOT, dist_dir): + from mkdist import bsp_copy_files + import rtconfig + + library_dir = os.path.join(dist_dir, 'libraries') + + print("=> copy HPMicro bsp libraries") + library_path = os.path.join(os.path.dirname(BSP_ROOT), 'libraries') + + bsp_copy_files(library_path, library_dir)