SConscript 1.3 KB
Newer Older
M
Ming, Bai 已提交
1
from building import *
2
import rtconfig
M
Ming, Bai 已提交
3

wuyangyong's avatar
wuyangyong 已提交
4
cwd = GetCurrentDir()
5
src = ['spi_core.c', 'spi_dev.c']
6
CPPPATH = [cwd, cwd + '/../include']
7
LOCAL_CCFLAGS = ''
wuyangyong's avatar
wuyangyong 已提交
8

9 10 11
if GetDepend('RT_USING_QSPI'):
    src += ['qspi_core.c']

wuyangyong's avatar
wuyangyong 已提交
12 13 14 15 16 17 18
src_device = []

if GetDepend('RT_USING_SPI_WIFI'):
    src_device += ['spi_wifi_rw009.c']

if GetDepend('RT_USING_W25QXX'):
    src_device += ['spi_flash_w25qxx.c']
U
urey@ez-iot.com 已提交
19 20 21 22
    
if GetDepend('RT_USING_W25QXX_MTD'):
    src_device += ['spi_flash_w25qxx_mtd.c']    
    
wuyangyong's avatar
wuyangyong 已提交
23 24 25 26 27 28 29 30 31
if GetDepend('RT_USING_ENC28J60'):
    src_device += ['enc28j60.c']

if GetDepend('RT_USING_AT45DBXX'):
    src_device += ['spi_flash_at45dbxx.c']

if GetDepend('RT_USING_SST25VFXX'):
    src_device += ['spi_flash_sst25vfxx.c']

32 33
if GetDepend('RT_USING_GD'):
    src_device += ['spi_flash_gd.c']
34 35 36 37

if GetDepend('RT_USING_SPI_MSD'):
    src_device += ['spi_msd.c']

38 39 40 41 42
if GetDepend('RT_USING_SFUD'):
    src_device += ['spi_flash_sfud.c', 'sfud/src/sfud.c']
    CPPPATH += [cwd + '/sfud/inc']
    if GetDepend('RT_SFUD_USING_SFDP'):
        src_device += ['sfud/src/sfud_sfdp.c']
43 44 45 46
    if rtconfig.CROSS_TOOL == 'gcc':
        LOCAL_CCFLAGS += ' -std=c99'
    elif rtconfig.CROSS_TOOL == 'keil':
        LOCAL_CCFLAGS += ' --c99'
47

wuyangyong's avatar
wuyangyong 已提交
48 49
src += src_device

50
group = DefineGroup('DeviceDrivers', src, depend = ['RT_USING_SPI'], CPPPATH = CPPPATH, LOCAL_CCFLAGS = LOCAL_CCFLAGS)
M
Ming, Bai 已提交
51 52

Return('group')