2013-07-22 23:02:03 +08:00
|
|
|
import sys
|
2021-12-16 11:40:14 +08:00
|
|
|
import os
|
2013-01-08 22:40:58 +08:00
|
|
|
from building import *
|
|
|
|
|
|
|
|
cwd = GetCurrentDir()
|
|
|
|
src = Glob('*.c')
|
2013-09-06 21:32:27 +08:00
|
|
|
LIBS = []
|
|
|
|
LIBPATH = []
|
|
|
|
CPPPATH = [cwd]
|
2013-01-08 22:40:58 +08:00
|
|
|
|
2021-09-25 12:24:55 +08:00
|
|
|
CPPDEFINES = ['_CRT_DECLARE_NONSTDC_NAMES=0'] # avoid to conflict with the inherent STDC in VS
|
|
|
|
|
2013-01-08 22:40:58 +08:00
|
|
|
# remove no need file.
|
2018-03-03 16:34:01 +08:00
|
|
|
if GetDepend('PKG_USING_GUIENGINE') == False:
|
2013-01-08 22:40:58 +08:00
|
|
|
SrcRemove(src, 'sdl_fb.c')
|
2013-09-06 21:32:27 +08:00
|
|
|
else:
|
2018-01-19 11:42:05 +08:00
|
|
|
LIBS.append('SDL2')
|
2013-09-06 21:32:27 +08:00
|
|
|
if sys.platform == 'win32':
|
2018-01-19 11:42:05 +08:00
|
|
|
LIBPATH.append(os.path.abspath(os.path.join(cwd, '../SDL2-2.0.7/lib/x86')))
|
|
|
|
CPPPATH.append(os.path.abspath(os.path.join(cwd, '../SDL2-2.0.7/include')))
|
2013-09-06 21:32:27 +08:00
|
|
|
|
2013-01-08 22:40:58 +08:00
|
|
|
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')
|
2013-10-26 13:55:58 +08:00
|
|
|
if GetDepend('RT_USING_DFS') == False or GetDepend('RT_USING_DFS_WINSHAREDIR') == False:
|
2013-03-15 16:54:23 +08:00
|
|
|
SrcRemove(src, 'dfs_win32.c')
|
2013-10-26 13:55:58 +08:00
|
|
|
if GetDepend('RT_USING_DFS') == False or GetDepend('RT_USING_MODULE') == False:
|
2013-03-15 16:54:23 +08:00
|
|
|
SrcRemove(src, ['module_win32.c'])
|
2013-07-22 23:02:03 +08:00
|
|
|
if sys.platform[0:5]=="linux": #check whether under linux
|
2021-04-26 14:57:26 +08:00
|
|
|
SrcRemove(src, ['module_win32.c', 'dfs_win32.c'])
|
2013-07-22 23:02:03 +08:00
|
|
|
|
2013-09-06 21:32:27 +08:00
|
|
|
group = DefineGroup('Drivers', src, depend = [''],
|
2021-09-25 12:24:55 +08:00
|
|
|
CPPPATH = CPPPATH, LIBS=LIBS, LIBPATH=LIBPATH, CPPDEFINES = CPPDEFINES)
|
2013-01-08 22:40:58 +08:00
|
|
|
|
2021-12-16 11:40:14 +08:00
|
|
|
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'))
|
|
|
|
|
2013-01-08 22:40:58 +08:00
|
|
|
Return('group')
|