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 *
|
2022-04-07 14:24:11 +08:00
|
|
|
Import('rtconfig')
|
2013-01-08 22:40:58 +08:00
|
|
|
|
|
|
|
cwd = GetCurrentDir()
|
2022-05-31 11:50:17 +08:00
|
|
|
src = ['board.c', 'uart_console.c']
|
2013-09-06 21:32:27 +08:00
|
|
|
LIBS = []
|
|
|
|
LIBPATH = []
|
|
|
|
CPPPATH = [cwd]
|
2022-06-04 17:02:35 +08:00
|
|
|
CPPDEFINES = ['RT_USING_LIBC']
|
2022-04-07 14:24:11 +08:00
|
|
|
|
|
|
|
if rtconfig.CROSS_TOOL == 'msvc':
|
|
|
|
CPPDEFINES += \
|
|
|
|
[
|
|
|
|
# avoid to conflict with the inherent STDC in VS
|
|
|
|
'_CRT_DECLARE_NONSTDC_NAMES=0',
|
|
|
|
# errno macro redefinition
|
|
|
|
'_CRT_ERRNO_DEFINED',
|
2022-05-16 02:23:11 +08:00
|
|
|
# avoid time.h conflicts, such as struct timespec, ctime, difftime...
|
2022-04-07 14:24:11 +08:00
|
|
|
'_CRT_NO_TIME_T',
|
|
|
|
# disable deprecation of unsafe functions, such as strncpy
|
|
|
|
'_CRT_SECURE_NO_WARNINGS',
|
2022-05-16 02:23:11 +08:00
|
|
|
# lean and mean for Windows.h, exclude winsock.h when include Windows.h
|
|
|
|
# avoid conlicts between sys/select.h, time.h, and winsock.h
|
|
|
|
# such as fd_set related, struct timeval...
|
|
|
|
'WIN32_LEAN_AND_MEAN'
|
2022-04-07 14:24:11 +08:00
|
|
|
]
|
2013-01-08 22:40:58 +08:00
|
|
|
|
|
|
|
# remove no need file.
|
2022-05-31 11:50:17 +08:00
|
|
|
if GetDepend('PKG_USING_GUIENGINE') == True:
|
|
|
|
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':
|
2022-04-08 02:09:31 +08:00
|
|
|
LIBPATH.append(os.path.abspath(os.path.join(cwd, '../SDL2/lib/x86')))
|
|
|
|
CPPPATH.append(os.path.abspath(os.path.join(cwd, '../SDL2/include')))
|
2013-09-06 21:32:27 +08:00
|
|
|
|
2022-05-31 11:50:17 +08:00
|
|
|
|
|
|
|
if GetDepend('RT_USING_DFS') == True:
|
|
|
|
if GetDepend('RT_USING_DFS_ELMFAT') == True:
|
|
|
|
src += ['sd_sim.c']
|
|
|
|
|
|
|
|
if GetDepend('RT_USING_MTD_NAND') == True:
|
|
|
|
src += ['nanddrv_file.c']
|
|
|
|
|
|
|
|
if GetDepend('RT_USING_MTD_NOR') == True:
|
|
|
|
src += ['sst25vfxx_mtd_sim.c']
|
|
|
|
|
|
|
|
if sys.platform == "win32":
|
|
|
|
if GetDepend('RT_USING_DFS_WINSHAREDIR') == True:
|
|
|
|
src += ['dfs_win32.c']
|
|
|
|
if GetDepend('RT_USING_MODULE') == True:
|
|
|
|
src += ['module_win32.c']
|
|
|
|
|
|
|
|
if GetDepend('BSP_USING_RTC') == True:
|
|
|
|
src += ['drv_rtc.c']
|
|
|
|
|
|
|
|
if GetDepend('BSP_USING_SOCKET') == True:
|
|
|
|
src += [cwd + '/winsock/drv_win_eth.c']
|
|
|
|
src += [cwd + '/winsock/sal_winsock.c']
|
2013-07-22 23:02:03 +08:00
|
|
|
|
2022-04-07 14:24:11 +08:00
|
|
|
group = DefineGroup('Drivers', src, depend = [''],
|
|
|
|
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')
|