forked from springcute/rt-thread
38 lines
1.3 KiB
Python
38 lines
1.3 KiB
Python
import sys
|
|
from building import *
|
|
|
|
cwd = GetCurrentDir()
|
|
src = Glob('*.c')
|
|
LIBS = []
|
|
LIBPATH = []
|
|
CPPPATH = [cwd]
|
|
|
|
# remove no need file.
|
|
if GetDepend('RT_USING_RTGUI') == False:
|
|
SrcRemove(src, 'sdl_fb.c')
|
|
else:
|
|
LIBS.append('SDL')
|
|
if sys.platform == 'win32':
|
|
LIBPATH.append(os.path.abspath(os.path.join(cwd, '../SDL/lib/x86')))
|
|
CPPPATH.append(os.path.abspath(os.path.join(cwd, '../SDL/include')))
|
|
|
|
if GetDepend('RT_USING_DFS') == False or GetDepend('RT_USING_DFS_ELMFAT') == False:
|
|
SrcRemove(src, 'sd_sim.c')
|
|
if GetDepend('RT_USING_DFS') == False or GetDepend('RT_USING_MTD_NAND') == False:
|
|
SrcRemove(src, 'nanddrv_file.c')
|
|
if GetDepend('RT_USING_DFS') == False or GetDepend('RT_USING_MTD_NOR') == False:
|
|
SrcRemove(src, 'sst25vfxx_mtd_sim.c')
|
|
if GetDepend('RT_USING_DFS_WINSHAREDIR') == False:
|
|
SrcRemove(src, 'dfs_win32.c')
|
|
if GetDepend('RT_USING_MODULE') == False:
|
|
SrcRemove(src, ['module_win32.c'])
|
|
if GetDepend('RT_USING_TAPNETIF') == False:
|
|
SrcRemove(src, ['tap_netif.c'])
|
|
if sys.platform[0:5]=="linux": #check whether under linux
|
|
SrcRemove(src, ['module_win32.c', 'dfs_win32.c', 'tap_netif.c'])
|
|
|
|
group = DefineGroup('Drivers', src, depend = [''],
|
|
CPPPATH = CPPPATH, LIBS=LIBS, LIBPATH=LIBPATH)
|
|
|
|
Return('group')
|