[update] nuclei dist handle

This commit is contained in:
SummerGift 2020-05-06 15:32:53 +08:00
parent dbfd464a77
commit 36755af0be
3 changed files with 30 additions and 7 deletions

View File

@ -5,6 +5,9 @@ ARCH='risc-v'
CPU='nuclei' CPU='nuclei'
CROSS_TOOL='gcc' CROSS_TOOL='gcc'
# bsp lib config
BSP_LIBRARY_TYPE = None
if os.getenv('RTT_CC'): if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC') CROSS_TOOL = os.getenv('RTT_CC')
@ -18,7 +21,9 @@ else:
# EXEC_PATH = os.getenv('RTT_EXEC_PATH') # EXEC_PATH = os.getenv('RTT_EXEC_PATH')
BUILD = 'debug' BUILD = 'debug'
# Fixed configurations below # Fixed configurations below
NUCLEI_SDK_OPENOCD_CFG = "type in your config"
NUCLEI_SDK_SOC = "gd32vf103" NUCLEI_SDK_SOC = "gd32vf103"
NUCLEI_SDK_BOARD = "gd32vf103v_rvstar" NUCLEI_SDK_BOARD = "gd32vf103v_rvstar"
NUCLEI_SDK_DOWNLOAD = "flashxip" NUCLEI_SDK_DOWNLOAD = "flashxip"
@ -56,3 +61,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'
def dist_handle(BSP_ROOT):
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)

View File

@ -0,0 +1,18 @@
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):
from mkdist import bsp_copy_files
import rtconfig
dist_dir = os.path.join(BSP_ROOT, 'dist', os.path.basename(BSP_ROOT))
library_dir = os.path.join(dist_dir, 'libraries')
print("=> copy nuclei 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))

View File

@ -336,13 +336,6 @@ def MkDist(program, BSP_ROOT, RTT_ROOT, Env, rttide = None):
print('=> %s' % os.path.basename(BSP_ROOT)) print('=> %s' % os.path.basename(BSP_ROOT))
bsp_copy_files(BSP_ROOT, dist_dir) bsp_copy_files(BSP_ROOT, dist_dir)
# copy nuclei bsp libiary files
if os.path.basename(os.path.dirname(BSP_ROOT)) == 'nuclei':
print("=> copy nuclei 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, Env['bsp_lib_type']), os.path.join(library_dir, Env['bsp_lib_type']))
# do bsp special dist handle # do bsp special dist handle
if 'dist_handle' in Env: if 'dist_handle' in Env:
print("=> start dist handle") print("=> start dist handle")