mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-09-22 11:30:01 +08:00
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:
+9
-32
@@ -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')
|
||||
|
||||
+12
-30
@@ -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')
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user