cleanup scons building script

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1065 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
bernard.xiong@gmail.com 2010-11-20 12:31:00 +00:00
parent 2fce1a91e2
commit 10732a76e9
36 changed files with 716 additions and 1010 deletions

View File

@ -1,29 +1,10 @@
Import('env')
Import('projects')
Import('RTT_ROOT')
Import('rtconfig')
from building import *
# group definitions
group = {}
group['name'] = 'Startup'
group['CCFLAGS'] = ''
group['CPPPATH'] = [RTT_ROOT + '/bsp/dev3210']
group['CPPDEFINES'] = []
group['LINKFLAGS'] = ''
src_bsp = ['application.c', 'startup.c', 'board.c']
src_drv = ['uart.c', 'lnn800x480.c']
src = File(src_bsp + src_drv)
CPPPATH = [RTT_ROOT + '/bsp/dev3210']
group = DefineGroup('Startup', src, depend = [''], CPPPATH = CPPPATH)
src_bsp = ['application.c', 'startup.c', 'board.c']
src_drv = ['uart.c', 'lnn800x480.c']
group['src'] = File(src_bsp + src_drv)
# 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')

View File

@ -4,9 +4,9 @@ import rtconfig
RTT_ROOT = os.path.normpath(os.getcwd() + '/../..')
sys.path = sys.path + [os.path.join(RTT_ROOT, 'tools')]
from building import *
target = 'rtthread'
projects = []
TARGET = 'rtthread.' + rtconfig.TARGET_EXT
env = Environment(tools = ['mingw'],
AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
@ -15,26 +15,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)
if rtconfig.RT_USING_RTGUI:
objs = objs + SConscript(RTT_ROOT + '/examples/gui/SConscript', variant_dir='build/examples/gui', duplicate=0)
TARGET = target + '.' + rtconfig.TARGET_EXT
# build program
env.Program(TARGET, objs)
env.AddPostAction(TARGET, rtconfig.POST_ACTION)
# end building
EndBuilding(TARGET)

View File

@ -1,61 +1,12 @@
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
# CPU options
ARCH='mips'
CPU ='loongson'
# toolchains options
CROSS_TOOL = 'gcc'
PLATFORM = 'gcc'
EXEC_PATH = 'E:/Program Files/CodeSourcery/Sourcery G++ Lite/bin'
BUILD = 'debug'
PLATFORM = 'gcc'
EXEC_PATH = 'E:/Program Files/CodeSourcery/Sourcery G++ Lite/bin'
BUILD = 'debug'
PREFIX = 'mips-sde-elf-'
CC = PREFIX + 'gcc'
@ -77,12 +28,11 @@ CPATH = ''
LPATH = ''
if BUILD == 'debug':
CFLAGS += ' -O0 -gdwarf-2'
AFLAGS += ' -gdwarf-2'
CFLAGS += ' -O0 -gdwarf-2'
AFLAGS += ' -gdwarf-2'
else:
CFLAGS += ' -O2'
CFLAGS += ' -O2'
RT_USING_MINILIBC = True
DUMP_ACTION = OBJDUMP + ' -D -S $TARGET > rtt.asm\n'
READELF_ACTION = READELF + ' -a $TARGET > rtt.map\n'
POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n' + READELF_ACTION
POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n'

View File

@ -1,36 +1,19 @@
Import('env')
Import('projects')
import rtconfig
Import('RTT_ROOT')
Import('rtconfig')
# group definitions
group = {}
group['name'] = 'Startup'
group['CCFLAGS'] = ''
group['CPPPATH'] = [ RTT_ROOT + '/bsp/lpc176x/CMSIS/CM3/CoreSupport', RTT_ROOT + '/bsp/lpc176x/CMSIS/CM3/DeviceSupport/NXP/LPC17xx',RTT_ROOT + '/bsp/lpc176x']
group['CPPDEFINES'] = []
group['LINKFLAGS'] = ''
from building import *
src_bsp = ['application.c', 'startup.c', 'board.c']
src_drv = ['uart.c', 'led.c']
src_cmsis = ['CMSIS/CM3/CoreSupport/core_cm3.c', 'CMSIS/CM3/DeviceSupport/NXP/LPC17xx/system_LPC17xx.c']
if rtconfig.RT_USING_DFS:
if GetDepend('RT_USING_DFS'):
src_drv += ['sd.c', 'spi.c']
if rtconfig.RT_USING_LWIP:
if GetDepend('RT_USING_LWIP'):
src_drv += ['emac.c']
group['src'] = File(src_bsp + src_drv + src_cmsis)
src = File(src_bsp + src_drv + src_cmsis)
CPPPATH = [ RTT_ROOT + '/bsp/lpc176x/CMSIS/CM3/CoreSupport', RTT_ROOT + '/bsp/lpc176x/CMSIS/CM3/DeviceSupport/NXP/LPC17xx',RTT_ROOT + '/bsp/lpc176x']
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')

View File

