18
building.py
18
building.py
@@ -143,13 +143,14 @@ def GenCconfigFile(env, BuildOptions):
|
||||
# add HAVE_CCONFIG_H definition
|
||||
env.AppendUnique(CPPDEFINES = ['HAVE_CCONFIG_H'])
|
||||
|
||||
def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = [], rtt_cfg = 'rtconfig.h'):
|
||||
def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = [], rtt_cfg = 'rtconfig.h', rtt_tools = ''):
|
||||
import rtconfig
|
||||
|
||||
global BuildOptions
|
||||
global Projects
|
||||
global Env
|
||||
global Rtt_Root
|
||||
global Rtt_Tool
|
||||
|
||||
# ===== Add option to SCons =====
|
||||
AddOption('--dist',
|
||||
@@ -241,7 +242,12 @@ def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = [
|
||||
# set BSP_ROOT in ENV
|
||||
Env['BSP_ROOT'] = Dir('#').abspath
|
||||
|
||||
sys.path = sys.path + [os.path.join(Rtt_Root, 'tools')]
|
||||
if rtt_tools == '':
|
||||
Rtt_Tool = os.path.join(Rtt_Root, '..', 'rtt_tools')
|
||||
else:
|
||||
Rtt_Tool = rtt_tools
|
||||
|
||||
sys.path = sys.path + [Rtt_Tool]
|
||||
|
||||
# {target_name:(CROSS_TOOL, PLATFORM)}
|
||||
tgt_dict = {'mdk':('keil', 'armcc'),
|
||||
@@ -379,7 +385,7 @@ def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = [
|
||||
help = 'make menuconfig for RT-Thread BSP')
|
||||
if GetOption('menuconfig'):
|
||||
from menuconfig import menuconfig
|
||||
menuconfig(Rtt_Root)
|
||||
menuconfig(Rtt_Tool, rtt_cfg)
|
||||
exit(0)
|
||||
|
||||
AddOption('--pyconfig',
|
||||
@@ -396,18 +402,18 @@ def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = [
|
||||
if GetOption('pyconfig_silent'):
|
||||
from menuconfig import guiconfig_silent
|
||||
|
||||
guiconfig_silent(Rtt_Root)
|
||||
guiconfig_silent(Rtt_Tool, rtt_cfg)
|
||||
exit(0)
|
||||
elif GetOption('pyconfig'):
|
||||
from menuconfig import guiconfig
|
||||
|
||||
guiconfig(Rtt_Root)
|
||||
guiconfig(Rtt_Tool, rtt_cfg)
|
||||
exit(0)
|
||||
|
||||
configfn = GetOption('useconfig')
|
||||
if configfn:
|
||||
from menuconfig import mk_rtconfig
|
||||
mk_rtconfig(configfn)
|
||||
mk_rtconfig(configfn, rtt_cfg)
|
||||
exit(0)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user