rt-thread/tools/mkdist.py

411 lines
15 KiB
Python
Raw Normal View History

2018-05-30 20:58:04 +08:00
#
# File : mkdir.py
# This file is part of RT-Thread RTOS
# COPYRIGHT (C) 2006 - 2018, RT-Thread Development Team
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Change Logs:
# Date Author Notes
# 2017-10-04 Bernard The first version
2017-11-04 17:39:45 +08:00
import os
import shutil
from shutil import ignore_patterns
def do_copy_file(src, dst):
# check source file
if not os.path.exists(src):
return
path = os.path.dirname(dst)
# mkdir if path not exist
if not os.path.exists(path):
os.makedirs(path)
shutil.copy2(src, dst)
def do_copy_folder(src_dir, dst_dir, ignore=None):
import shutil
# check source directory
if not os.path.exists(src_dir):
return
try:
if os.path.exists(dst_dir):
shutil.rmtree(dst_dir)
except:
print('Deletes folder: %s failed.' % dst_dir)
return
shutil.copytree(src_dir, dst_dir, ignore = ignore)
2018-08-03 11:51:52 +08:00
source_ext = ['c', 'h', 's', 'S', 'cpp', 'xpm']
2017-11-04 17:39:45 +08:00
source_list = []
def walk_children(child):
global source_list
global source_ext
# print child
full_path = child.rfile().abspath
file_type = full_path.rsplit('.',1)[1]
#print file_type
if file_type in source_ext:
if full_path not in source_list:
source_list.append(full_path)
children = child.all_children()
if children != []:
for item in children:
walk_children(item)
def walk_kconfig(RTT_ROOT, source_list):
for parent, dirnames, filenames in os.walk(RTT_ROOT):
if 'bsp' in parent:
continue
if '.git' in parent:
continue
if 'tools' in parent:
continue
if 'Kconfig' in filenames:
pathfile = os.path.join(parent, 'Kconfig')
source_list.append(pathfile)
if 'KConfig' in filenames:
pathfile = os.path.join(parent, 'KConfig')
source_list.append(pathfile)
2018-08-03 11:09:01 +08:00
def bsp_copy_files(bsp_root, dist_dir):
# copy BSP files
do_copy_folder(os.path.join(bsp_root), dist_dir,
ignore_patterns('build', 'dist', '*.pyc', '*.old', '*.map', 'rtthread.bin', '.sconsign.dblite', '*.elf', '*.axf', 'cconfig.h'))
def bsp_update_sconstruct(dist_dir):
2018-08-03 11:51:52 +08:00
with open(os.path.join(dist_dir, 'SConstruct'), 'r') as f:
data = f.readlines()
2018-08-03 11:51:52 +08:00
with open(os.path.join(dist_dir, 'SConstruct'), 'w') as f:
for line in data:
if line.find('RTT_ROOT') != -1:
if line.find('sys.path') != -1:
f.write('# set RTT_ROOT\n')
2018-08-03 11:51:52 +08:00
f.write('if not os.getenv("RTT_ROOT"): \n RTT_ROOT="rt-thread"\n\n')
f.write(line)
2017-11-04 17:39:45 +08:00
def bsp_update_kconfig(dist_dir):
# change RTT_ROOT in Kconfig
2018-08-03 11:51:52 +08:00
if not os.path.isfile(os.path.join(dist_dir, 'Kconfig')):
return
with open(os.path.join(dist_dir, 'Kconfig'), 'r') as f:
data = f.readlines()
2018-08-03 11:51:52 +08:00
with open(os.path.join(dist_dir, 'Kconfig'), 'w') as f:
found = 0
for line in data:
if line.find('RTT_ROOT') != -1:
found = 1
if line.find('default') != -1 and found:
position = line.find('default')
2019-01-15 09:41:15 +08:00
line = line[0:position] + 'default "rt-thread"\n'
found = 0
f.write(line)
2018-12-13 10:56:09 +08:00
def bsp_update_kconfig_library(dist_dir):
# change RTT_ROOT in Kconfig
if not os.path.isfile(os.path.join(dist_dir, 'Kconfig')):
return
with open(os.path.join(dist_dir, 'Kconfig'), 'r') as f:
data = f.readlines()
with open(os.path.join(dist_dir, 'Kconfig'), 'w') as f:
found = 0
for line in data:
if line.find('RTT_ROOT') != -1:
found = 1
if line.find('../libraries') != -1 and found:
position = line.find('../libraries')
line = line[0:position] + 'libraries/Kconfig"\n'
found = 0
f.write(line)
2019-07-18 10:25:15 +08:00
# change board/kconfig path
if not os.path.isfile(os.path.join(dist_dir, 'board/Kconfig')):
return
with open(os.path.join(dist_dir, 'board/Kconfig'), 'r') as f:
data = f.readlines()
with open(os.path.join(dist_dir, 'board/Kconfig'), 'w') as f:
for line in data:
if line.find('../libraries/HAL_Drivers/Kconfig') != -1:
position = line.find('../libraries/HAL_Drivers/Kconfig')
line = line[0:position] + 'libraries/HAL_Drivers/Kconfig"\n'
f.write(line)
2019-06-17 20:34:05 +08:00
def bs_update_ide_project(bsp_root, rtt_root, rttide = None):
import subprocess
# default update the projects which have template file
if rttide == None:
tgt_dict = {'mdk4':('keil', 'armcc'),
'mdk5':('keil', 'armcc'),
'iar':('iar', 'iar'),
'vs':('msvc', 'cl'),
'vs2012':('msvc', 'cl'),
'cdk':('gcc', 'gcc')}
else:
item = 'eclipse --project-name=' + rttide['project_name']
tgt_dict = {item:('gcc', 'gcc')}
2019-06-17 20:34:05 +08:00
scons_env = os.environ.copy()
2018-08-03 11:51:52 +08:00
scons_env['RTT_ROOT'] = rtt_root
for item in tgt_dict:
child = subprocess.Popen('scons --target=' + item, cwd=bsp_root, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
stdout, stderr = child.communicate()
if child.returncode == 0:
2018-08-03 11:51:52 +08:00
print('update %s project' % item)
def zip_dist(dist_dir, dist_name):
import zipfile
2017-11-04 17:39:45 +08:00
zip_filename = os.path.join(dist_dir)
2018-08-03 11:51:52 +08:00
zip = zipfile.ZipFile(zip_filename + '.zip', 'w')
pre_len = len(os.path.dirname(dist_dir))
2017-11-04 17:39:45 +08:00
for parent, dirnames, filenames in os.walk(dist_dir):
for filename in filenames:
pathfile = os.path.join(parent, filename)
arcname = pathfile[pre_len:].strip(os.path.sep)
zip.write(pathfile, arcname)
2017-11-04 17:39:45 +08:00
zip.close()
2017-11-04 17:39:45 +08:00
2018-08-03 11:09:01 +08:00
def MkDist_Strip(program, BSP_ROOT, RTT_ROOT, Env):
global source_list
2018-08-03 11:51:52 +08:00
print('make distribution and strip useless files....')
2018-08-03 11:09:01 +08:00
dist_name = os.path.basename(BSP_ROOT)
dist_dir = os.path.join(BSP_ROOT, 'dist-strip', dist_name)
2018-08-03 11:09:01 +08:00
target_path = os.path.join(dist_dir, 'rt-thread')
2018-08-03 11:51:52 +08:00
print('=> %s' % os.path.basename(BSP_ROOT))
bsp_copy_files(BSP_ROOT, dist_dir)
2018-08-03 11:09:01 +08:00
2018-12-13 10:56:09 +08:00
# copy stm32 bsp libiary files
if os.path.basename(os.path.dirname(BSP_ROOT)) == 'stm32':
print("=> copy stm32 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, 'HAL_Drivers'), os.path.join(library_dir, 'HAL_Drivers'))
bsp_copy_files(os.path.join(library_path, Env['bsp_lib_type']), os.path.join(library_dir, Env['bsp_lib_type']))
shutil.copyfile(os.path.join(library_path, 'Kconfig'), os.path.join(library_dir, 'Kconfig'))
# do bsp special dist handle
if 'dist_handle' in Env:
print("=> start dist handle")
dist_handle = Env['dist_handle']
dist_handle(BSP_ROOT)
2018-08-03 11:09:01 +08:00
# get all source files from program
for item in program:
walk_children(item)
source_list.sort()
# copy the source files without libcpu and components/libc in RT-Thread
target_list = []
libcpu_dir = os.path.join(RTT_ROOT, 'libcpu').lower()
2018-08-03 11:51:52 +08:00
libc_dir = os.path.join(RTT_ROOT, 'components', 'libc', 'compilers').lower()
sal_dir = os.path.join(RTT_ROOT, 'components', 'net', 'sal_socket').lower()
sources_include_sal = False
2018-08-03 11:09:01 +08:00
for src in source_list:
if src.lower().startswith(BSP_ROOT.lower()):
continue
# skip libc and libcpu dir
if src.lower().startswith(libcpu_dir):
continue
if src.lower().startswith(libc_dir):
continue
if src.lower().startswith(sal_dir):
sources_include_sal = True
continue
2018-08-03 11:09:01 +08:00
if src.lower().startswith(RTT_ROOT.lower()):
target_list.append(src)
source_list = target_list
# get source directory
src_dir = []
for src in source_list:
src = src.replace(RTT_ROOT, '')
if src[0] == os.sep or src[0] == '/':
src = src[1:]
path = os.path.dirname(src)
sub_path = path.split(os.sep)
full_path = RTT_ROOT
for item in sub_path:
full_path = os.path.join(full_path, item)
if full_path not in src_dir:
src_dir.append(full_path)
# add all of SConscript files
for item in src_dir:
source_list.append(os.path.join(item, 'SConscript'))
# add all of Kconfig files
walk_kconfig(RTT_ROOT, source_list)
# copy all files to target directory
source_list.sort()
for src in source_list:
dst = src.replace(RTT_ROOT, '')
if dst[0] == os.sep or dst[0] == '/':
dst = dst[1:]
print('=> %s' % dst)
dst = os.path.join(target_path, dst)
do_copy_file(src, dst)
# copy tools directory
2018-08-03 11:51:52 +08:00
print('=> tools')
do_copy_folder(os.path.join(RTT_ROOT, 'tools'), os.path.join(target_path, 'tools'), ignore_patterns('*.pyc'))
2018-08-03 11:09:01 +08:00
do_copy_file(os.path.join(RTT_ROOT, 'Kconfig'), os.path.join(target_path, 'Kconfig'))
do_copy_file(os.path.join(RTT_ROOT, 'AUTHORS'), os.path.join(target_path, 'AUTHORS'))
do_copy_file(os.path.join(RTT_ROOT, 'COPYING'), os.path.join(target_path, 'COPYING'))
do_copy_file(os.path.join(RTT_ROOT, 'README.md'), os.path.join(target_path, 'README.md'))
do_copy_file(os.path.join(RTT_ROOT, 'README_zh.md'), os.path.join(target_path, 'README_zh.md'))
2018-08-03 16:29:13 +08:00
print('=> %s' % os.path.join('components', 'libc', 'compilers'))
do_copy_folder(os.path.join(RTT_ROOT, 'components', 'libc', 'compilers'), os.path.join(target_path, 'components', 'libc', 'compilers'))
2018-08-03 11:09:01 +08:00
if sources_include_sal:
print('=> %s' % os.path.join('components', 'net', 'sal_socket'))
do_copy_folder(os.path.join(RTT_ROOT, 'components', 'net', 'sal_socket'), os.path.join(target_path, 'components', 'net', 'sal_socket'))
2018-08-03 11:09:01 +08:00
# copy all libcpu/ARCH directory
import rtconfig
print('=> %s' % (os.path.join('libcpu', rtconfig.ARCH, rtconfig.CPU)))
2018-08-03 11:51:52 +08:00
do_copy_folder(os.path.join(RTT_ROOT, 'libcpu', rtconfig.ARCH, rtconfig.CPU), os.path.join(target_path, 'libcpu', rtconfig.ARCH, rtconfig.CPU))
if os.path.exists(os.path.join(RTT_ROOT, 'libcpu', rtconfig.ARCH, 'common')):
print('=> %s' % (os.path.join('libcpu', rtconfig.ARCH, 'common')))
2018-08-03 11:51:52 +08:00
do_copy_folder(os.path.join(RTT_ROOT, 'libcpu', rtconfig.ARCH, 'common'), os.path.join(target_path, 'libcpu', rtconfig.ARCH, 'common'))
2018-08-03 11:09:01 +08:00
do_copy_file(os.path.join(RTT_ROOT, 'libcpu', 'Kconfig'), os.path.join(target_path, 'libcpu', 'Kconfig'))
do_copy_file(os.path.join(RTT_ROOT, 'libcpu', 'SConscript'), os.path.join(target_path, 'libcpu', 'SConscript'))
# change RTT_ROOT in SConstruct
bsp_update_sconstruct(dist_dir)
# change RTT_ROOT in Kconfig
bsp_update_kconfig(dist_dir)
2018-12-13 10:56:09 +08:00
bsp_update_kconfig_library(dist_dir)
2018-08-03 11:09:01 +08:00
# update all project files
bs_update_ide_project(dist_dir, target_path)
# make zip package
zip_dist(dist_dir, dist_name)
2018-08-03 11:09:01 +08:00
print('done!')
2019-06-17 20:34:05 +08:00
def MkDist(program, BSP_ROOT, RTT_ROOT, Env, rttide = None):
2018-08-03 11:51:52 +08:00
print('make distribution....')
2017-11-04 17:39:45 +08:00
dist_name = os.path.basename(BSP_ROOT)
2019-06-17 20:34:05 +08:00
if rttide == None:
2019-06-17 20:34:05 +08:00
dist_dir = os.path.join(BSP_ROOT, 'dist', dist_name)
else:
dist_dir = rttide['project_path']
2017-11-04 17:39:45 +08:00
target_path = os.path.join(dist_dir, 'rt-thread')
2017-11-04 17:39:45 +08:00
# copy BSP files
2018-08-03 11:51:52 +08:00
print('=> %s' % os.path.basename(BSP_ROOT))
bsp_copy_files(BSP_ROOT, dist_dir)
2017-11-04 17:39:45 +08:00
2018-12-13 10:56:09 +08:00
# copy stm32 bsp libiary files
if os.path.basename(os.path.dirname(BSP_ROOT)) == 'stm32':
print("=> copy stm32 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, 'HAL_Drivers'), os.path.join(library_dir, 'HAL_Drivers'))
bsp_copy_files(os.path.join(library_path, Env['bsp_lib_type']), os.path.join(library_dir, Env['bsp_lib_type']))
shutil.copyfile(os.path.join(library_path, 'Kconfig'), os.path.join(library_dir, 'Kconfig'))
[BSP][Nuclei] Add Nuclei RISC-V Processor support * Nuclei RISC-V Processor support is added both RV32 and RV64 * Nuclei RVSTAR BSP is added, UART driver is added * MSH works well in RVSTAR board --------------------------- Squashed commit of the following: commit b7368bc2ed725c42f9adc297d0e9cf3ed706a520 Author: Huaqi Fang <578567190@qq.com> Date: Fri Apr 17 14:38:54 2020 +0800 [BSP][Nuclei] Pretty source code Signed-off-by: Huaqi Fang <578567190@qq.com> commit 2c42a997f7b5d8aa53bdaf19ccb30596091a112d Author: Huaqi Fang <578567190@qq.com> Date: Thu Apr 16 15:51:03 2020 +0800 [libcpu] Remove ARCH_NUCLEI in libcpu kconfig Signed-off-by: Huaqi Fang <578567190@qq.com> commit 915ad4c076ff3d7cebda896537605e7f7939b7af Author: Huaqi Fang <578567190@qq.com> Date: Thu Apr 16 15:50:00 2020 +0800 [BSP][Nuclei] Remove ARCH_NUCLEI in bsp KConfig Signed-off-by: Huaqi Fang <578567190@qq.com> commit fe43869c79675a25669447d57ea5d77385e07ca5 Author: Huaqi Fang <578567190@qq.com> Date: Wed Apr 15 12:43:20 2020 +0800 [BSP][NUCLEI] Simply application main.c Remove previous complicated application of gd32vf103_rvstar Signed-off-by: Huaqi Fang <578567190@qq.com> commit 8fd31727bc7ff51c83a3c47840cff1bfb100c0ba Author: Huaqi Fang <578567190@qq.com> Date: Wed Apr 15 12:38:04 2020 +0800 [BSP][NUCLEI] Format application and board source code Signed-off-by: Huaqi Fang <578567190@qq.com> commit b432308b20cdf24dfcc1398511d1d83bce6a9df2 Author: Huaqi Fang <578567190@qq.com> Date: Wed Apr 15 11:58:28 2020 +0800 [BSP][Nuclei] Format source code of drivers of gd32vf103 Signed-off-by: Huaqi Fang <578567190@qq.com> commit 7366173d749d8a51ed8d48eca09007d27aee8ad8 Author: Huaqi Fang <578567190@qq.com> Date: Wed Apr 15 11:54:02 2020 +0800 [LIBCPU][NUCLEI] Optimize nuclei cpu portable code Signed-off-by: Huaqi Fang <578567190@qq.com> commit 8c2cd4745b7279a6721946d119441bbf7fd1a9c2 Author: Huaqi Fang <578567190@qq.com> Date: Tue Apr 14 15:45:42 2020 +0800 nuclei: Update README.md Signed-off-by: Huaqi Fang <578567190@qq.com> commit fa8a2f24ea5e4dbce714ffda16c1ce558e5b5ddb Author: Huaqi Fang <578567190@qq.com> Date: Tue Apr 14 14:06:54 2020 +0800 nuclei: Add gpio driver not tested Signed-off-by: Huaqi Fang <578567190@qq.com> commit 1be40bc50be43dfcdd105291bd24355498f9fef3 Author: Huaqi Fang <578567190@qq.com> Date: Thu Apr 9 14:55:22 2020 +0800 Nuclei: Update README.md Signed-off-by: Huaqi Fang <578567190@qq.com> commit 4c8beb204b7ee3e38c04e1f23a1f7e4ce48aa196 Author: Huaqi Fang <578567190@qq.com> Date: Thu Apr 9 10:20:25 2020 +0800 Nuclei: Change idle stack size from 256 to 396 bytes If changed to 396 bytes, then debug optimization level changed from O2 to O0, and the application can run successfully without stack overflow issue of tidle0 task warning: tidle0 stack is close to end of stack address. Signed-off-by: Huaqi Fang <578567190@qq.com> commit da2bcf5c56ef32b611405a8e591ecd3f1e598b11 Author: Huaqi Fang <578567190@qq.com> Date: Thu Apr 9 10:11:40 2020 +0800 nuclei: Remove unused kconfig Signed-off-by: Huaqi Fang <578567190@qq.com> commit 0b932c677a7934d60e70da141744790aec202ef6 Author: Huaqi Fang <578567190@qq.com> Date: Thu Apr 9 09:32:22 2020 +0800 nuclei: optimize drivers support Signed-off-by: Huaqi Fang <578567190@qq.com> commit 0431f6f01f6efab2900de552abede83639415431 Author: Huaqi Fang <578567190@qq.com> Date: Wed Apr 8 19:28:02 2020 +0800 tools: Update mkdist.py for nuclei bsp Signed-off-by: Huaqi Fang <578567190@qq.com> commit 0e1f502edfddff93a4a66c041be68560ef4828eb Author: Huaqi Fang <578567190@qq.com> Date: Wed Apr 8 18:46:58 2020 +0800 nuclei: optimize rvstar support directory Signed-off-by: Huaqi Fang <578567190@qq.com> commit 1131f6e6483d8f2fbafe07f4e598fc8f802ee85d Author: Huaqi Fang <578567190@qq.com> Date: Wed Apr 8 18:37:24 2020 +0800 nuclei: update kconfig Signed-off-by: Huaqi Fang <578567190@qq.com> commit ad81c1d3bf9d80d2b561c94e903e7ce4ca2c68c6 Author: Huaqi Fang <578567190@qq.com> Date: Wed Apr 8 15:43:00 2020 +0800 nuclei: Rename board name Signed-off-by: Huaqi Fang <578567190@qq.com> commit d780138a1abf5da5097cc89e6a428ebeae06f284 Author: Huaqi Fang <578567190@qq.com> Date: Tue Apr 7 09:36:19 2020 +0800 libcpu: Add Nuclei arch option in KConfig Signed-off-by: Huaqi Fang <578567190@qq.com> commit 60320d34b1d88315efe1b566fd6bc75c69851f06 Author: Huaqi Fang <578567190@qq.com> Date: Fri Apr 3 16:51:01 2020 +0800 nuclei: Update nuclei sdk of rt-thread support Signed-off-by: Huaqi Fang <578567190@qq.com> commit a042b806efe0ea3bc9dba80ebc7696e5941ba35f Author: Huaqi Fang <578567190@qq.com> Date: Fri Apr 3 11:34:09 2020 +0800 nuclei: modify application for not print anything Signed-off-by: Huaqi Fang <578567190@qq.com> commit 2a9603adcb584b29886a2b93ded2473f4e8bffb1 Author: Huaqi Fang <578567190@qq.com> Date: Fri Apr 3 11:31:01 2020 +0800 nuclei: Add .gitignore for nuclei bsp Signed-off-by: Huaqi Fang <578567190@qq.com> commit 34aaf6aebae75c3ee9d38cc17e6bdb826ed9e357 Author: Huaqi Fang <578567190@qq.com> Date: Fri Apr 3 11:28:06 2020 +0800 nuclei_sdk: update link script of rvstar to contain rt-thread needed sections /* section information for finsh shell */ . = ALIGN(4); __fsymtab_start = .; KEEP(*(FSymTab)) __fsymtab_end = .; . = ALIGN(4); __vsymtab_start = .; KEEP(*(VSymTab)) __vsymtab_end = .; /* section information for initial. */ . = ALIGN(4); __rt_init_start = .; KEEP(*(SORT(.rti_fn*))) __rt_init_end = .; The above code placed in rodata section Signed-off-by: Huaqi Fang <578567190@qq.com> commit 3451466e9d8da3c3c8a631be69f3c7a5e6220c21 Author: Huaqi Fang <578567190@qq.com> Date: Fri Apr 3 10:04:42 2020 +0800 bsp: Add initial commit of nuclei rvstar board bsp Signed-off-by: Huaqi Fang <578567190@qq.com> Signed-off-by: Huaqi Fang <578567190@qq.com>
2020-04-17 21:07:29 +08:00
# 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
if 'dist_handle' in Env:
print("=> start dist handle")
dist_handle = Env['dist_handle']
dist_handle(BSP_ROOT)
# copy tools directory
2018-08-03 11:51:52 +08:00
print('=> components')
do_copy_folder(os.path.join(RTT_ROOT, 'components'), os.path.join(target_path, 'components'))
2017-11-04 17:39:45 +08:00
# skip documentation directory
# skip examples
2017-11-04 17:39:45 +08:00
# copy include directory
2018-08-03 11:51:52 +08:00
print('=> include')
do_copy_folder(os.path.join(RTT_ROOT, 'include'), os.path.join(target_path, 'include'))
2017-11-04 17:39:45 +08:00
# copy all libcpu/ARCH directory
print('=> libcpu')
import rtconfig
do_copy_folder(os.path.join(RTT_ROOT, 'libcpu', rtconfig.ARCH), os.path.join(target_path, 'libcpu', rtconfig.ARCH))
do_copy_file(os.path.join(RTT_ROOT, 'libcpu', 'Kconfig'), os.path.join(target_path, 'libcpu', 'Kconfig'))
do_copy_file(os.path.join(RTT_ROOT, 'libcpu', 'SConscript'), os.path.join(target_path, 'libcpu', 'SConscript'))
2017-11-04 17:39:45 +08:00
# copy src directory
2018-08-03 11:51:52 +08:00
print('=> src')
do_copy_folder(os.path.join(RTT_ROOT, 'src'), os.path.join(target_path, 'src'))
2017-11-04 17:39:45 +08:00
# copy tools directory
2018-08-03 11:51:52 +08:00
print('=> tools')
do_copy_folder(os.path.join(RTT_ROOT, 'tools'), os.path.join(target_path, 'tools'), ignore_patterns('*.pyc'))
do_copy_file(os.path.join(RTT_ROOT, 'Kconfig'), os.path.join(target_path, 'Kconfig'))
2017-11-04 17:39:45 +08:00
do_copy_file(os.path.join(RTT_ROOT, 'AUTHORS'), os.path.join(target_path, 'AUTHORS'))
do_copy_file(os.path.join(RTT_ROOT, 'COPYING'), os.path.join(target_path, 'COPYING'))
do_copy_file(os.path.join(RTT_ROOT, 'README.md'), os.path.join(target_path, 'README.md'))
do_copy_file(os.path.join(RTT_ROOT, 'README_zh.md'), os.path.join(target_path, 'README_zh.md'))
# change RTT_ROOT in SConstruct
bsp_update_sconstruct(dist_dir)
# change RTT_ROOT in Kconfig
bsp_update_kconfig(dist_dir)
2018-12-13 10:56:09 +08:00
bsp_update_kconfig_library(dist_dir)
2019-06-17 20:34:05 +08:00
# update all project files
if rttide == None:
2019-06-17 20:34:05 +08:00
bs_update_ide_project(dist_dir, target_path)
else:
bs_update_ide_project(dist_dir, target_path, rttide)
2017-11-04 17:39:45 +08:00
# make zip package
if rttide == None:
2019-06-17 20:34:05 +08:00
zip_dist(dist_dir, dist_name)
2017-11-04 17:39:45 +08:00
print('done!')
2018-08-03 11:09:01 +08:00