@ -4,18 +4,9 @@ import rtconfig
RTT_ROOT = os.path.normpath(os.getcwd() + '/../..')
sys.path = sys.path + [os.path.join(RTT_ROOT, 'tools')]
import mdk
from building import *
target = 'rtthread-lpc176x'
projects = []
AddOption('--target',
dest='target',
type='string',
help='set target project: mdk')
if GetOption('target'):
SetOption('no_exec', 1)
TARGET = 'rtthread-lpc176x.' + rtconfig.TARGET_EXT
env = Environment(tools = ['mingw'],
AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
@ -24,26 +15,23 @@ 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')
if GetDepend('RT_USING_WEBSERVER'):
objs = objs + SConscript(RTT_ROOT + '/components/net/webserver/SConscript', variant_dir='build/net/webserver', duplicate=0)
# board build script
objs = objs + SConscript('SConscript', variant_dir='build/bsp', duplicate=0)
if GetDepend('RT_USING_RTGUI'):
objs = objs + SConscript(RTT_ROOT + '/examples/gui/SConscript', variant_dir='build/examples/gui', duplicate=0)
TARGET = target + '.' + rtconfig.TARGET_EXT
# libc testsuite
# objs = objs + SConscript(RTT_ROOT + '/examples/libc/SConscript', variant_dir='build/examples/libc', duplicate=0)
# build program
env.Program(TARGET, objs)
env.AddPostAction(TARGET, rtconfig.POST_ACTION)
if GetOption('target') == 'mdk':
mdk.MDKProject('project.uV2', projects)
# end building
EndBuilding(TARGET)

View File

@ -3,124 +3,121 @@
Target (RT-Thread LPC17xx), 0x0004 // Tools: 'ARM-ADS'
Group (Startup)
Group (Kernel)
Group (LPC17XX)
Group (finsh)
Group (Filesystem)
Group (finsh)
Group (LwIP)
Group (Startup)
File 1,1,<..\..\src\clock.c><clock.c>
File 1,1,<..\..\src\device.c><device.c>
File 1,1,<..\..\src\idle.c><idle.c>
File 1,1,<..\..\src\ipc.c><ipc.c>
File 1,1,<..\..\src\irq.c><irq.c>
File 1,1,<..\..\src\kservice.c><kservice.c>
File 1,1,<..\..\src\mem.c><mem.c>
File 1,1,<..\..\src\mempool.c><mempool.c>
File 1,1,<..\..\src\module.c><module.c>
File 1,1,<..\..\src\object.c><object.c>
File 1,1,<..\..\src\rtm.c><rtm.c>
File 1,1,<..\..\src\scheduler.c><scheduler.c>
File 1,1,<..\..\src\slab.c><slab.c>
File 1,1,<..\..\src\thread.c><thread.c>
File 1,1,<..\..\src\timer.c><timer.c>
File 2,1,<..\..\libcpu\arm\lpc17xx\cpu.c><cpu.c>
File 2,1,<..\..\libcpu\arm\lpc17xx\fault.c><fault.c>
File 2,1,<..\..\libcpu\arm\lpc17xx\interrupt.c><interrupt.c>
File 2,1,<..\..\libcpu\arm\lpc17xx\stack.c><stack.c>
File 2,2,<..\..\libcpu\arm\lpc17xx\context_rvds.S><context_rvds.S>
File 2,2,<..\..\libcpu\arm\lpc17xx\fault_rvds.S><fault_rvds.S>
File 2,2,<..\..\libcpu\arm\lpc17xx\start_rvds.S><start_rvds.S>
File 2,1,<..\..\libcpu\arm\common\backtrace.c><backtrace.c>
File 2,1,<..\..\libcpu\arm\common\div0.c><div0.c>
File 2,1,<..\..\libcpu\arm\common\showmem.c><showmem.c>
File 3,1,<..\..\components\finsh\cmd.c><cmd.c>
File 3,1,<..\..\components\finsh\finsh_compiler.c><finsh_compiler.c>
File 3,1,<..\..\components\finsh\finsh_error.c><finsh_error.c>
File 3,1,<..\..\components\finsh\finsh_heap.c><finsh_heap.c>
File 3,1,<..\..\components\finsh\finsh_init.c><finsh_init.c>
File 3,1,<..\..\components\finsh\finsh_node.c><finsh_node.c>
File 3,1,<..\..\components\finsh\finsh_ops.c><finsh_ops.c>
File 3,1,<..\..\components\finsh\finsh_parser.c><finsh_parser.c>
File 3,1,<..\..\components\finsh\finsh_token.c><finsh_token.c>
File 3,1,<..\..\components\finsh\finsh_var.c><finsh_var.c>
File 3,1,<..\..\components\finsh\finsh_vm.c><finsh_vm.c>
File 3,1,<..\..\components\finsh\shell.c><shell.c>
File 3,1,<..\..\components\finsh\symbol.c><symbol.c>
File 1,1,<.\application.c><application.c>
File 1,1,<.\startup.c><startup.c>
File 1,1,<.\board.c><board.c>
File 1,1,<.\uart.c><uart.c>
File 1,1,<.\led.c><led.c>
File 1,1,<.\sd.c><sd.c>
File 1,1,<.\spi.c><spi.c>
File 1,1,<.\emac.c><emac.c>
File 1,1,<CMSIS\CM3\CoreSupport\core_cm3.c><core_cm3.c>
File 1,1,<CMSIS\CM3\DeviceSupport\NXP\LPC17xx\system_LPC17xx.c><system_LPC17xx.c>
File 2,1,<..\..\src\clock.c><clock.c>
File 2,1,<..\..\src\device.c><device.c>
File 2,1,<..\..\src\idle.c><idle.c>
File 2,1,<..\..\src\ipc.c><ipc.c>
File 2,1,<..\..\src\irq.c><irq.c>
File 2,1,<..\..\src\kservice.c><kservice.c>
File 2,1,<..\..\src\mem.c><mem.c>
File 2,1,<..\..\src\mempool.c><mempool.c>
File 2,1,<..\..\src\module.c><module.c>
File 2,1,<..\..\src\object.c><object.c>
File 2,1,<..\..\src\rtm.c><rtm.c>
File 2,1,<..\..\src\scheduler.c><scheduler.c>
File 2,1,<..\..\src\slab.c><slab.c>
File 2,1,<..\..\src\thread.c><thread.c>
File 2,1,<..\..\src\timer.c><timer.c>
File 3,1,<..\..\libcpu\arm\lpc17xx\cpu.c><cpu.c>
File 3,1,<..\..\libcpu\arm\lpc17xx\fault.c><fault.c>
File 3,1,<..\..\libcpu\arm\lpc17xx\interrupt.c><interrupt.c>
File 3,1,<..\..\libcpu\arm\lpc17xx\stack.c><stack.c>
File 3,2,<..\..\libcpu\arm\lpc17xx\context_rvds.S><context_rvds.S>
File 3,2,<..\..\libcpu\arm\lpc17xx\fault_rvds.S><fault_rvds.S>
File 3,2,<..\..\libcpu\arm\lpc17xx\start_rvds.S><start_rvds.S>
File 3,1,<..\..\libcpu\arm\common\backtrace.c><backtrace.c>
File 3,1,<..\..\libcpu\arm\common\div0.c><div0.c>
File 3,1,<..\..\libcpu\arm\common\showmem.c><showmem.c>
File 4,1,<..\..\components\dfs\src\dfs.c><dfs.c>
File 4,1,<..\..\components\dfs\src\dfs_fs.c><dfs_fs.c>
File 4,1,<..\..\components\dfs\src\dfs_init.c><dfs_init.c>
File 4,1,<..\..\components\dfs\src\dfs_file.c><dfs_file.c>
File 4,1,<..\..\components\dfs\src\dfs_posix.c><dfs_posix.c>
File 4,1,<..\..\components\dfs\src\dfs_raw.c><dfs_raw.c>
File 4,1,<..\..\components\dfs\src\dfs_util.c><dfs_util.c>
File 4,1,<..\..\components\dfs\filesystems\elmfat\dfs_elm.c><dfs_elm.c>
File 4,1,<..\..\components\dfs\filesystems\elmfat\ff.c><ff.c>
File 5,1,<..\..\components\net\lwip\src\api\api_lib.c><api_lib.c>
File 5,1,<..\..\components\net\lwip\src\api\api_msg.c><api_msg.c>
File 5,1,<..\..\components\net\lwip\src\api\err.c><err.c>
File 5,1,<..\..\components\net\lwip\src\api\netbuf.c><netbuf.c>
File 5,1,<..\..\components\net\lwip\src\api\netdb.c><netdb.c>
File 5,1,<..\..\components\net\lwip\src\api\netifapi.c><netifapi.c>
File 5,1,<..\..\components\net\lwip\src\api\sockets.c><sockets.c>
File 5,1,<..\..\components\net\lwip\src\api\tcpip.c><tcpip.c>
File 5,1,<..\..\components\net\lwip\src\arch\sys_arch.c><sys_arch.c>
File 5,1,<..\..\components\net\lwip\src\arch\sys_arch_init.c><sys_arch_init.c>
File 5,1,<..\..\components\net\lwip\src\core\dhcp.c><dhcp.c>
File 5,1,<..\..\components\net\lwip\src\core\dns.c><dns.c>
File 5,1,<..\..\components\net\lwip\src\core\init.c><init.c>
File 5,1,<..\..\components\net\lwip\src\core\memp.c><memp.c>
File 5,1,<..\..\components\net\lwip\src\core\netif.c><netif.c>
File 5,1,<..\..\components\net\lwip\src\core\pbuf.c><pbuf.c>
File 5,1,<..\..\components\net\lwip\src\core\raw.c><raw.c>
File 5,1,<..\..\components\net\lwip\src\core\stats.c><stats.c>
File 5,1,<..\..\components\net\lwip\src\core\sys.c><sys.c>
File 5,1,<..\..\components\net\lwip\src\core\tcp.c><tcp.c>
File 5,1,<..\..\components\net\lwip\src\core\tcp_in.c><tcp_in.c>
File 5,1,<..\..\components\net\lwip\src\core\tcp_out.c><tcp_out.c>
File 5,1,<..\..\components\net\lwip\src\core\udp.c><udp.c>
File 5,1,<..\..\components\net\lwip\src\core\ipv4\autoip.c><autoip.c>
File 5,1,<..\..\components\net\lwip\src\core\ipv4\icmp.c><icmp.c>
File 5,1,<..\..\components\net\lwip\src\core\ipv4\igmp.c><igmp.c>
File 5,1,<..\..\components\net\lwip\src\core\ipv4\inet.c><inet.c>
File 5,1,<..\..\components\net\lwip\src\core\ipv4\inet_chksum.c><inet_chksum.c>
File 5,1,<..\..\components\net\lwip\src\core\ipv4\ip.c><ip.c>
File 5,1,<..\..\components\net\lwip\src\core\ipv4\ip_addr.c><ip_addr.c>
File 5,1,<..\..\components\net\lwip\src\core\ipv4\ip_frag.c><ip_frag.c>
File 5,1,<..\..\components\net\lwip\src\core\snmp\asn1_dec.c><asn1_dec.c>
File 5,1,<..\..\components\net\lwip\src\core\snmp\asn1_enc.c><asn1_enc.c>
File 5,1,<..\..\components\net\lwip\src\core\snmp\mib2.c><mib2.c>
File 5,1,<..\..\components\net\lwip\src\core\snmp\mib_structs.c><mib_structs.c>
File 5,1,<..\..\components\net\lwip\src\core\snmp\msg_in.c><msg_in.c>
File 5,1,<..\..\components\net\lwip\src\core\snmp\msg_out.c><msg_out.c>
File 5,1,<..\..\components\net\lwip\src\netif\etharp.c><etharp.c>
File 5,1,<..\..\components\net\lwip\src\netif\ethernetif.c><ethernetif.c>
File 5,1,<..\..\components\net\lwip\src\netif\loopif.c><loopif.c>
File 5,1,<..\..\components\net\lwip\src\netif\slipif.c><slipif.c>
File 5,1,<..\..\components\net\lwip\src\netif\ppp\auth.c><auth.c>
File 5,1,<..\..\components\net\lwip\src\netif\ppp\chap.c><chap.c>
File 5,1,<..\..\components\net\lwip\src\netif\ppp\chpms.c><chpms.c>
File 5,1,<..\..\components\net\lwip\src\netif\ppp\fsm.c><fsm.c>
File 5,1,<..\..\components\net\lwip\src\netif\ppp\ipcp.c><ipcp.c>
File 5,1,<..\..\components\net\lwip\src\netif\ppp\lcp.c><lcp.c>
File 5,1,<..\..\components\net\lwip\src\netif\ppp\magic.c><magic.c>
File 5,1,<..\..\components\net\lwip\src\netif\ppp\md5.c><md5.c>
File 5,1,<..\..\components\net\lwip\src\netif\ppp\pap.c><pap.c>
File 5,1,<..\..\components\net\lwip\src\netif\ppp\ppp.c><ppp.c>
File 5,1,<..\..\components\net\lwip\src\netif\ppp\ppp_oe.c><ppp_oe.c>
File 5,1,<..\..\components\net\lwip\src\netif\ppp\randm.c><randm.c>
File 5,1,<..\..\components\net\lwip\src\netif\ppp\vj.c><vj.c>
File 6,1,<.\application.c><application.c>
File 6,1,<.\startup.c><startup.c>
File 6,1,<.\board.c><board.c>
File 6,1,<.\uart.c><uart.c>
File 6,1,<.\led.c><led.c>
File 6,1,<.\sd.c><sd.c>
File 6,1,<.\spi.c><spi.c>
File 6,1,<.\emac.c><emac.c>
File 6,1,<CMSIS\CM3\CoreSupport\core_cm3.c><core_cm3.c>
File 6,1,<CMSIS\CM3\DeviceSupport\NXP\LPC17xx\system_LPC17xx.c><system_LPC17xx.c>
File 5,1,<..\..\components\finsh\cmd.c><cmd.c>
File 5,1,<..\..\components\finsh\finsh_compiler.c><finsh_compiler.c>
File 5,1,<..\..\components\finsh\finsh_error.c><finsh_error.c>
File 5,1,<..\..\components\finsh\finsh_heap.c><finsh_heap.c>
File 5,1,<..\..\components\finsh\finsh_init.c><finsh_init.c>
File 5,1,<..\..\components\finsh\finsh_node.c><finsh_node.c>
File 5,1,<..\..\components\finsh\finsh_ops.c><finsh_ops.c>
File 5,1,<..\..\components\finsh\finsh_parser.c><finsh_parser.c>
File 5,1,<..\..\components\finsh\finsh_token.c><finsh_token.c>
File 5,1,<..\..\components\finsh\finsh_var.c><finsh_var.c>
File 5,1,<..\..\components\finsh\finsh_vm.c><finsh_vm.c>
File 5,1,<..\..\components\finsh\shell.c><shell.c>
File 5,1,<..\..\components\finsh\symbol.c><symbol.c>
File 6,1,<..\..\components\net\lwip\src\api\api_lib.c><api_lib.c>
File 6,1,<..\..\components\net\lwip\src\api\api_msg.c><api_msg.c>
File 6,1,<..\..\components\net\lwip\src\api\err.c><err.c>
File 6,1,<..\..\components\net\lwip\src\api\netbuf.c><netbuf.c>
File 6,1,<..\..\components\net\lwip\src\api\netdb.c><netdb.c>
File 6,1,<..\..\components\net\lwip\src\api\netifapi.c><netifapi.c>
File 6,1,<..\..\components\net\lwip\src\api\sockets.c><sockets.c>
File 6,1,<..\..\components\net\lwip\src\api\tcpip.c><tcpip.c>
File 6,1,<..\..\components\net\lwip\src\arch\sys_arch.c><sys_arch.c>
File 6,1,<..\..\components\net\lwip\src\arch\sys_arch_init.c><sys_arch_init.c>
File 6,1,<..\..\components\net\lwip\src\core\dhcp.c><dhcp.c>
File 6,1,<..\..\components\net\lwip\src\core\dns.c><dns.c>
File 6,1,<..\..\components\net\lwip\src\core\init.c><init.c>
File 6,1,<..\..\components\net\lwip\src\core\memp.c><memp.c>
File 6,1,<..\..\components\net\lwip\src\core\netif.c><netif.c>
File 6,1,<..\..\components\net\lwip\src\core\pbuf.c><pbuf.c>
File 6,1,<..\..\components\net\lwip\src\core\raw.c><raw.c>
File 6,1,<..\..\components\net\lwip\src\core\stats.c><stats.c>
File 6,1,<..\..\components\net\lwip\src\core\sys.c><sys.c>
File 6,1,<..\..\components\net\lwip\src\core\tcp.c><tcp.c>
File 6,1,<..\..\components\net\lwip\src\core\tcp_in.c><tcp_in.c>
File 6,1,<..\..\components\net\lwip\src\core\tcp_out.c><tcp_out.c>
File 6,1,<..\..\components\net\lwip\src\core\udp.c><udp.c>
File 6,1,<..\..\components\net\lwip\src\core\ipv4\autoip.c><autoip.c>
File 6,1,<..\..\components\net\lwip\src\core\ipv4\icmp.c><icmp.c>
File 6,1,<..\..\components\net\lwip\src\core\ipv4\igmp.c><igmp.c>
File 6,1,<..\..\components\net\lwip\src\core\ipv4\inet.c><inet.c>
File 6,1,<..\..\components\net\lwip\src\core\ipv4\inet_chksum.c><inet_chksum.c>
File 6,1,<..\..\components\net\lwip\src\core\ipv4\ip.c><ip.c>
File 6,1,<..\..\components\net\lwip\src\core\ipv4\ip_addr.c><ip_addr.c>
File 6,1,<..\..\components\net\lwip\src\core\ipv4\ip_frag.c><ip_frag.c>
File 6,1,<..\..\components\net\lwip\src\core\snmp\asn1_dec.c><asn1_dec.c>
File 6,1,<..\..\components\net\lwip\src\core\snmp\asn1_enc.c><asn1_enc.c>
File 6,1,<..\..\components\net\lwip\src\core\snmp\mib2.c><mib2.c>
File 6,1,<..\..\components\net\lwip\src\core\snmp\mib_structs.c><mib_structs.c>
File 6,1,<..\..\components\net\lwip\src\core\snmp\msg_in.c><msg_in.c>
File 6,1,<..\..\components\net\lwip\src\core\snmp\msg_out.c><msg_out.c>
File 6,1,<..\..\components\net\lwip\src\netif\etharp.c><etharp.c>
File 6,1,<..\..\components\net\lwip\src\netif\ethernetif.c><ethernetif.c>
File 6,1,<..\..\components\net\lwip\src\netif\loopif.c><loopif.c>
File 6,1,<..\..\components\net\lwip\src\netif\slipif.c><slipif.c>
File 6,1,<..\..\components\net\lwip\src\netif\ppp\auth.c><auth.c>
File 6,1,<..\..\components\net\lwip\src\netif\ppp\chap.c><chap.c>
File 6,1,<..\..\components\net\lwip\src\netif\ppp\chpms.c><chpms.c>
File 6,1,<..\..\components\net\lwip\src\netif\ppp\fsm.c><fsm.c>
File 6,1,<..\..\components\net\lwip\src\netif\ppp\ipcp.c><ipcp.c>
File 6,1,<..\..\components\net\lwip\src\netif\ppp\lcp.c><lcp.c>
File 6,1,<..\..\components\net\lwip\src\netif\ppp\magic.c><magic.c>
File 6,1,<..\..\components\net\lwip\src\netif\ppp\md5.c><md5.c>
File 6,1,<..\..\components\net\lwip\src\netif\ppp\pap.c><pap.c>
File 6,1,<..\..\components\net\lwip\src\netif\ppp\ppp.c><ppp.c>
File 6,1,<..\..\components\net\lwip\src\netif\ppp\ppp_oe.c><ppp_oe.c>
File 6,1,<..\..\components\net\lwip\src\netif\ppp\randm.c><randm.c>
File 6,1,<..\..\components\net\lwip\src\netif\ppp\vj.c><vj.c>
Options 1,0,0 // Target 'RT-Thread LPC17xx'
@ -181,7 +178,7 @@ Options 1,0,0 // Target 'RT-Thread LPC17xx'
ADSCMISC ()
ADSCDEFN ()
ADSCUDEF ()
ADSCINCD (..\..\components\net\lwip\src\include\ipv4;..\..\components\dfs;CMSIS\CM3\DeviceSupport\NXP\LPC17xx;..\..\components\net\lwip\src\include;.;..\..\libcpu\arm\lpc17xx;..\..\include;..\..\components\net\lwip\src\arch\include;..\..\components\dfs\include;..\..\components\net\lwip\src;..\..\components\net\lwip\src\netif\ppp;CMSIS\CM3\CoreSupport;..\..\components\finsh;..\..\components\net\lwip\src\include\netif)
ADSCINCD (..\..\components\net\lwip\src\include\ipv4;..\..\components\dfs;CMSIS\CM3\DeviceSupport\NXP\LPC17xx;..\..\components\net\lwip\src\include;.;..\..\libcpu\arm\lpc17xx;..\..\include;..\..\components\net\lwip\src\arch\include;..\..\components\dfs\include;..\..\components\net\lwip\src;..\..\libcpu\arm\common;..\..\components\net\lwip\src\netif\ppp;CMSIS\CM3\CoreSupport;..\..\components\finsh;..\..\components\net\lwip\src\include\netif)
ADSASFLG { 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }
ADSAMISC ()
ADSADEFN ()

View File

@ -1,47 +1,3 @@
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
# 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
# toolchains options
ARCH='arm'
CPU='lpc17xx'
@ -82,7 +38,6 @@ if PLATFORM == 'gcc':
else:
CFLAGS += ' -O2'
RT_USING_MINILIBC = True
POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n'
elif PLATFORM == 'armcc':
@ -109,7 +64,6 @@ elif PLATFORM == 'armcc':
else:
CFLAGS += ' -O2'
RT_USING_MINILIBC = False
POST_ACTION = 'fromelf --bin $TARGET --output rtthread.bin \nfromelf -z $TARGET'
elif PLATFORM == 'iar':

View File

@ -1,32 +1,23 @@
Import('env')
Import('projects')
import rtconfig
Import('RTT_ROOT')
Import('rtconfig')
# group definitions
group = {}
group['name'] = 'Startup'
group['CCFLAGS'] = ''
group['CPPPATH'] = [RTT_ROOT + '/bsp/mini2440']
group['CPPDEFINES'] = []
group['LINKFLAGS'] = ''
from building import *
src_bsp = ['application.c', 'startup.c', 'board.c', 'calendar.c']
src_drv = ['console.c', 'led.c']
if rtconfig.RT_USING_DFS:
if GetDepend('RT_USING_DFS'):
src_drv += ['sdcard.c']
if rtconfig.RT_USING_LWIP:
if GetDepend('RT_USING_LWIP'):
src_drv += ['dm9000.c']
if rtconfig.RT_USING_RTGUI:
if GetDepend('RT_USING_RTGUI'):
src_drv += ['touch.c', 'key.c', 'calibration.c']
if rtconfig.RT_USING_FTK:
if GetDepend('RT_USING_FTK'):
src_drv += ['touch.c', 'key.c']
if rtconfig.RT_USING_RTGUI:
if GetDepend('RT_USING_RTGUI') or GetDepend('RT_USING_FTK'):
if rtconfig.RT_USING_LCD_TYPE == 'PNL_A70':
src_drv += ['lcd_a70.c']
elif rtconfig.RT_USING_LCD_TYPE == 'PNL_N35':
@ -34,24 +25,8 @@ if rtconfig.RT_USING_RTGUI:
elif rtconfig.RT_USING_LCD_TYPE == 'PNL_T35':
src_drv += ['lcd_t35.c']
if rtconfig.RT_USING_FTK:
if rtconfig.RT_USING_LCD_TYPE == 'PNL_A70':
src_drv += ['lcd_a70.c']
elif rtconfig.RT_USING_LCD_TYPE == 'PNL_N35':
src_drv += ['lcd_n35.c']
elif rtconfig.RT_USING_LCD_TYPE == 'PNL_T35':
src_drv += ['lcd_t35.c']
src = File(src_bsp + src_drv)
CPPPATH = [RTT_ROOT + '/bsp/mini2440']
group = DefineGroup('Startup', src, depend = [''], CPPPATH = CPPPATH)
group['src'] = File(src_bsp + src_drv)
# 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')

View File

@ -4,20 +4,9 @@ import rtconfig
RTT_ROOT = os.path.normpath(os.getcwd() + '/../..')
sys.path = sys.path + [os.path.join(RTT_ROOT, 'tools')]
import mdk
from building import *
target = 'rtthread-mini2440'
projects = []
AddOption('--target',
dest='target',
type='string',
help='set target project: mdk')
if GetOption('target'):
SetOption('no_exec', 1)
TARGET = target + '.' + rtconfig.TARGET_EXT
TARGET = 'rtthread-mini2440.' + rtconfig.TARGET_EXT
env = Environment(tools = ['mingw'],
AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
@ -26,61 +15,23 @@ 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')
Export('TARGET')
if env['PLATFORM'] == 'win32' and rtconfig.PLATFORM == 'gcc':
import win32file
import win32event
import win32process
import win32security
# prepare building environment
objs = PrepareBuilding(env, RTT_ROOT)
def my_spawn(sh, escape, cmd, args, spawnenv):
for var in spawnenv:
spawnenv[var] = spawnenv[var].encode('ascii', 'replace')
if GetDepend('RT_USING_WEBSERVER'):
objs = objs + SConscript(RTT_ROOT + '/components/net/webserver/SConscript', variant_dir='build/net/webserver', duplicate=0)
sAttrs = win32security.SECURITY_ATTRIBUTES()
StartupInfo = win32process.STARTUPINFO()
newargs = ' '.join(map(escape, args[1:]))
cmdline = cmd + " " + newargs
if GetDepend('RT_USING_RTGUI'):
objs = objs + SConscript(RTT_ROOT + '/examples/gui/SConscript', variant_dir='build/examples/gui', duplicate=0)
# check for any special operating system commands
if cmd == 'del':
for arg in args[1:]:
win32file.DeleteFile(arg)
exit_code = 0
else:
# otherwise execute the command.
hProcess, hThread, dwPid, dwTid = win32process.CreateProcess(None, cmdline, None, None, 1, 0, spawnenv, None, StartupInfo)
win32event.WaitForSingleObject(hProcess, win32event.INFINITE)
exit_code = win32process.GetExitCodeProcess(hProcess)
win32file.CloseHandle(hProcess);
win32file.CloseHandle(hThread);
return exit_code
env['SPAWN'] = my_spawn
objs = SConscript(RTT_ROOT + '/src/SConscript', variant_dir='build/src', duplicate=0)
objs = objs + SConscript(RTT_ROOT + '/libcpu/SConscript', variant_dir='build/libcpu', duplicate=0)
if rtconfig.RT_USING_WEBSERVER:
objs = objs + SConscript(RTT_ROOT + '/components/net/webserver/SConscript', variant_dir='build/net/webserver', duplicate=0)
if rtconfig.RT_USING_RTGUI:
objs = objs + SConscript(RTT_ROOT + '/examples/gui/SConscript', variant_dir='build/examples/gui', duplicate=0)
# board build script
objs = objs + SConscript('SConscript', variant_dir='build/bsp', duplicate=0)
# component script
Repository(RTT_ROOT)
objs = objs + SConscript('components/SConscript')
# libc testsuite
# objs = objs + SConscript(RTT_ROOT + '/examples/libc/SConscript', variant_dir='build/examples/libc', duplicate=0)
# build program
env.Program(TARGET, objs)
env.AddPostAction(TARGET, rtconfig.POST_ACTION)
if GetOption('target') == 'mdk':
mdk.MDKProject('project.uV2', projects)
# end building
EndBuilding(TARGET)

View File

@ -1,77 +1,3 @@
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_DFS_NFS = False
RT_USING_DFS_ROMFS = False
RT_USING_DFS_DEVFS = False
RT_USING_LWIP = False
RT_USING_WEBSERVER = False
RT_USING_RTGUI = False
RT_USING_MODBUS = False
RT_USING_MODULE = False
RT_USING_FTK = False
RT_USING_NEWLIB = False
RT_USING_PTHREAD = 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
# libc options
if rtconfig_ns.has_key('RT_USING_NEWLIB'):
RT_USING_NEWLIB = True
if rtconfig_ns.has_key('RT_USING_PTHREAD'):
RT_USING_PTHREAD = True
# 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_DFS_ELM_USE_LFN'):
RT_DFS_ELM_USE_LFN = True
if rtconfig_ns.has_key('RT_USING_DFS_YAFFS2'):
RT_USING_DFS_YAFFS2 = True
if rtconfig_ns.has_key('RT_USING_DFS_NFS'):
RT_USING_DFS_NFS = True
if rtconfig_ns.has_key('RT_USING_DFS_ROMFS'):
RT_USING_DFS_ROMFS = True
if rtconfig_ns.has_key('RT_USING_DFS_DEVFS'):
RT_USING_DFS_DEVFS = 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
if rtconfig_ns.has_key('RT_USING_FTK'):
RT_USING_FTK = True
# module options
if rtconfig_ns.has_key('RT_USING_MODULE'):
RT_USING_MODULE = True
# panel options
# 'PNL_A70','PNL_N35', 'PNL_T35'
RT_USING_LCD_TYPE = 'PNL_T35'
@ -117,9 +43,6 @@ if PLATFORM == 'gcc':
else:
CFLAGS += ' -O2'
if RT_USING_WEBSERVER:
CFLAGS += ' -DWEBS -DUEMF -DRTT -D__NO_FCNTL=1 -DRT_USING_WEBSERVER'
POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n'
elif PLATFORM == 'armcc':
@ -146,9 +69,6 @@ elif PLATFORM == 'armcc':
else:
CFLAGS += ' -O2'
RT_USING_MINILIBC = False
if RT_USING_WEBSERVER:
CFLAGS += ' -DWEBS -DUEMF -DRTT -D__NO_FCNTL=1 -DRT_USING_WEBSERVER'
POST_ACTION = 'fromelf --bin $TARGET --output rtthread.bin \nfromelf -z $TARGET'
elif PLATFORM == 'iar':

View File

@ -1,9 +1,9 @@
Import('env')
import rtconfig
Import('RTT_ROOT')
Import('projects')
from building import *
# The set of source files associated with this SConscript file.
src_local = Split("""
src = Split("""
CMSIS/Core/CM3/core_cm3.c
CMSIS/Core/CM3/system_stm32f10x.c
STM32F10x_StdPeriph_Driver/src/stm32f10x_crc.c
@ -33,20 +33,7 @@ STM32F10x_StdPeriph_Driver/src/misc.c
path = [RTT_ROOT + '/bsp/stm3210/Libraries/STM32F10x_StdPeriph_Driver/inc',
RTT_ROOT + '/bsp/stm3210/Libraries/CMSIS/Core/CM3']
# group definitions
group = {}
group['name'] = 'STM32_StdPeriph'
group['CCFLAGS'] = ''
group['CPPPATH'] = path
group['CPPDEFINES'] = []
group['LINKFLAGS'] = ''
group['src'] = File(src_local)
CPPDEFINES = ['USE_STDPERIPH_DRIVER', rtconfig.STM32_TYPE]
group = DefineGroup('STM32_StdPeriph', src, depend = [''], CPPPATH = path)
# add group to project list
projects.append(group)
env.Append(CPPPATH = path)
obj = env.Object(src_local)
Return('obj')
Return('group')

View File

@ -1,41 +1,25 @@
Import('env')
Import('projects')
import rtconfig
Import('RTT_ROOT')
Import('rtconfig')
# group definitions
group = {}
group['name'] = 'Startup'
group['CCFLAGS'] = ''
group['CPPPATH'] = [RTT_ROOT + '/bsp/stm3210']
group['CPPDEFINES'] = ['USE_STDPERIPH_DRIVER', rtconfig.STM32_TYPE]
group['LINKFLAGS'] = ''
from building import *
src_bsp = ['application.c', 'startup.c', 'board.c', 'stm32f10x_it.c']
src_drv = ['rtc.c', 'usart.c', 'led.c']
if rtconfig.RT_USING_DFS:
if GetDepend('RT_USING_DFS'):
if rtconfig.STM32_TYPE == 'STM32F10X_HD':
src_drv += ['sdcard.c']
else:
src_drv += ['msd.c']
if rtconfig.RT_USING_LWIP:
if GetDepend('RT_USING_LWIP'):
if rtconfig.STM32_TYPE == 'STM32F10X_CL':
src_drv += ['stm32_eth.c']
else:
src_drv += ['enc28j60.c']
group['src'] = File(src_bsp + src_drv)
src = src_bsp + src_drv
CPPPATH = [RTT_ROOT + '/bsp/stm3210']
CPPDEFINES = ['USE_STDPERIPH_DRIVER', rtconfig.STM32_TYPE]
group = DefineGroup('Startup', src, depend = [''], CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES)
# 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')

View File

@ -4,18 +4,9 @@ import rtconfig
RTT_ROOT = os.path.normpath(os.getcwd() + '/../..')
sys.path = sys.path + [os.path.join(RTT_ROOT, 'tools')]
import mdk
from building import *
target = 'rtthread-stm32'
projects = []
AddOption('--target',
dest='target',
type='string',
help='set target project: mdk')
if GetOption('target'):
SetOption('no_exec', 1)
TARGET = 'rtthread-stm32.' + rtconfig.TARGET_EXT
env = Environment(tools = ['mingw'],
AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
@ -24,28 +15,17 @@ 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)
# STM32 firemare library building script
objs = objs + SConscript(RTT_ROOT + '/bsp/stm3210/Libraries/SConscript', variant_dir='build/Libraries', duplicate=0)
objs = objs + SConscript(RTT_ROOT + '/bsp/stm3210/Libraries/SConscript', variant_dir='bsp/Libraries', duplicate=0)
# 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)
if GetOption('target') == 'mdk':
mdk.MDKProject('project.Uv2', projects)
# end building
EndBuilding(TARGET)

View File

@ -3,83 +3,68 @@
Target (RT-Thread STM32), 0x0004 // Tools: 'ARM-ADS'
Group (Startup)
Group (Kernel)
Group (STM32)
Group (STM32_StdPeriph)
Group (finsh)
Group (Filesystem)
Group (finsh)
Group (LwIP)
Group (Startup)
Group (STM32_StdPeriph)
File 1,1,<..\..\src\clock.c><clock.c>
File 1,1,<..\..\src\device.c><device.c>
File 1,1,<..\..\src\idle.c><idle.c>
File 1,1,<..\..\src\ipc.c><ipc.c>
File 1,1,<..\..\src\irq.c><irq.c>
File 1,1,<..\..\src\kservice.c><kservice.c>
File 1,1,<..\..\src\mem.c><mem.c>
File 1,1,<..\..\src\mempool.c><mempool.c>
File 1,1,<..\..\src\module.c><module.c>
File 1,1,<..\..\src\object.c><object.c>
File 1,1,<..\..\src\rtm.c><rtm.c>
File 1,1,<..\..\src\scheduler.c><scheduler.c>
File 1,1,<..\..\src\slab.c><slab.c>
File 1,1,<..\..\src\thread.c><thread.c>
File 1,1,<..\..\src\timer.c><timer.c>
File 2,1,<..\..\libcpu\arm\stm32\cpu.c><cpu.c>
File 2,1,<..\..\libcpu\arm\stm32\fault.c><fault.c>
File 2,1,<..\..\libcpu\arm\stm32\interrupt.c><interrupt.c>
File 2,1,<..\..\libcpu\arm\stm32\serial.c><serial.c>
File 2,1,<..\..\libcpu\arm\stm32\stack.c><stack.c>
File 2,2,<..\..\libcpu\arm\stm32\context_rvds.S><context_rvds.S>
File 2,2,<..\..\libcpu\arm\stm32\fault_rvds.S><fault_rvds.S>
File 2,2,<..\..\libcpu\arm\stm32\start_rvds.S><start_rvds.S>
File 2,1,<..\..\libcpu\arm\common\backtrace.c><backtrace.c>
File 2,1,<..\..\libcpu\arm\common\div0.c><div0.c>
File 2,1,<..\..\libcpu\arm\common\showmem.c><showmem.c>
File 3,1,<Libraries\CMSIS\Core\CM3\core_cm3.c><core_cm3.c>
File 3,1,<Libraries\CMSIS\Core\CM3\system_stm32f10x.c><system_stm32f10x.c>
File 3,1,<Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_crc.c><stm32f10x_crc.c>
File 3,1,<Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c><stm32f10x_rcc.c>
File 3,1,<Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_wwdg.c><stm32f10x_wwdg.c>
File 3,1,<Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_pwr.c><stm32f10x_pwr.c>
File 3,1,<Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_exti.c><stm32f10x_exti.c>
File 3,1,<Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_bkp.c><stm32f10x_bkp.c>
File 3,1,<Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_i2c.c><stm32f10x_i2c.c>
File 3,1,<Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_adc.c><stm32f10x_adc.c>
File 3,1,<Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_dac.c><stm32f10x_dac.c>
File 3,1,<Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_rtc.c><stm32f10x_rtc.c>
File 3,1,<Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_fsmc.c><stm32f10x_fsmc.c>
File 3,1,<Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_tim.c><stm32f10x_tim.c>
File 3,1,<Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_iwdg.c><stm32f10x_iwdg.c>
File 3,1,<Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_spi.c><stm32f10x_spi.c>
File 3,1,<Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_flash.c><stm32f10x_flash.c>
File 3,1,<Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_sdio.c><stm32f10x_sdio.c>
File 3,1,<Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_gpio.c><stm32f10x_gpio.c>
File 3,1,<Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_usart.c><stm32f10x_usart.c>
File 3,1,<Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_dbgmcu.c><stm32f10x_dbgmcu.c>
File 3,1,<Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_dma.c><stm32f10x_dma.c>
File 3,1,<Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_can.c><stm32f10x_can.c>
File 3,1,<Libraries\STM32F10x_StdPeriph_Driver\src\misc.c><misc.c>
File 4,1,<..\..\components\finsh\cmd.c><cmd.c>
File 4,1,<..\..\components\finsh\finsh_compiler.c><finsh_compiler.c>
File 4,1,<..\..\components\finsh\finsh_error.c><finsh_error.c>
File 4,1,<..\..\components\finsh\finsh_heap.c><finsh_heap.c>
File 4,1,<..\..\components\finsh\finsh_init.c><finsh_init.c>
File 4,1,<..\..\components\finsh\finsh_node.c><finsh_node.c>
File 4,1,<..\..\components\finsh\finsh_ops.c><finsh_ops.c>
File 4,1,<..\..\components\finsh\finsh_parser.c><finsh_parser.c>
File 4,1,<..\..\components\finsh\finsh_token.c><finsh_token.c>
File 4,1,<..\..\components\finsh\finsh_var.c><finsh_var.c>
File 4,1,<..\..\components\finsh\finsh_vm.c><finsh_vm.c>
File 4,1,<..\..\components\finsh\shell.c><shell.c>
File 4,1,<..\..\components\finsh\symbol.c><symbol.c>
File 5,1,<..\..\components\dfs\src\dfs.c><dfs.c>
File 5,1,<..\..\components\dfs\src\dfs_fs.c><dfs_fs.c>
File 5,1,<..\..\components\dfs\src\dfs_file.c><dfs_file.c>
File 5,1,<..\..\components\dfs\src\dfs_posix.c><dfs_posix.c>
File 5,1,<..\..\components\dfs\filesystems\elmfat\dfs_elm.c><dfs_elm.c>
File 5,1,<..\..\components\dfs\filesystems\elmfat\ff.c><ff.c>
File 1,1,<.\application.c><application.c>
File 1,1,<.\startup.c><startup.c>
File 1,1,<.\board.c><board.c>
File 1,1,<.\stm32f10x_it.c><stm32f10x_it.c>
File 1,1,<.\rtc.c><rtc.c>
File 1,1,<.\usart.c><usart.c>
File 1,1,<.\led.c><led.c>
File 1,1,<.\sdcard.c><sdcard.c>
File 1,1,<.\enc28j60.c><enc28j60.c>
File 2,1,<..\..\src\clock.c><clock.c>
File 2,1,<..\..\src\device.c><device.c>
File 2,1,<..\..\src\idle.c><idle.c>
File 2,1,<..\..\src\ipc.c><ipc.c>
File 2,1,<..\..\src\irq.c><irq.c>
File 2,1,<..\..\src\kservice.c><kservice.c>
File 2,1,<..\..\src\mem.c><mem.c>
File 2,1,<..\..\src\mempool.c><mempool.c>
File 2,1,<..\..\src\module.c><module.c>
File 2,1,<..\..\src\object.c><object.c>
File 2,1,<..\..\src\rtm.c><rtm.c>
File 2,1,<..\..\src\scheduler.c><scheduler.c>
File 2,1,<..\..\src\slab.c><slab.c>
File 2,1,<..\..\src\thread.c><thread.c>
File 2,1,<..\..\src\timer.c><timer.c>
File 3,1,<..\..\libcpu\arm\stm32\cpu.c><cpu.c>
File 3,1,<..\..\libcpu\arm\stm32\fault.c><fault.c>
File 3,1,<..\..\libcpu\arm\stm32\interrupt.c><interrupt.c>
File 3,1,<..\..\libcpu\arm\stm32\serial.c><serial.c>
File 3,1,<..\..\libcpu\arm\stm32\stack.c><stack.c>
File 3,2,<..\..\libcpu\arm\stm32\context_rvds.S><context_rvds.S>
File 3,2,<..\..\libcpu\arm\stm32\fault_rvds.S><fault_rvds.S>
File 3,2,<..\..\libcpu\arm\stm32\start_rvds.S><start_rvds.S>
File 3,1,<..\..\libcpu\arm\common\backtrace.c><backtrace.c>
File 3,1,<..\..\libcpu\arm\common\div0.c><div0.c>
File 3,1,<..\..\libcpu\arm\common\showmem.c><showmem.c>
File 4,1,<..\..\components\dfs\src\dfs.c><dfs.c>
File 4,1,<..\..\components\dfs\src\dfs_fs.c><dfs_fs.c>
File 4,1,<..\..\components\dfs\src\dfs_file.c><dfs_file.c>
File 4,1,<..\..\components\dfs\src\dfs_posix.c><dfs_posix.c>
File 4,1,<..\..\components\dfs\filesystems\elmfat\dfs_elm.c><dfs_elm.c>
File 4,1,<..\..\components\dfs\filesystems\elmfat\ff.c><ff.c>
File 5,1,<..\..\components\finsh\cmd.c><cmd.c>
File 5,1,<..\..\components\finsh\finsh_compiler.c><finsh_compiler.c>
File 5,1,<..\..\components\finsh\finsh_error.c><finsh_error.c>
File 5,1,<..\..\components\finsh\finsh_heap.c><finsh_heap.c>
File 5,1,<..\..\components\finsh\finsh_init.c><finsh_init.c>
File 5,1,<..\..\components\finsh\finsh_node.c><finsh_node.c>
File 5,1,<..\..\components\finsh\finsh_ops.c><finsh_ops.c>
File 5,1,<..\..\components\finsh\finsh_parser.c><finsh_parser.c>
File 5,1,<..\..\components\finsh\finsh_token.c><finsh_token.c>
File 5,1,<..\..\components\finsh\finsh_var.c><finsh_var.c>
File 5,1,<..\..\components\finsh\finsh_vm.c><finsh_vm.c>
File 5,1,<..\..\components\finsh\shell.c><shell.c>
File 5,1,<..\..\components\finsh\symbol.c><symbol.c>
File 6,1,<..\..\components\net\lwip\src\api\api_lib.c><api_lib.c>
File 6,1,<..\..\components\net\lwip\src\api\api_msg.c><api_msg.c>
File 6,1,<..\..\components\net\lwip\src\api\err.c><err.c>
@ -134,17 +119,30 @@ File 6,1,<..\..\components\net\lwip\src\netif\ppp\ppp.c><ppp.c>
File 6,1,<..\..\components\net\lwip\src\netif\ppp\ppp_oe.c><ppp_oe.c>
File 6,1,<..\..\components\net\lwip\src\netif\ppp\randm.c><randm.c>
File 6,1,<..\..\components\net\lwip\src\netif\ppp\vj.c><vj.c>
File 7,1,<.\application.c><application.c>
File 7,1,<.\startup.c><startup.c>
File 7,1,<.\board.c><board.c>
File 7,1,<.\stm32f10x_it.c><stm32f10x_it.c>
File 7,1,<.\rtc.c><rtc.c>
File 7,1,<.\usart.c><usart.c>
File 7,1,<.\led.c><led.c>
File 7,1,<.\sdcard.c><sdcard.c>
File 7,1,<.\enc28j60.c><enc28j60.c>
File 7,1,<Libraries\CMSIS\Core\CM3\core_cm3.c><core_cm3.c>
File 7,1,<Libraries\CMSIS\Core\CM3\system_stm32f10x.c><system_stm32f10x.c>
File 7,1,<Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_crc.c><stm32f10x_crc.c>
File 7,1,<Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_rcc.c><stm32f10x_rcc.c>
File 7,1,<Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_wwdg.c><stm32f10x_wwdg.c>
File 7,1,<Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_pwr.c><stm32f10x_pwr.c>
File 7,1,<Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_exti.c><stm32f10x_exti.c>
File 7,1,<Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_bkp.c><stm32f10x_bkp.c>
File 7,1,<Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_i2c.c><stm32f10x_i2c.c>
File 7,1,<Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_adc.c><stm32f10x_adc.c>
File 7,1,<Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_dac.c><stm32f10x_dac.c>
File 7,1,<Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_rtc.c><stm32f10x_rtc.c>
File 7,1,<Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_fsmc.c><stm32f10x_fsmc.c>
File 7,1,<Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_tim.c><stm32f10x_tim.c>
File 7,1,<Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_iwdg.c><stm32f10x_iwdg.c>
File 7,1,<Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_spi.c><stm32f10x_spi.c>
File 7,1,<Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_flash.c><stm32f10x_flash.c>
File 7,1,<Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_sdio.c><stm32f10x_sdio.c>
File 7,1,<Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_gpio.c><stm32f10x_gpio.c>
File 7,1,<Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_usart.c><stm32f10x_usart.c>
File 7,1,<Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_dbgmcu.c><stm32f10x_dbgmcu.c>
File 7,1,<Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_dma.c><stm32f10x_dma.c>
File 7,1,<Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_can.c><stm32f10x_can.c>
File 7,1,<Libraries\STM32F10x_StdPeriph_Driver\src\misc.c><misc.c>
Options 1,0,0 // Target 'RT-Thread STM32'
@ -205,7 +203,7 @@ Options 1,0,0 // Target 'RT-Thread STM32'
ADSCMISC ()
ADSCDEFN (STM32F10X_HD, USE_STDPERIPH_DRIVER)
ADSCUDEF ()
ADSCINCD (Libraries\CMSIS\Core\CM3;Libraries\STM32F10x_StdPeriph_Driver\inc;..\..\components\dfs;..\..\components\finsh;..\..\components\net\lwip\src\include;.;..\..\components\net\lwip\src\include\ipv4;..\..\include;..\..\components\net\lwip\src\arch\include;..\..\components\dfs\include;..\..\components\net\lwip\src;..\..\components\net\lwip\src\netif\ppp;..\..\libcpu\arm\stm32;..\..\components\net\lwip\src\include\netif)
ADSCINCD (Libraries\CMSIS\Core\CM3;Libraries\STM32F10x_StdPeriph_Driver\inc;..\..\components\dfs;..\..\components\finsh;..\..\components\net\lwip\src\include;.;..\..\components\net\lwip\src\include\ipv4;..\..\include;..\..\components\net\lwip\src\arch\include;..\..\components\dfs\include;..\..\components\net\lwip\src;..\..\libcpu\arm\common;..\..\components\net\lwip\src\netif\ppp;..\..\libcpu\arm\stm32;..\..\components\net\lwip\src\include\netif)
ADSASFLG { 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }
ADSAMISC ()
ADSADEFN ()

View File

@ -1,47 +1,3 @@
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
# 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
# toolchains options
ARCH='arm'
CPU='stm32'
@ -83,7 +39,6 @@ if PLATFORM == 'gcc':
else:
CFLAGS += ' -O2'
RT_USING_MINILIBC = True
POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n'
elif PLATFORM == 'armcc':
@ -110,7 +65,6 @@ elif PLATFORM == 'armcc':
else:
CFLAGS += ' -O2'
RT_USING_MINILIBC = False
POST_ACTION = 'fromelf --bin $TARGET --output rtthread.bin \nfromelf -z $TARGET'
elif PLATFORM == 'iar':
@ -128,5 +82,4 @@ elif PLATFORM == 'iar':
LFLAGS = ' --config stm32f10x_flash.icf'
EXEC_PATH += '/arm/bin/'
RT_USING_MINILIBC = False
POST_ACTION = ''

View File

@ -1,36 +1,13 @@
# for module compile
Import('env')
Import('rtconfig')
# for module compiling
import os
Import('RTT_ROOT')
# build each components
objs = ''
objs = []
list = os.listdir(os.path.join(RTT_ROOT, 'components'))
if rtconfig.CROSS_TOOL == 'gcc':
if 'RT_USING_NEWLIB' in dir(rtconfig) and rtconfig.RT_USING_NEWLIB:
objs = objs + SConscript('libc/newlib/SConscript')
else:
rtconfig.RT_USING_MINILIBC = True
objs = objs + SConscript('libc/minilibc/SConscript')
if 'RT_USING_PTHREAD' in dir(rtconfig) and rtconfig.RT_USING_PTHREAD:
objs = objs + SConscript('pthreads/SConscript')
if 'RT_USING_FINSH' in dir(rtconfig) and rtconfig.RT_USING_FINSH:
objs = objs + SConscript('finsh/SConscript')
if 'RT_USING_DFS' in dir(rtconfig) and rtconfig.RT_USING_DFS:
objs = objs + SConscript('dfs/SConscript')
if 'RT_USING_LWIP' in dir(rtconfig) and rtconfig.RT_USING_LWIP:
objs = objs + SConscript('net/lwip/SConscript')
if 'RT_USING_MODBUS' in dir(rtconfig) and rtconfig.RT_USING_MODBUS:
objs = objs + SConscript('net/freemodbus/SConscript')
if 'RT_USING_RTGUI' in dir(rtconfig) and rtconfig.RT_USING_RTGUI:
objs = objs + SConscript('rtgui/SConscript')
if 'RT_USING_FTK' in dir(rtconfig) and rtconfig.RT_USING_FTK:
objs = objs + SConscript('external/ftk/ftk/src/os/rt-thread/SConscript')
for d in list:
path = os.path.join(RTT_ROOT, 'components', d)
if os.path.isfile(os.path.join(path, 'SConscript')):
objs = objs + SConscript(os.path.join(d, 'SConscript'))
Return('objs')

View File

@ -1,8 +1,8 @@
Import('env')
Import('rtconfig')
Import('RTT_ROOT')
Import('projects')
Import('rtconfig')
from building import *
# The set of source files associated with this SConscript file.
dfs = Split("""
src/dfs.c
src/dfs_fs.c
@ -67,45 +67,27 @@ src_local = dfs
# The set of source files associated with this SConscript file.
path = [RTT_ROOT + '/components/dfs', RTT_ROOT + '/components/dfs/include']
if 'RT_USING_DFS_YAFFS2' in dir(rtconfig) and rtconfig.RT_USING_DFS_YAFFS2:
if GetDepend('RT_USING_DFS_YAFFS2'):
src_local = src_local + yaffs2_main + yaffs2_comm
path = path + [RTT_ROOT + '/components/dfs/filesystems/yaffs2', RTT_ROOT + '/components/dfs/filesystems/yaffs2/direct']
if 'RT_DFS_ELM_USE_LFN' in dir(rtconfig) and rtconfig.RT_DFS_ELM_USE_LFN:
elmfat += ['filesystems/elmfat/option/cc936.c']
if 'RT_USING_DFS_ELMFAT' in dir(rtconfig) and rtconfig.RT_USING_DFS_ELMFAT:
if GetDepend('RT_USING_DFS_ELMFAT'):
if GetDepend('RT_DFS_ELM_USE_LFN'):
elmfat += ['filesystems/elmfat/option/cc936.c']
src_local = src_local + elmfat
if 'RT_USING_DFS_NFS' in dir(rtconfig) and rtconfig.RT_USING_DFS_NFS and rtconfig.RT_USING_LWIP:
if GetDepend(['RT_USING_DFS_NFS', 'RT_USING_LWIP']):
src_local = src_local + nfs
path = path + [RTT_ROOT + '/components/dfs/filesystems/nfs']
if 'RT_USING_DFS_ROMFS' in dir(rtconfig) and rtconfig.RT_USING_DFS_ROMFS:
if GetDepend('RT_USING_DFS_ROMFS'):
src_local = src_local + romfs
path = path + [RTT_ROOT + '/components/dfs/filesystems/romfs']
if 'RT_USING_DFS_DEVFS' in dir(rtconfig) and rtconfig.RT_USING_DFS_DEVFS:
if GetDepend('RT_USING_DFS_DEVFS'):
src_local = src_local + devfs
path = path + [RTT_ROOT + '/components/dfs/filesystems/devfs']
# group definitions
group = {}
group['name'] = 'Filesystem'
group['src'] = File(src_local)
group['CCFLAGS'] = ''
group['CPPPATH'] = path
group['CPPDEFINES'] = ''
group['LINKFLAGS'] = ''
group = DefineGroup('Filesystem', src_local, depend = ['RT_USING_DFS'], CPPPATH = path)
# 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')

View File

@ -282,7 +282,6 @@ int stat(const char *file, struct stat *buf)
*/
int fstat(int fildes, struct stat *buf)
{
int result;
struct dfs_fd* d;
/* get the fd */

View File

@ -1,28 +1,14 @@
Import('env')
Import('projects')
Import('RTT_ROOT')
Import('rtconfig')
from building import *
# group definitions
group = {}
group['name'] = 'finsh'
group['src'] = Glob('*.c')
group['CCFLAGS'] = ''
group['CPPPATH'] = [RTT_ROOT + '/components/finsh']
group['CPPDEFINES'] = ''
src = Glob('*.c')
CPPPATH = [RTT_ROOT + '/components/finsh']
if rtconfig.CROSS_TOOL == 'keil':
group['LINKFLAGS'] = ' --keep __fsym_* --keep __vsym_*'
LINKFLAGS = ' --keep __fsym_* --keep __vsym_*'
else:
group['LINKFLAGS'] = ''
LINKFLAGS = ''
# add group to project list
projects.append(group)
group = DefineGroup('finsh', src, depend = ['RT_USING_FINSH'], CPPPATH = CPPPATH, LINKFLAGS = LINKFLAGS)
env.Append(CCFLAGS = group['CCFLAGS'])
env.Append(CPPPATH = group['CPPPATH'])
env.Append(CPPDEFINES = group['CPPDEFINES'])
env.Append(LINKFLAGS = group['LINKFLAGS'])
objs = env.Object(group['src'])
Return('objs')
Return('group')

View File

@ -1,10 +1,8 @@
Import('env')
Import('RTT_ROOT')
from building import *
# The set of source files associated with this SConscript file.
src_local = Glob('*.c')
src = Glob('*.c')
CPPPATH = [RTT_ROOT + '/components/libc/minilibc']
group = DefineGroup('minilibc', src, depend = ['RT_USING_MINILIBC'], CPPPATH = CPPPATH)
env.Append(CPPPATH = RTT_ROOT + '/components/libc/minilibc', CPPDEFINES='RT_USING_MINILIBC')
obj = env.Object(src_local)
Return('obj')
Return('group')

View File

@ -1,10 +1,8 @@
Import('env')
Import('RTT_ROOT')
from building import *
# The set of source files associated with this SConscript file.
src_local = Glob('*.c')
src = Glob('*.c')
CPPPATH = [RTT_ROOT + '/components/libc/newlib']
group = DefineGroup('newlib', src, depend = ['RT_USING_NEWLIB'], CPPPATH = CPPPATH)
env.Append(CPPPATH = RTT_ROOT + '/components/libc/newlib')
obj = env.Object(src_local)
Return('obj')
Return('group')

View File

@ -201,12 +201,14 @@ _free_r (struct _reent *ptr, void *addr)
rt_free (addr);
}
#if 0
void __assert(const char *file, int line, const char *failedexpr)
{
rt_kprintf("assertion \"%s\" failed: file \"%s\", line %d\n",
failedexpr, file, line);
RT_ASSERT(0);
}
#endif
void
_exit (int status)

View File

@ -1,26 +1,9 @@
Import('env')
Import('projects')
Import('RTT_ROOT')
Import('rtconfig')
from building import *
# group definitions
group = {}
group['name'] = 'libdl'
group['src'] = Glob('*.c')
group['depend'] = 'RT_USING_LIBDL'
group['CCFLAGS'] = ''
group['CPPPATH'] = [RTT_ROOT + '/components/libdl']
group['CPPDEFINES'] = ''
group['LINKFLAGS'] = ''
src = Glob('*.c')
CPPPATH = [RTT_ROOT + '/components/libdl']
group = DefineGroup('libdl', src, depend = ['RT_USING_MODULE', 'RT_USING_LIBDL'], 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'])
objs = env.Object(group['src'])
Return('objs')
Return('group')

View File

@ -1,10 +1,7 @@
Import('env')
Import('rtconfig')
Import('RTT_ROOT')
from building import *
# The set of source files associated with this SConscript file.
src_local = Glob('*.c')
src = Glob('*.c')
group = DefineGroup('netutils', src, depend = ['RT_USING_NETUTILS'])
obj = env.Object(src_local)
Return('obj')
Return('group')

View File

@ -1,9 +1,7 @@
Import('env')
Import('rtconfig')
Import('RTT_ROOT')
Import('projects')
from building import *
src_local = Split("""
src = Split("""
modbus/mb.c
modbus/mbmaster.c
modbus/ascii/mbascii.c
@ -30,23 +28,6 @@ path = [RTT_ROOT + '/components/net/freemodbus/modbus/include',
RTT_ROOT + '/components/net/freemodbus/modbus/rtu',
RTT_ROOT + '/components/net/freemodbus/modbus/ascii']
# group definitions
group = {}
group['name'] = 'FreeModBus'
group['src'] = File(src_local)
group['CCFLAGS'] = ''
group['CPPPATH'] = path
group['CPPDEFINES'] = ''
group['LINKFLAGS'] = ''
group = DefineGroup('FreeModbus', src, depend = ['RT_USING_FREEMODBUS'], CPPPATH = path)
# 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'])
objs = env.Object(group['src'])
Return('objs')
Return('group')

View File

@ -1,9 +1,7 @@
Import('env')
Import('rtconfig')
Import('RTT_ROOT')
Import('projects')
from building import *
src_local = Split("""
src = Split("""
src/api/api_lib.c
src/api/api_msg.c
src/api/err.c
@ -68,23 +66,6 @@ path = [RTT_ROOT + '/components/net/lwip/src',
RTT_ROOT + '/components/net/lwip/src/include/netif',
RTT_ROOT + '/components/net/lwip/src/netif/ppp']
# group definitions
group = {}
group['name'] = 'LwIP'
group['src'] = File(src_local)
group['CCFLAGS'] = ''
group['CPPPATH'] = path
group['CPPDEFINES'] = ''
group['LINKFLAGS'] = ''
group = DefineGroup('LwIP', src, depend = ['RT_USING_LWIP'], CPPPATH = path)
# 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')

View File

@ -1,26 +1,8 @@
Import('env')
Import('projects')
Import('RTT_ROOT')
Import('rtconfig')
from building import *
# group definitions
group = {}
group['name'] = 'pthreads'
group['src'] = Glob('*.c')
group['depend'] = 'RT_USING_PTHREAD'
group['CCFLAGS'] = ''
group['CPPPATH'] = [RTT_ROOT + '/components/pthreads']
group['CPPDEFINES'] = ''
group['LINKFLAGS'] = ''
src = Glob('*.c')
CPPPATH = [RTT_ROOT + '/components/pthreads']
group = DefineGroup('pthreads', src, depend = ['RT_USING_PTHREADS'], 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'])
objs = env.Object(group['src'])
Return('objs')
Return('group')

View File

@ -1,7 +1,5 @@
Import('env')
Import('rtconfig')
Import('RTT_ROOT')
Import('projects')
from building import *
common_src = Split("""
common/blit.c
@ -63,30 +61,12 @@ widgets/workbench.c
""")
# The set of source files associated with this SConscript file.
src_local = common_src + server_src + widgets_src
src = common_src + server_src + widgets_src
path = [RTT_ROOT + '/components/rtgui/include',
RTT_ROOT + '/components/rgtui/common',
RTT_ROOT + '/components/rtgui/server',
RTT_ROOT + '/components/rtgui/widgets']
group = DefineGroup('RTGUI', src, depend = ['RT_USING_RTGUI'], CPPPATH = path)
# group definitions
group = {}
group['name'] = 'GUI'
group['src'] = File(src_local)
group['CCFLAGS'] = ''
group['CPPPATH'] = path
group['CPPDEFINES'] = ''
group['LINKFLAGS'] = ''
# 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'])
objs = env.Object(group['src'])
Return('objs')
Return('group')

View File

@ -1,26 +1,8 @@
Import('env')
Import('projects')
Import('RTT_ROOT')
Import('rtconfig')
from building import *
# group definitions
group = {}
group['name'] = 'USB'
group['src'] = Glob('*.c')
group['CCFLAGS'] = ''
group['CPPPATH'] = [RTT_ROOT + '/components/usb']
group['CPPDEFINES'] = ''
group['LINKFLAGS'] = ''
group['DEPEND'] = 'RT_USING_USB'
src = Glob('*.c')
CPPPATH = [RTT_ROOT + '/components/usb']
group = DefineGroup('USB', src, depend = ['RT_USING_USB_DEVICE'], 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'])
objs = env.Object(group['src'])
Return('objs')
Return('group')

View File

@ -1,5 +1,4 @@
Import('env')
Import('projects')
from building import *
src = Split("""
demo_view_dc_buffer.c
@ -32,22 +31,6 @@ gui_init.c
mywidget.c
""")
group = {}
group['name'] = 'GUI demo'
group['src'] = File(src)
group['CCFLAGS'] = ''
group['CPPPATH'] = ['']
group['CPPDEFINES'] = ''
group['LINKFLAGS'] = ''
group = DefineGroup('gui_examples', src, depend = ['RTGUI_USING_EXAMPLES'])
# 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'])
objs = env.Object(group['src'])
Return('objs')
Return('group')

View File

@ -1,6 +1,6 @@
Import('env')
from building import *
src_local = Split("""
src = Split("""
tc_comm.c
thread_static.c
thread_dynamic.c
@ -32,8 +32,6 @@ heap_realloc.c
memp_simple.c
""")
# The set of source files associated with this SConscript file.
obj = env.Object(src_local)
env.Append(CPPDEFINES='RT_USING_TC')
group = DefineGroup('examples', src, depend = ['RT_USING_TC'])
Return('obj')
Return('group')

View File

@ -1,8 +1,6 @@
Import('env')
from building import *
src_local = Glob('*.c')
src = Glob('*.c')
group = DefineGroup('libc_test', src, depend = ['RT_USING_NEWLIB', 'RT_USING_PTHREADS', 'RT_USING_LIBC_TEST'])
# The set of source files associated with this SConscript file.
obj = env.Object(src_local)
Return('obj')
Return('group')

View File

@ -1,34 +1,21 @@
Import('env')
Import('rtconfig')
Import('RTT_ROOT')
Import('projects')
Import('rtconfig')
from building import *
comm = rtconfig.ARCH + '/common'
path = rtconfig.ARCH + '/' + rtconfig.CPU
# The set of source files associated with this SConscript file.
if rtconfig.PLATFORM == 'armcc':
src_local = Glob(path + '/*.c') + Glob(path + '/*_rvds.S') + Glob(comm + '/*.c')
src = Glob(path + '/*.c') + Glob(path + '/*_rvds.S') + Glob(comm + '/*.c')
if rtconfig.PLATFORM == 'gcc':
src_local = Glob(path + '/*.c') + Glob(path + '/*_gcc.S') + Glob(comm + '/*.c') + Glob(path + '/*_init.S')
src = Glob(path + '/*.c') + Glob(path + '/*_gcc.S') + Glob(comm + '/*.c') + Glob(path + '/*_init.S')
if rtconfig.PLATFORM == 'iar':
src_local = Glob(path + '/*.c') + Glob(path + '/*_iar.S') + Glob(comm + '/*.c')
src = Glob(path + '/*.c') + Glob(path + '/*_iar.S') + Glob(comm + '/*.c')
# group definitions
group = {}
group['name'] = rtconfig.CPU.upper()
group['src'] = File(src_local)
group['CCFLAGS'] = ''
group['CPPPATH'] = [RTT_ROOT + '/libcpu/' + rtconfig.ARCH + '/' + rtconfig.CPU, RTT_ROOT + '/libcpu/' + rtconfig.ARCH + '/common']
group['CPPDEFINES'] = ''
group['LINKFLAGS'] = ''
CPPPATH = [RTT_ROOT + '/libcpu/' + rtconfig.ARCH + '/' + rtconfig.CPU, RTT_ROOT + '/libcpu/' + rtconfig.ARCH + '/common']
group = DefineGroup(rtconfig.CPU.upper(), src, depend = [''], CPPPATH = CPPPATH)
# add group to project list
projects.append(group)
env.Append(CPPPATH = group['CPPPATH'])
obj = env.Object(group['src'])
Return('obj')
Return('group')

View File

@ -1,23 +1,8 @@
Import('env')
Import('RTT_ROOT')
Import('projects')
from building import *
# The set of source files associated with this SConscript file.
src_local = Glob('*.c')
src = Glob('*.c')
CPPPATH = [RTT_ROOT + '/include']
group = DefineGroup('Kernel', src, depend = [''], CPPPATH = CPPPATH)
# group definitions
group = {}
group['name'] = 'Kernel'
group['src'] = File(src_local)
group['CCFLAGS'] = ''
group['CPPPATH'] = [RTT_ROOT + '/include']
group['CPPDEFINES'] = ''
group['LINKFLAGS'] = ''
# add group to project list
projects.append(group)
env.Append(CPPPATH = group['CPPPATH'])
obj = env.Object(group['src'])
Return('obj')
Return('group')

View File

@ -453,7 +453,11 @@ rt_err_t rt_sem_control(rt_sem_t sem, rt_uint8_t cmd, void* arg)
RT_ASSERT(sem != RT_NULL);
if (cmd == RT_IPC_CMD_RESET)
{
{
rt_uint32_t value;
/* get value */
value = (rt_uint32_t)arg;
/* disable interrupt */
level = rt_hw_interrupt_disable();
@ -461,7 +465,7 @@ rt_err_t rt_sem_control(rt_sem_t sem, rt_uint8_t cmd, void* arg)
rt_ipc_object_resume_all(&sem->parent);
/* set new value */
sem->value = (rt_uint16_t)arg;
sem->value = (rt_uint16_t)value;
/* enable interrupt */
rt_hw_interrupt_enable(level);

334
tools/building.py Normal file
View File

@ -0,0 +1,334 @@
import os
import string
from SCons.Script import *
BuildOptions = {}
Projects = []
Rtt_Root = ''
Env = None
def _get_filetype(fn):
if fn.rfind('.c') != -1 or fn.rfind('.C') != -1 or fn.rfind('.cpp') != -1:
return 1
# assimble file type
if fn.rfind('.s') != -1 or fn.rfind('.S') != -1:
return 2
# header type
if fn.rfind('.h') != -1:
return 5
# other filetype
return 5
def splitall(loc):
"""
Return a list of the path components in loc. (Used by relpath_).
The first item in the list will be either ``os.curdir``, ``os.pardir``, empty,
or the root directory of loc (for example, ``/`` or ``C:\\).
The other items in the list will be strings.
Adapted from *path.py* by Jason Orendorff.
"""
parts = []
while loc != os.curdir and loc != os.pardir:
prev = loc
loc, child = os.path.split(prev)
if loc == prev:
break
parts.append(child)
parts.append(loc)
parts.reverse()
return parts
def _make_path_relative(origin, dest):
"""
Return the relative path between origin and dest.
If it's not possible return dest.
If they are identical return ``os.curdir``
Adapted from `path.py <http://www.jorendorff.com/articles/python/path/>`_ by Jason Orendorff.
"""
origin = os.path.abspath(origin).replace('\\', '/')
dest = os.path.abspath(dest).replace('\\', '/')
#
orig_list = splitall(os.path.normcase(origin))
# Don't normcase dest! We want to preserve the case.
dest_list = splitall(dest)
#
if orig_list[0] != os.path.normcase(dest_list[0]):
# Can't get here from there.
return dest
#
# Find the location where the two paths start to differ.
i = 0
for start_seg, dest_seg in zip(orig_list, dest_list):
if start_seg != os.path.normcase(dest_seg):
break
i += 1
#
# Now i is the point where the two paths diverge.
# Need a certain number of "os.pardir"s to work up
# from the origin to the point of divergence.
segments = [os.pardir] * (len(orig_list) - i)
# Need to add the diverging part of dest_list.
segments += dest_list[i:]
if len(segments) == 0:
# If they happen to be identical, use os.curdir.
return os.curdir
else:
# return os.path.join(*segments).replace('\\', '/')
return os.path.join(*segments)
def MDKProject(target, script):
template = file('template.uV2', "rb")
lines = template.readlines()
project = file(target, "wb")
project_path = os.path.dirname(os.path.abspath(target))
line_index = 5
# write group
for group in script:
lines.insert(line_index, 'Group (%s)\r\n' % group['name'])
line_index += 1
lines.insert(line_index, '\r\n')
line_index += 1
# write file
CPPPATH = []
CPPDEFINES = []
LINKFLAGS = ''
CCFLAGS = ''
# number of groups
group_index = 1
for group in script:
# print group['name']
# get each include path
if group.has_key('CPPPATH') and group['CPPPATH']:
if CPPPATH:
CPPPATH += group['CPPPATH']
else:
CPPPATH += group['CPPPATH']
# get each group's definitions
if group.has_key('CPPDEFINES') and group['CPPDEFINES']:
if CPPDEFINES:
CPPDEFINES += ';' + group['CPPDEFINES']
else:
CPPDEFINES += group['CPPDEFINES']
# get each group's link flags
if group.has_key('LINKFLAGS') and group['LINKFLAGS']:
if LINKFLAGS:
LINKFLAGS += ' ' + group['LINKFLAGS']
else:
LINKFLAGS += group['LINKFLAGS']
# generate file items
for node in group['src']:
fn = node.rfile()
name = fn.name
path = os.path.dirname(fn.abspath)
path = _make_path_relative(project_path, path)
path = os.path.join(path, name)
lines.insert(line_index, 'File %d,%d,<%s><%s>\r\n'
% (group_index, _get_filetype(name), path, name))
line_index += 1
group_index = group_index + 1
lines.insert(line_index, '\r\n')
line_index += 1
# remove repeat path
paths = set()
for path in CPPPATH:
inc = _make_path_relative(project_path, os.path.normpath(path))
paths.add(inc) #.replace('\\', '/')
paths = [i for i in paths]
CPPPATH = string.join(paths, ';')
definitions = [i for i in set(CPPDEFINES)]
CPPDEFINES = string.join(definitions, ', ')
while line_index < len(lines):
if lines[line_index].startswith(' ADSCINCD '):
lines[line_index] = ' ADSCINCD (' + CPPPATH + ')\r\n'
if lines[line_index].startswith(' ADSLDMC ('):
lines[line_index] = ' ADSLDMC (' + LINKFLAGS + ')\r\n'
if lines[line_index].startswith(' ADSCDEFN ('):
lines[line_index] = ' ADSCDEFN (' + CPPDEFINES + ')\r\n'
line_index += 1
# write project
for line in lines:
project.write(line)
project.close()
def BuilderProject(target, script):
project = file(target, "wb")
project_path = os.path.dirname(os.path.abspath(target))
# write file
CPPPATH = []
CPPDEFINES = []
LINKFLAGS = ''
CCFLAGS = ''
# number of groups
group_index = 1
for group in script:
# print group['name']
# generate file items
for node in group['src']:
fn = node.rfile()
name = fn.name
path = os.path.dirname(fn.abspath)
path = _make_path_relative(project_path, path)
path = os.path.join(path, name)
project.write('%s\r\n' % path)
group_index = group_index + 1
project.close()
class Win32Spawn:
def spawn(self, sh, escape, cmd, args, env):
import subprocess
newargs = string.join(args[1:], ' ')
cmdline = cmd + " " + newargs
startupinfo = subprocess.STARTUPINFO()
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
proc = subprocess.Popen(cmdline, stdin=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, startupinfo=startupinfo, shell = False)
data, err = proc.communicate()
rv = proc.wait()
if rv:
print "====="
print err
print "====="
return rv
def PrepareBuilding(env, root_directory):
import SCons.cpp
import rtconfig
global BuildOptions
global Projects
global Env
global Rtt_Root
Env = env
Rtt_Root = root_directory
# patch for win32 spawn
if env['PLATFORM'] == 'win32' and rtconfig.PLATFORM == 'gcc':
win32_spawn = Win32Spawn()
win32_spawn.env = env
env['SPAWN'] = win32_spawn.spawn
# add program path
env.PrependENVPath('PATH', rtconfig.EXEC_PATH)
# 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)
BuildOptions = PreProcessor.cpp_namespace
if (GetDepend('RT_USING_NEWLIB') == False) and rtconfig.PLATFORM == 'gcc':
AddDepend('RT_USING_MINILIBC')
# add target option
AddOption('--target',
dest='target',
type='string',
help='set target project: mdk')
if GetOption('target'):
SetOption('no_exec', 1)
# board build script
objs = SConscript('SConscript', variant_dir='bsp', duplicate=0)
Repository(Rtt_Root)
# include kernel
objs.append(SConscript('src/SConscript'))
# include libcpu
objs.append(SConscript('libcpu/SConscript'))
# include components
objs.append(SConscript('components/SConscript'))
return objs
def GetDepend(depend):
building = True
if type(depend) == type('str'):
if not BuildOptions.has_key(depend):
building = False
return building
# for list type depend
for item in depend:
if item != '':
if not BuildOptions.has_key(item):
building = False
return building
def AddDepend(option):
BuildOptions[option] = 1
def DefineGroup(name, src, depend, **parameters):
global Env
if not GetDepend(depend):
return []
group = parameters
group['name'] = name
if type(src) == type(['src1', 'str2']):
group['src'] = File(src)
else:
group['src'] = src
Projects.append(group)
if group.has_key('CCFLAGS'):
Env.Append(CCFLAGS = group['CCFLAGS'])
if group.has_key('CPPPATH'):
Env.Append(CPPPATH = group['CPPPATH'])
if group.has_key('CPPDEFINES'):
Env.Append(CPPDEFINES = group['CPPDEFINES'])
if group.has_key('LINKFLAGS'):
Env.Append(LINKFLAGS = group['LINKFLAGS'])
objs = Env.Object(group['src'])
return objs
def EndBuilding(target):
import rtconfig
Env.AddPostAction(target, rtconfig.POST_ACTION)
if GetOption('target') == 'mdk':
MDKProject('project.uV2', Projects)