[BSP] Update building script
This commit is contained in:
parent
e8a6da95d4
commit
68a5e7d5a3
|
@ -3,7 +3,7 @@ import os
|
||||||
# toolchains options
|
# toolchains options
|
||||||
ARCH='arm'
|
ARCH='arm'
|
||||||
CPU='cortex-m4'
|
CPU='cortex-m4'
|
||||||
CROSS_TOOL='gcc'
|
CROSS_TOOL='keil'
|
||||||
|
|
||||||
if os.getenv('RTT_CC'):
|
if os.getenv('RTT_CC'):
|
||||||
CROSS_TOOL = os.getenv('RTT_CC')
|
CROSS_TOOL = os.getenv('RTT_CC')
|
||||||
|
@ -17,14 +17,13 @@ if CROSS_TOOL == 'gcc':
|
||||||
print 'Not support gcc yet!'
|
print 'Not support gcc yet!'
|
||||||
print '================================================='
|
print '================================================='
|
||||||
PLATFORM = 'gcc'
|
PLATFORM = 'gcc'
|
||||||
exit(0)
|
|
||||||
elif CROSS_TOOL == 'keil':
|
elif CROSS_TOOL == 'keil':
|
||||||
PLATFORM = 'armcc'
|
PLATFORM = 'armcc'
|
||||||
EXEC_PATH = r'C:/Keil_v5'
|
EXEC_PATH = r'C:/Keil_v5'
|
||||||
elif CROSS_TOOL == 'iar':
|
elif CROSS_TOOL == 'iar':
|
||||||
PLATFORM = 'iar'
|
PLATFORM = 'iar'
|
||||||
EXEC_PATH = r'C:/Program Files (x86)/IAR Systems/Embedded Workbench 8.0'
|
EXEC_PATH = r'C:/Program Files (x86)/IAR Systems/Embedded Workbench 8.0'
|
||||||
|
|
||||||
if os.getenv('RTT_EXEC_PATH'):
|
if os.getenv('RTT_EXEC_PATH'):
|
||||||
EXEC_PATH = os.getenv('RTT_EXEC_PATH')
|
EXEC_PATH = os.getenv('RTT_EXEC_PATH')
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ TARGET = 'rtthread-imx6.' + rtconfig.TARGET_EXT
|
||||||
env = Environment(tools = ['mingw'],
|
env = Environment(tools = ['mingw'],
|
||||||
AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
|
AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
|
||||||
CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS,
|
CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS,
|
||||||
CXX= rtconfig.CXX, CXXFLAGS = rtconfig.CFLAGS,
|
CXX= rtconfig.CXX, CXXFLAGS = rtconfig.CFLAGS,
|
||||||
AR = rtconfig.AR, ARFLAGS = '-rc',
|
AR = rtconfig.AR, ARFLAGS = '-rc',
|
||||||
LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS)
|
LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS)
|
||||||
env.PrependENVPath('PATH', rtconfig.EXEC_PATH)
|
env.PrependENVPath('PATH', rtconfig.EXEC_PATH)
|
||||||
|
|
|
@ -8,8 +8,7 @@ if os.getenv('RTT_ROOT'):
|
||||||
else:
|
else:
|
||||||
#RTT_ROOT = os.path.join(Dir('#').get_abspath(), 'rt-thread')
|
#RTT_ROOT = os.path.join(Dir('#').get_abspath(), 'rt-thread')
|
||||||
RTT_ROOT = os.path.normpath(os.getcwd() + '/../..')
|
RTT_ROOT = os.path.normpath(os.getcwd() + '/../..')
|
||||||
print RTT_ROOT
|
|
||||||
|
|
||||||
sys.path = sys.path + [os.path.join(RTT_ROOT, 'tools')]
|
sys.path = sys.path + [os.path.join(RTT_ROOT, 'tools')]
|
||||||
from building import *
|
from building import *
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ CROSS_TOOL = 'keil'
|
||||||
if os.getenv('RTT_CC'):
|
if os.getenv('RTT_CC'):
|
||||||
CROSS_TOOL = os.getenv('RTT_CC')
|
CROSS_TOOL = os.getenv('RTT_CC')
|
||||||
|
|
||||||
if CROSS_TOOL == 'gcc':
|
if CROSS_TOOL == 'gcc':
|
||||||
print '================ERROR============================'
|
print '================ERROR============================'
|
||||||
print 'Not support gcc yet!'
|
print 'Not support gcc yet!'
|
||||||
print '================================================='
|
print '================================================='
|
||||||
|
|
|
@ -226,7 +226,7 @@ def MDK45Project(tree, target, script):
|
||||||
if CPPDEFINES:
|
if CPPDEFINES:
|
||||||
CPPDEFINES += group['CPPDEFINES']
|
CPPDEFINES += group['CPPDEFINES']
|
||||||
else:
|
else:
|
||||||
CPPDEFINES += group['CPPDEFINES']
|
CPPDEFINES = group['CPPDEFINES']
|
||||||
|
|
||||||
# get each group's link flags
|
# get each group's link flags
|
||||||
if group.has_key('LINKFLAGS') and group['LINKFLAGS']:
|
if group.has_key('LINKFLAGS') and group['LINKFLAGS']:
|
||||||
|
@ -332,9 +332,9 @@ def MDKProject(target, script):
|
||||||
# get each group's definitions
|
# get each group's definitions
|
||||||
if group.has_key('CPPDEFINES') and group['CPPDEFINES']:
|
if group.has_key('CPPDEFINES') and group['CPPDEFINES']:
|
||||||
if CPPDEFINES:
|
if CPPDEFINES:
|
||||||
CPPDEFINES += ';' + group['CPPDEFINES']
|
|
||||||
else:
|
|
||||||
CPPDEFINES += group['CPPDEFINES']
|
CPPDEFINES += group['CPPDEFINES']
|
||||||
|
else:
|
||||||
|
CPPDEFINES = group['CPPDEFINES']
|
||||||
|
|
||||||
# get each group's link flags
|
# get each group's link flags
|
||||||
if group.has_key('LINKFLAGS') and group['LINKFLAGS']:
|
if group.has_key('LINKFLAGS') and group['LINKFLAGS']:
|
||||||
|
|
Loading…
Reference in New Issue