diff --git a/components/SConscript b/components/SConscript index 0f0065d8f..435755201 100644 --- a/components/SConscript +++ b/components/SConscript @@ -3,8 +3,26 @@ Import('env') Import('rtconfig') # build each components +objs = '' + +if rtconfig.RT_USING_MINILIBC: + objs = objs + SConscript('libc/minilibc/SConscript') + +if rtconfig.RT_USING_FINSH: + objs = objs + SConscript('finsh/SConscript') + +if rtconfig.RT_USING_DFS: + objs = objs + SConscript('dfs/SConscript') + +if rtconfig.RT_USING_LWIP: + objs = objs + SConscript('net/lwip/SConscript') + +if rtconfig.RT_USING_RTGUI: + objs = objs + SConscript('rtgui/SConscript') # build each modules -SConscript('hello/SConscript') -SConscript('thread/SConscript') +if rtconfig.CROSS_TOOL == 'gcc': + SConscript('hello/SConscript') + SConscript('thread/SConscript') +Return('objs') diff --git a/components/dfs/SConscript b/components/dfs/SConscript index 48ccc84c1..d8511cd7f 100644 --- a/components/dfs/SConscript +++ b/components/dfs/SConscript @@ -1,6 +1,7 @@ Import('env') Import('rtconfig') Import('RTT_ROOT') +Import('projects') dfs = Split(""" src/dfs_fs.c @@ -47,20 +48,35 @@ filesystems/yaffs2/yaffs_checkptrw.c filesystems/yaffs2/yaffs_qsort.c """) -# The set of source files associated with this SConscript file. src_local = dfs -path = [RTT_ROOT + '/filesystem/dfs', RTT_ROOT + '/filesystem/dfs/include'] +# The set of source files associated with this SConscript file. +path = [RTT_ROOT + '/components/dfs', RTT_ROOT + '/components/dfs/include'] if rtconfig.RT_USING_DFS_YAFFS2: src_local = src_local + yaffs2_main + yaffs2_comm - path = path + [RTT_ROOT + '/filesystem/dfs/filesystems/yaffs2', RTT_ROOT + '/filesystem/dfs/filesystems/yaffs2/direct'] + path = path + [RTT_ROOT + '/components/dfs/filesystems/yaffs2', RTT_ROOT + '/components/dfs/filesystems/yaffs2/direct'] if rtconfig.RT_USING_DFS_ELMFAT: src_local = src_local + elmfat - path = path + [RTT_ROOT + '/filesystem/dfs/filesystems/elmfat'] + # path = path + [RTT_ROOT + '/components/dfs/filesystems/elmfat'] -env.Append(CPPPATH = path) +# group definitions +group = {} +group['name'] = 'Filesystem' +group['src'] = File(src_local) +group['CCFLAGS'] = '' +group['CPPPATH'] = path +group['CPPDEFINES'] = '' +group['LINKFLAGS'] = '' -obj = env.Object(src_local) +# 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') diff --git a/components/finsh/SConscript b/components/finsh/SConscript index 0a638c10a..5b6e9b127 100644 --- a/components/finsh/SConscript +++ b/components/finsh/SConscript @@ -1,10 +1,28 @@ Import('env') +Import('projects') Import('RTT_ROOT') +Import('rtconfig') -# The set of source files associated with this SConscript file. -src_local = Glob('*.c') +# group definitions +group = {} +group['name'] = 'finsh' +group['src'] = Glob('*.c') +group['CCFLAGS'] = '' +group['CPPPATH'] = [RTT_ROOT + '/components/finsh'] +group['CPPDEFINES'] = '' +if rtconfig.CROSS_TOOL == 'keil': + group['LINKFLAGS'] = ' --keep __fsym_* --keep __vsym_*' +else: + group['LINKFLAGS'] = '' -env.Append(CPPPATH = RTT_ROOT + '/finsh') +# add group to project list +projects.append(group) -obj = env.Object(src_local) -Return('obj') +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') diff --git a/components/libc/minilibc/SConscript b/components/libc/minilibc/SConscript index 729d2fea0..8b4a2ba78 100644 --- a/components/libc/minilibc/SConscript +++ b/components/libc/minilibc/SConscript @@ -4,7 +4,7 @@ Import('RTT_ROOT') # The set of source files associated with this SConscript file. src_local = Glob('*.c') -env.Append(CPPPATH = RTT_ROOT + '/libc/minilibc') +env.Append(CPPPATH = RTT_ROOT + '/components/libc/minilibc') obj = env.Object(src_local) Return('obj') diff --git a/components/net/lwip/SConscript b/components/net/lwip/SConscript index de08af668..e58ee3bf4 100644 --- a/components/net/lwip/SConscript +++ b/components/net/lwip/SConscript @@ -1,6 +1,7 @@ Import('env') Import('rtconfig') Import('RTT_ROOT') +Import('projects') src_local = Split(""" src/api/api_lib.c @@ -60,10 +61,31 @@ src/netif/ppp/vj.c """) # The set of source files associated with this SConscript file. -path = [RTT_ROOT + '/net/lwip/src', RTT_ROOT + '/net/lwip/src/include', RTT_ROOT + '/net/lwip/src/include/ipv4', RTT_ROOT + '/net/lwip/src/arch/include', RTT_ROOT + '/net/lwip/src/include/netif', RTT_ROOT + '/net/lwip/src/netif/ppp'] +path = [RTT_ROOT + '/components/net/lwip/src', + RTT_ROOT + '/components/net/lwip/src/include', + RTT_ROOT + '/components/net/lwip/src/include/ipv4', + RTT_ROOT + '/components/net/lwip/src/arch/include', + RTT_ROOT + '/components/net/lwip/src/include/netif', + RTT_ROOT + '/components/net/lwip/src/netif/ppp'] -env.Append(CPPPATH = path) +# group definitions +print 'LwIP group==' +group = {} +group['name'] = 'LwIP' +group['src'] = File(src_local) +group['CCFLAGS'] = '' +group['CPPPATH'] = path +group['CPPDEFINES'] = '' +group['LINKFLAGS'] = '' -obj = env.Object(src_local) +# 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')