mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-01-30 16:30:27 +08:00
[DFS] Use SConscript of each file system to build.
This commit is contained in:
parent
6c83ff6eca
commit
1377022b18
@ -1,207 +1,18 @@
|
||||
Import('RTT_ROOT')
|
||||
Import('rtconfig')
|
||||
from building import *
|
||||
|
||||
# The set of source files associated with this SConscript file.
|
||||
dfs = Split("""
|
||||
src/dfs.c
|
||||
src/dfs_fs.c
|
||||
src/dfs_file.c
|
||||
src/dfs_posix.c
|
||||
""")
|
||||
src = Glob('src/*.c')
|
||||
cwd = GetCurrentDir()
|
||||
CPPPATH = [cwd + "/include"]
|
||||
|
||||
# DFS-ELMFAT options
|
||||
elmfat = Split("""
|
||||
filesystems/elmfat/dfs_elm.c
|
||||
filesystems/elmfat/ff.c
|
||||
""")
|
||||
group = DefineGroup('Filesystem', src, depend = ['RT_USING_DFS'], CPPPATH = CPPPATH)
|
||||
|
||||
# DFS-ROMFS options
|
||||
romfs = Split("""
|
||||
filesystems/romfs/dfs_romfs.c
|
||||
""")
|
||||
if not GetDepend('DFS_ROMFS_ROOT'):
|
||||
romfs = romfs + Split('filesystems/romfs/romfs.c')
|
||||
|
||||
# DFS-RAMFS options
|
||||
ramfs = Split("""
|
||||
filesystems/ramfs/dfs_ramfs.c
|
||||
""")
|
||||
|
||||
# DFS-DeviceFS options
|
||||
devfs = Split("""
|
||||
filesystems/devfs/devfs.c
|
||||
filesystems/devfs/console.c
|
||||
""")
|
||||
|
||||
# DFS-YAFFS2 options
|
||||
yaffs2_src = Split("""
|
||||
filesystems/yaffs2/dfs_yaffs2.c
|
||||
filesystems/yaffs2/yaffs_osglue.c
|
||||
filesystems/yaffs2/yaffs_nandcfg.c
|
||||
|
||||
filesystems/yaffs2/yaffs/yaffs_allocator.c
|
||||
filesystems/yaffs2/yaffs/yaffs_bitmap.c
|
||||
filesystems/yaffs2/yaffs/yaffs_checkptrw.c
|
||||
filesystems/yaffs2/yaffs/yaffs_ecc.c
|
||||
filesystems/yaffs2/yaffs/yaffs_guts.c
|
||||
filesystems/yaffs2/yaffs/yaffs_nameval.c
|
||||
filesystems/yaffs2/yaffs/yaffs_nand.c
|
||||
filesystems/yaffs2/yaffs/yaffs_packedtags1.c
|
||||
filesystems/yaffs2/yaffs/yaffs_packedtags2.c
|
||||
filesystems/yaffs2/yaffs/yaffs_summary.c
|
||||
filesystems/yaffs2/yaffs/yaffs_tagscompat.c
|
||||
filesystems/yaffs2/yaffs/yaffs_verify.c
|
||||
filesystems/yaffs2/yaffs/yaffs_yaffs1.c
|
||||
filesystems/yaffs2/yaffs/yaffs_yaffs2.c
|
||||
|
||||
filesystems/yaffs2/yaffs/direct/yaffs_attribs.c
|
||||
filesystems/yaffs2/yaffs/direct/yaffs_hweight.c
|
||||
filesystems/yaffs2/yaffs/direct/yaffs_nandif.c
|
||||
filesystems/yaffs2/yaffs/direct/yaffs_qsort.c
|
||||
filesystems/yaffs2/yaffs/direct/yaffsfs.c
|
||||
|
||||
""")
|
||||
|
||||
nfs = Split('''
|
||||
filesystems/nfs/mount_clnt.c
|
||||
filesystems/nfs/mount_xdr.c
|
||||
filesystems/nfs/nfs_clnt.c
|
||||
filesystems/nfs/nfs_xdr.c
|
||||
filesystems/nfs/dfs_nfs.c
|
||||
filesystems/nfs/rpc/auth_none.c
|
||||
filesystems/nfs/rpc/clnt_generic.c
|
||||
filesystems/nfs/rpc/clnt_udp.c
|
||||
filesystems/nfs/rpc/rpc_prot.c
|
||||
filesystems/nfs/rpc/pmap.c
|
||||
filesystems/nfs/rpc/xdr.c
|
||||
filesystems/nfs/rpc/xdr_mem.c
|
||||
''')
|
||||
|
||||
uffs = Split('''
|
||||
filesystems/uffs/src/uffs/uffs_badblock.c
|
||||
filesystems/uffs/src/uffs/uffs_blockinfo.c
|
||||
filesystems/uffs/src/uffs/uffs_buf.c
|
||||
filesystems/uffs/src/uffs/uffs_debug.c
|
||||
filesystems/uffs/src/uffs/uffs_device.c
|
||||
filesystems/uffs/src/uffs/uffs_ecc.c
|
||||
filesystems/uffs/src/uffs/uffs_crc.c
|
||||
filesystems/uffs/src/uffs/uffs_fd.c
|
||||
filesystems/uffs/src/uffs/uffs_find.c
|
||||
filesystems/uffs/src/uffs/uffs_flash.c
|
||||
filesystems/uffs/src/uffs/uffs_fs.c
|
||||
filesystems/uffs/src/uffs/uffs_init.c
|
||||
filesystems/uffs/src/uffs/uffs_mem.c
|
||||
filesystems/uffs/src/uffs/uffs_mtb.c
|
||||
filesystems/uffs/src/uffs/uffs_pool.c
|
||||
filesystems/uffs/src/uffs/uffs_public.c
|
||||
filesystems/uffs/src/uffs/uffs_tree.c
|
||||
filesystems/uffs/src/uffs/uffs_utils.c
|
||||
filesystems/uffs/src/uffs/uffs_version.c
|
||||
|
||||
filesystems/uffs/dfs_uffs.c
|
||||
filesystems/uffs/uffs_nandif.c
|
||||
filesystems/uffs/uffs_rtthread.c
|
||||
''')
|
||||
|
||||
jffs2 = Split('''
|
||||
filesystems/jffs2/dfs_jffs2.c
|
||||
filesystems/jffs2/porting.c
|
||||
|
||||
filesystems/jffs2/cyg/compress/src/adler32.c
|
||||
filesystems/jffs2/cyg/compress/src/compress.c
|
||||
filesystems/jffs2/cyg/compress/src/deflate.c
|
||||
filesystems/jffs2/cyg/compress/src/infback.c
|
||||
filesystems/jffs2/cyg/compress/src/inffast.c
|
||||
filesystems/jffs2/cyg/compress/src/inflate.c
|
||||
filesystems/jffs2/cyg/compress/src/inftrees.c
|
||||
filesystems/jffs2/cyg/compress/src/trees.c
|
||||
filesystems/jffs2/cyg/compress/src/uncompr.c
|
||||
filesystems/jffs2/cyg/compress/src/zutil.c
|
||||
|
||||
filesystems/jffs2/cyg/crc/crc16.c
|
||||
filesystems/jffs2/cyg/crc/crc32.c
|
||||
filesystems/jffs2/cyg/crc/posix_crc.c
|
||||
filesystems/jffs2/kernel/rbtree.c
|
||||
filesystems/jffs2/src/build.c
|
||||
filesystems/jffs2/src/compr.c
|
||||
filesystems/jffs2/src/compr_rtime.c
|
||||
filesystems/jffs2/src/compr_rubin.c
|
||||
filesystems/jffs2/src/compr_zlib.c
|
||||
filesystems/jffs2/src/debug.c
|
||||
filesystems/jffs2/src/dir-ecos.c
|
||||
filesystems/jffs2/src/erase.c
|
||||
filesystems/jffs2/src/flashio.c
|
||||
filesystems/jffs2/src/fs-ecos.c
|
||||
filesystems/jffs2/src/gc.c
|
||||
filesystems/jffs2/src/gcthread.c
|
||||
filesystems/jffs2/src/malloc-ecos.c
|
||||
filesystems/jffs2/src/nodelist.c
|
||||
filesystems/jffs2/src/nodemgmt.c
|
||||
filesystems/jffs2/src/read.c
|
||||
filesystems/jffs2/src/readinode.c
|
||||
filesystems/jffs2/src/scan.c
|
||||
filesystems/jffs2/src/write.c
|
||||
''')
|
||||
|
||||
src_local = dfs
|
||||
CPPDEFINES = []
|
||||
|
||||
# The set of source files associated with this SConscript file.
|
||||
path = [RTT_ROOT + '/components/dfs', RTT_ROOT + '/components/dfs/include']
|
||||
|
||||
if GetDepend('RT_USING_DFS_YAFFS2'):
|
||||
src_local = src_local + yaffs2_src
|
||||
path = path + [RTT_ROOT + '/components/dfs/filesystems/yaffs2/yaffs', \
|
||||
RTT_ROOT + '/components/dfs/filesystems/yaffs2/yaffs/direct' ]
|
||||
|
||||
if GetDepend('RT_USING_DFS_ELMFAT'):
|
||||
if GetDepend('RT_DFS_ELM_USE_LFN'):
|
||||
if GetDepend('RT_DFS_ELM_CODE_PAGE_FILE'):
|
||||
elmfat += ['filesystems/elmfat/option/ccfile.c']
|
||||
else:
|
||||
if GetConfigValue('RT_DFS_ELM_CODE_PAGE') == 932:
|
||||
elmfat += ['filesystems/elmfat/option/cc932.c']
|
||||
elif GetConfigValue('RT_DFS_ELM_CODE_PAGE') == 936:
|
||||
elmfat += ['filesystems/elmfat/option/cc936.c']
|
||||
elif GetConfigValue('RT_DFS_ELM_CODE_PAGE') == 949:
|
||||
elmfat += ['filesystems/elmfat/option/cc949.c']
|
||||
elif GetConfigValue('RT_DFS_ELM_CODE_PAGE') == 950:
|
||||
elmfat += ['filesystems/elmfat/option/cc950.c']
|
||||
else:
|
||||
elmfat += ['filesystems/elmfat/option/ccsbcs.c']
|
||||
src_local = src_local + elmfat
|
||||
|
||||
if GetDepend(['RT_USING_DFS_NFS', 'RT_USING_LWIP']):
|
||||
src_local = src_local + nfs
|
||||
path = path + [RTT_ROOT + '/components/dfs/filesystems/nfs']
|
||||
|
||||
if GetDepend('RT_USING_DFS_ROMFS'):
|
||||
src_local = src_local + romfs
|
||||
path = path + [RTT_ROOT + '/components/dfs/filesystems/romfs']
|
||||
|
||||
if GetDepend('RT_USING_DFS_RAMFS'):
|
||||
src_local = src_local + ramfs
|
||||
path = path + [RTT_ROOT + '/components/dfs/filesystems/ramfs']
|
||||
|
||||
if GetDepend('RT_USING_DFS_DEVFS'):
|
||||
src_local = src_local + devfs
|
||||
path = path + [RTT_ROOT + '/components/dfs/filesystems/devfs']
|
||||
|
||||
if GetDepend('RT_USING_DFS_UFFS'):
|
||||
src_local = src_local + uffs
|
||||
path = path + [RTT_ROOT + '/components/dfs/filesystems/uffs/src/inc', \
|
||||
RTT_ROOT + '/components/dfs/filesystems/uffs'] #, \
|
||||
# RTT_ROOT + '/components/dfs/filesystems/uffs/flash']
|
||||
|
||||
if GetDepend('RT_USING_DFS_JFFS2'):
|
||||
src_local = src_local + jffs2
|
||||
path = path + [RTT_ROOT + '/components/dfs/filesystems/jffs2/src', \
|
||||
RTT_ROOT + '/components/dfs/filesystems/jffs2/kernel', \
|
||||
RTT_ROOT + '/components/dfs/filesystems/jffs2/include', \
|
||||
RTT_ROOT + '/components/dfs/filesystems/jffs2', \
|
||||
RTT_ROOT + '/components/dfs/filesystems/jffs2/cyg/compress']
|
||||
|
||||
group = DefineGroup('Filesystem', src_local, depend = ['RT_USING_DFS'], CPPPATH = path, CPPDEFINES = CPPDEFINES)
|
||||
if GetDepend('RT_USING_DFS'):
|
||||
# search in the file system implementation
|
||||
list = os.listdir(cwd)
|
||||
|
||||
for item in list:
|
||||
if os.path.isfile(os.path.join(cwd, item, 'SConscript')):
|
||||
group = group + SConscript(os.path.join(item, 'SConscript'))
|
||||
|
||||
Return('group')
|
||||
|
15
components/dfs/filesystems/SConscript
Normal file
15
components/dfs/filesystems/SConscript
Normal file
@ -0,0 +1,15 @@
|
||||
# RT-Thread building script for bridge
|
||||
|
||||
import os
|
||||
from building import *
|
||||
|
||||
cwd = GetCurrentDir()
|
||||
objs = []
|
||||
list = os.listdir(cwd)
|
||||
|
||||
for d in list:
|
||||
path = os.path.join(cwd, d)
|
||||
if os.path.isfile(os.path.join(path, 'SConscript')):
|
||||
objs = objs + SConscript(os.path.join(d, 'SConscript'))
|
||||
|
||||
Return('objs')
|
11
components/dfs/filesystems/devfs/SConscript
Normal file
11
components/dfs/filesystems/devfs/SConscript
Normal file
@ -0,0 +1,11 @@
|
||||
# RT-Thread building script for component
|
||||
|
||||
from building import *
|
||||
|
||||
cwd = GetCurrentDir()
|
||||
src = Glob('*.c')
|
||||
CPPPATH = [cwd]
|
||||
|
||||
group = DefineGroup('Filesystem', src, depend = ['RT_USING_DFS', 'RT_USING_DFS_DEVFS'], CPPPATH = CPPPATH)
|
||||
|
||||
Return('group')
|
26
components/dfs/filesystems/elmfat/SConscript
Normal file
26
components/dfs/filesystems/elmfat/SConscript
Normal file
@ -0,0 +1,26 @@
|
||||
# RT-Thread building script for component
|
||||
|
||||
from building import *
|
||||
|
||||
cwd = GetCurrentDir()
|
||||
src = Glob('*.c')
|
||||
CPPPATH = [cwd]
|
||||
|
||||
if GetDepend('RT_DFS_ELM_USE_LFN'):
|
||||
if GetDepend('RT_DFS_ELM_CODE_PAGE_FILE'):
|
||||
src += ['option/ccfile.c']
|
||||
else:
|
||||
if GetConfigValue('RT_DFS_ELM_CODE_PAGE') == 932:
|
||||
src += ['option/cc932.c']
|
||||
elif GetConfigValue('RT_DFS_ELM_CODE_PAGE') == 936:
|
||||
src += ['option/cc936.c']
|
||||
elif GetConfigValue('RT_DFS_ELM_CODE_PAGE') == 949:
|
||||
src += ['option/cc949.c']
|
||||
elif GetConfigValue('RT_DFS_ELM_CODE_PAGE') == 950:
|
||||
src += ['option/cc950.c']
|
||||
else:
|
||||
src += ['option/ccsbcs.c']
|
||||
|
||||
group = DefineGroup('Filesystem', src, depend = ['RT_USING_DFS', 'RT_USING_DFS_ELMFAT'], CPPPATH = CPPPATH)
|
||||
|
||||
Return('group')
|
50
components/dfs/filesystems/jffs2/SConscript
Normal file
50
components/dfs/filesystems/jffs2/SConscript
Normal file
@ -0,0 +1,50 @@
|
||||
# RT-Thread building script for component
|
||||
|
||||
from building import *
|
||||
|
||||
cwd = GetCurrentDir()
|
||||
src = Split('''
|
||||
dfs_jffs2.c
|
||||
porting.c
|
||||
|
||||
cyg/compress/src/adler32.c
|
||||
cyg/compress/src/compress.c
|
||||
cyg/compress/src/deflate.c
|
||||
cyg/compress/src/infback.c
|
||||
cyg/compress/src/inffast.c
|
||||
cyg/compress/src/inflate.c
|
||||
cyg/compress/src/inftrees.c
|
||||
cyg/compress/src/trees.c
|
||||
cyg/compress/src/uncompr.c
|
||||
cyg/compress/src/zutil.c
|
||||
|
||||
cyg/crc/crc16.c
|
||||
cyg/crc/crc32.c
|
||||
cyg/crc/posix_crc.c
|
||||
kernel/rbtree.c
|
||||
src/build.c
|
||||
src/compr.c
|
||||
src/compr_rtime.c
|
||||
src/compr_rubin.c
|
||||
src/compr_zlib.c
|
||||
src/debug.c
|
||||
src/dir-ecos.c
|
||||
src/erase.c
|
||||
src/flashio.c
|
||||
src/fs-ecos.c
|
||||
src/gc.c
|
||||
src/gcthread.c
|
||||
src/malloc-ecos.c
|
||||
src/nodelist.c
|
||||
src/nodemgmt.c
|
||||
src/read.c
|
||||
src/readinode.c
|
||||
src/scan.c
|
||||
src/write.c
|
||||
''')
|
||||
|
||||
CPPPATH = [cwd, cwd + '/include', cwd + '/src', cwd + '/cyg', cwd + '/kernel', cwd + '/cyg/compress']
|
||||
|
||||
group = DefineGroup('Filesystem', src, depend = ['RT_USING_DFS', 'RT_USING_DFS_JFFS2'], CPPPATH = CPPPATH)
|
||||
|
||||
Return('group')
|
11
components/dfs/filesystems/nfs/SConscript
Normal file
11
components/dfs/filesystems/nfs/SConscript
Normal file
@ -0,0 +1,11 @@
|
||||
# RT-Thread building script for component
|
||||
|
||||
from building import *
|
||||
|
||||
cwd = GetCurrentDir()
|
||||
src = Glob('*.c')
|
||||
CPPPATH = [cwd]
|
||||
|
||||
group = DefineGroup('Filesystem', src, depend = ['RT_USING_DFS', 'RT_USING_DFS_NFS'], CPPPATH = CPPPATH)
|
||||
|
||||
Return('group')
|
@ -4,6 +4,6 @@ cwd = GetCurrentDir()
|
||||
src = Glob('*.c')
|
||||
CPPPATH = [cwd]
|
||||
|
||||
group = DefineGroup('Filesystem', src, depend = ['RT_USING_DFS', 'RT_USING_MEMHEAP'], CPPPATH = CPPPATH)
|
||||
group = DefineGroup('Filesystem', src, depend = ['RT_USING_DFS', 'RT_USING_MEMHEAP', 'RT_USING_DFS_RAMFS'], CPPPATH = CPPPATH)
|
||||
|
||||
Return('group')
|
||||
|
15
components/dfs/filesystems/romfs/SConscript
Normal file
15
components/dfs/filesystems/romfs/SConscript
Normal file
@ -0,0 +1,15 @@
|
||||
# RT-Thread building script for component
|
||||
|
||||
from building import *
|
||||
|
||||
cwd = GetCurrentDir()
|
||||
src = Glob('*.c')
|
||||
CPPPATH = [cwd]
|
||||
|
||||
if GetDepend('DFS_ROMFS_ROOT'):
|
||||
# A new ROMFS root has been defined, we should remove the romfs.c
|
||||
SrcRemove(src, ['romfs.c'])
|
||||
|
||||
group = DefineGroup('Filesystem', src, depend = ['RT_USING_DFS','RT_USING_DFS_ROMFS'], CPPPATH = CPPPATH)
|
||||
|
||||
Return('group')
|
11
components/dfs/filesystems/uffs/SConscript
Normal file
11
components/dfs/filesystems/uffs/SConscript
Normal file
@ -0,0 +1,11 @@
|
||||
# RT-Thread building script for component
|
||||
|
||||
from building import *
|
||||
|
||||
cwd = GetCurrentDir()
|
||||
src = Glob('*.c')
|
||||
CPPPATH = [cwd, cwd + '/src/inc']
|
||||
|
||||
group = DefineGroup('Filesystem', src, depend = ['RT_USING_DFS', 'RT_USING_DFS_UFFS'], CPPPATH = CPPPATH)
|
||||
|
||||
Return('group')
|
@ -1,79 +0,0 @@
|
||||
/*
|
||||
* File : rtcomponents.h
|
||||
* header for RT-Thread components
|
||||
* This file is part of RT-Thread RTOS
|
||||
* COPYRIGHT (C) 2012-2015, RT-Thread Development Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2012-09-20 Bernard Change the name to components.h
|
||||
* And all components related header files.
|
||||
* 2015-02-06 Bernard Rename the components.h to rtcom.h
|
||||
*/
|
||||
|
||||
#ifndef RTCOM_H__
|
||||
#define RTCOM_H__
|
||||
|
||||
#ifdef RT_USING_FINSH
|
||||
#include <finsh.h>
|
||||
#include <shell.h>
|
||||
#endif
|
||||
|
||||
#ifdef RT_USING_LWIP
|
||||
#include <lwip/sys.h>
|
||||
#include <netif/ethernetif.h>
|
||||
#endif
|
||||
|
||||
#ifdef RT_USING_DFS
|
||||
#include <dfs_init.h>
|
||||
#include <dfs_fs.h>
|
||||
#ifdef RT_USING_DFS_ELMFAT
|
||||
#include <dfs_elm.h>
|
||||
#endif
|
||||
#if defined(RT_USING_LWIP) && defined(RT_USING_DFS_NFS)
|
||||
#include <dfs_nfs.h>
|
||||
#endif
|
||||
#ifdef RT_USING_DFS_ROMFS
|
||||
#include <dfs_romfs.h>
|
||||
#endif
|
||||
#ifdef RT_USING_DFS_DEVFS
|
||||
#include <devfs.h>
|
||||
#endif
|
||||
#ifdef RT_USING_DFS_UFFS
|
||||
#include <dfs_uffs.h>
|
||||
#endif
|
||||
#ifdef RT_USING_DFS_JFFS2
|
||||
#include <dfs_jffs2.h>
|
||||
#endif
|
||||
#ifdef RT_USING_DFS_YAFFS2
|
||||
#include <dfs_yaffs2.h>
|
||||
#endif
|
||||
#ifdef RT_USING_DFS_ROMFS
|
||||
#include <dfs_romfs.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef RT_USING_PTHREADS
|
||||
#include <pthread.h>
|
||||
#endif
|
||||
|
||||
#ifdef RT_USING_MODULE
|
||||
#include <rtm.h>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user