[bluetrum] add --dist

This commit is contained in:
greedyhao 2020-12-11 18:33:09 +08:00
parent 51bba95ef8
commit ec060312b7
10 changed files with 45 additions and 4 deletions

View File

@ -7,3 +7,4 @@
*.old *.old
build build
dist

View File

@ -102,7 +102,7 @@ msh >
## 注意事项 ## 注意事项
目前的 `cconfig.h` 的生成脚本对 riscv 的工具链识别有问题,可能需要在 `cconfig.h` 中手动添加以下配置 编译报错的时候,如果出现重复定义的报错,可能需要在 `cconfig.h` 中手动添加以下配置
``` ```
#define HAVE_SIGEVENT 1 #define HAVE_SIGEVENT 1

View File

@ -55,7 +55,7 @@ objs.extend(SConscript(os.path.join(libraries_path_prefix, bsp_library_type, 'SC
objs.extend(SConscript(os.path.join(libraries_path_prefix, 'hal_drivers', 'SConscript'))) objs.extend(SConscript(os.path.join(libraries_path_prefix, 'hal_drivers', 'SConscript')))
# include drivers # include drivers
objs.extend(SConscript(os.path.join(libcpu_path_prefix, 'SConscript'))) objs.extend(SConscript(os.path.join(libcpu_path_prefix, 'cpu', 'SConscript')))
# make a building # make a building
DoBuilding(TARGET, objs) DoBuilding(TARGET, objs)

View File

@ -3,10 +3,19 @@
/* Automatically generated file; DO NOT EDIT. */ /* Automatically generated file; DO NOT EDIT. */
/* compiler configure file for RT-Thread in GCC*/ /* compiler configure file for RT-Thread in GCC*/
#define HAVE_NEWLIB_H 1
#define LIBC_VERSION "newlib 3.2.0"
#define STDC "1989" #define HAVE_SYS_SIGNAL_H 1
#define HAVE_SYS_SELECT_H 1
#define HAVE_PTHREAD_H 1
#define HAVE_FDSET 1
#define HAVE_SIGACTION 1
#define HAVE_SIGEVENT 1 #define HAVE_SIGEVENT 1
#define HAVE_SIGINFO 1 #define HAVE_SIGINFO 1
#define HAVE_SIGVAL 1 #define HAVE_SIGVAL 1
#define GCC_VERSION_STR "10.1.0"
#define STDC "2011"
#endif #endif

View File

@ -58,3 +58,10 @@ if PLATFORM == 'gcc':
DUMP_ACTION = OBJDUMP + ' -D -S $TARGET > rtt.asm\n' DUMP_ACTION = OBJDUMP + ' -D -S $TARGET > rtt.asm\n'
POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n' POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n'
POST_ACTION += './riscv32-elf-xmaker -b rtthread.xm\n' POST_ACTION += './riscv32-elf-xmaker -b rtthread.xm\n'
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)

View File

@ -0,0 +1,24 @@
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 bluetrum bsp library")
library_path = os.path.join(os.path.dirname(BSP_ROOT), 'libraries')
library_dir = os.path.join(dist_dir, 'libraries')
bsp_copy_files(os.path.join(library_path, rtconfig.BSP_LIBRARY_TYPE), os.path.join(library_dir, rtconfig.BSP_LIBRARY_TYPE))
print("=> copy bsp drivers")
bsp_copy_files(os.path.join(library_path, 'hal_drivers'), os.path.join(library_dir, 'hal_drivers'))
# shutil.copyfile(os.path.join(library_path, 'Kconfig'), os.path.join(library_dir, 'Kconfig'))
print("=> copy libcpu")
bsp_copy_files(os.path.join(os.path.dirname(BSP_ROOT), 'libcpu'), os.path.join(dist_dir, 'libcpu'))