update building script for jz47xx.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1295 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
parent
c217af8061
commit
338155eddc
|
@ -1,29 +1,12 @@
|
|||
Import('env')
|
||||
Import('projects')
|
||||
import rtconfig
|
||||
Import('RTT_ROOT')
|
||||
Import('rtconfig')
|
||||
|
||||
# group definitions
|
||||
group = {}
|
||||
group['name'] = 'Startup'
|
||||
group['CCFLAGS'] = ''
|
||||
group['CPPPATH'] = [RTT_ROOT + '/bsp/jz47xx']
|
||||
group['CPPDEFINES'] = []
|
||||
group['LINKFLAGS'] = ''
|
||||
from building import *
|
||||
|
||||
src_bsp = ['application.c', 'startup.c', 'board.c']
|
||||
src_drv = ['uart.c']
|
||||
|
||||
group['src'] = File(src_bsp + src_drv)
|
||||
src = File(src_bsp + src_drv)
|
||||
CPPPATH = Dir('#')
|
||||
group = DefineGroup('Startup', src, depend = [''], CPPPATH = CPPPATH)
|
||||
|
||||
# add group to project list
|
||||
projects.append(group)
|
||||
|
||||
env.Append(CCFLAGS = group['CCFLAGS'])
|
||||
env.Append(CPPPATH = group['CPPPATH'])
|
||||
env.Append(CPPDEFINES = group['CPPDEFINES'])
|
||||
env.Append(LINKFLAGS = group['LINKFLAGS'])
|
||||
|
||||
obj = env.Object(group['src'])
|
||||
|
||||
Return('obj')
|
||||
Return('group')
|
||||
|
|
|
@ -2,12 +2,15 @@ import os
|
|||
import sys
|
||||
import rtconfig
|
||||
|
||||
RTT_ROOT = os.path.normpath(os.getcwd() + '/../..')
|
||||
sys.path = sys.path + [os.path.join(RTT_ROOT, 'tools')]
|
||||
import mdk
|
||||
if os.getenv('RTT_ROOT'):
|
||||
RTT_ROOT = os.getenv('RTT_ROOT')
|
||||
else:
|
||||
RTT_ROOT = os.path.normpath(os.getcwd() + '/../..')
|
||||
|
||||
target = 'rtthread-jz47xx'
|
||||
projects = []
|
||||
sys.path = sys.path + [os.path.join(RTT_ROOT, 'tools')]
|
||||
from building import *
|
||||
|
||||
TARGET = 'rtthread-jz47xx.' + rtconfig.TARGET_EXT
|
||||
|
||||
env = Environment(tools = ['mingw'],
|
||||
AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
|
||||
|
@ -16,23 +19,14 @@ env = Environment(tools = ['mingw'],
|
|||
LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS)
|
||||
env.PrependENVPath('PATH', rtconfig.EXEC_PATH)
|
||||
|
||||
Export('env')
|
||||
Export('RTT_ROOT')
|
||||
Export('rtconfig')
|
||||
Export('projects')
|
||||
|
||||
# kernel building script
|
||||
objs = SConscript(RTT_ROOT + '/src/SConscript', variant_dir='build/src', duplicate=0)
|
||||
# arch building script
|
||||
objs = objs + SConscript(RTT_ROOT + '/libcpu/SConscript', variant_dir='build/libcpu', duplicate=0)
|
||||
# prepare building environment
|
||||
objs = PrepareBuilding(env, RTT_ROOT)
|
||||
|
||||
# component script
|
||||
Repository(RTT_ROOT)
|
||||
objs = objs + SConscript('components/SConscript')
|
||||
|
||||
# board build script
|
||||
objs = objs + SConscript('SConscript', variant_dir='build/bsp', duplicate=0)
|
||||
|
||||
TARGET = target + '.' + rtconfig.TARGET_EXT
|
||||
# build program
|
||||
env.Program(TARGET, objs)
|
||||
env.AddPostAction(TARGET, rtconfig.POST_ACTION)
|
||||
|
||||
# end building
|
||||
EndBuilding(TARGET)
|
||||
|
|
|
@ -1,56 +1,6 @@
|
|||
import SCons.cpp
|
||||
|
||||
# component options
|
||||
|
||||
# make all component false
|
||||
RT_USING_FINSH = False
|
||||
RT_USING_DFS = False
|
||||
RT_USING_DFS_ELMFAT = False
|
||||
RT_USING_DFS_YAFFS2 = False
|
||||
RT_USING_LWIP = False
|
||||
RT_USING_WEBSERVER = False
|
||||
RT_USING_RTGUI = False
|
||||
RT_USING_MODULE = False
|
||||
|
||||
# parse rtconfig.h to get used component
|
||||
PreProcessor = SCons.cpp.PreProcessor()
|
||||
f = file('rtconfig.h', 'r')
|
||||
contents = f.read()
|
||||
f.close()
|
||||
PreProcessor.process_contents(contents)
|
||||
rtconfig_ns = PreProcessor.cpp_namespace
|
||||
|
||||
# finsh shell options
|
||||
if rtconfig_ns.has_key('RT_USING_FINSH'):
|
||||
RT_USING_FINSH = True
|
||||
|
||||
# device virtual filesystem options
|
||||
if rtconfig_ns.has_key('RT_USING_DFS'):
|
||||
RT_USING_DFS = True
|
||||
|
||||
if rtconfig_ns.has_key('RT_USING_DFS_ELMFAT'):
|
||||
RT_USING_DFS_ELMFAT = True
|
||||
if rtconfig_ns.has_key('RT_USING_DFS_YAFFS2'):
|
||||
RT_USING_DFS_YAFFS2 = True
|
||||
|
||||
# lwip options
|
||||
if rtconfig_ns.has_key('RT_USING_LWIP'):
|
||||
RT_USING_LWIP = True
|
||||
if rtconfig_ns.has_key('RT_USING_WEBSERVER'):
|
||||
RT_USING_WEBSERVER = True
|
||||
|
||||
# rtgui options
|
||||
if rtconfig_ns.has_key('RT_USING_RTGUI'):
|
||||
RT_USING_RTGUI = True
|
||||
|
||||
# module options
|
||||
if rtconfig_ns.has_key('RT_USING_MODULE'):
|
||||
RT_USING_MODULE = True
|
||||
|
||||
# toolchains options
|
||||
ARCH='mips'
|
||||
CPU='jz47xx'
|
||||
|
||||
ARCH = 'mips'
|
||||
CPU = 'jz47xx'
|
||||
CROSS_TOOL = 'gcc'
|
||||
PLATFORM = 'gcc'
|
||||
EXEC_PATH = 'E:/Program Files/CodeSourcery/Sourcery G++ Lite/bin'
|
||||
|
|
Loading…
Reference in New Issue