2022-11-10 22:22:48 +08:00
|
|
|
import os
|
|
|
|
from building import *
|
|
|
|
|
|
|
|
objs = []
|
|
|
|
cwd = GetCurrentDir()
|
|
|
|
|
|
|
|
STANDALONE_DIR = cwd + '/standalone'
|
|
|
|
|
|
|
|
# common source
|
|
|
|
src = Glob(STANDALONE_DIR+'/common/*.c')
|
|
|
|
path = [STANDALONE_DIR + '/common']
|
|
|
|
|
2023-05-11 10:25:21 +08:00
|
|
|
# port
|
|
|
|
src += Glob(STANDALONE_DIR+'/port/*.c')
|
|
|
|
path += [STANDALONE_DIR + '/port'] + [STANDALONE_DIR + '/port/arch']
|
2022-11-10 22:22:48 +08:00
|
|
|
|
|
|
|
if GetDepend(['TARGET_ARMV8_AARCH32']):
|
2023-05-11 10:25:21 +08:00
|
|
|
src += Glob(STANDALONE_DIR+'/port/arch/armv8/aarch32/*.c') + Glob(STANDALONE_DIR+'/port/arch/armv8/aarch32/*.S')
|
|
|
|
path += [STANDALONE_DIR + '/port/arch/armv8/aarch32']
|
2022-11-10 22:22:48 +08:00
|
|
|
elif GetDepend(['TARGET_ARMV8_AARCH64']):
|
2023-05-11 10:25:21 +08:00
|
|
|
src += Glob(STANDALONE_DIR+'/port/arch/armv8/aarch64/*.c') + Glob(STANDALONE_DIR+'/port/arch/armv8/aarch64/*.S')
|
2023-08-02 13:27:09 +08:00
|
|
|
path += [STANDALONE_DIR + '/port/arch/armv8/aarch64']
|
|
|
|
|
|
|
|
src += Glob(STANDALONE_DIR+'/port/*.c')
|
|
|
|
path += [STANDALONE_DIR + '/port/*.h']
|
2022-11-10 22:22:48 +08:00
|
|
|
|
|
|
|
# board
|
|
|
|
src += Glob(STANDALONE_DIR+'/board/common/*.c') + Glob(STANDALONE_DIR+'/board/common/*.S')
|
2023-05-11 10:25:21 +08:00
|
|
|
path += [STANDALONE_DIR + '/board/common']
|
2022-11-10 22:22:48 +08:00
|
|
|
|
|
|
|
if GetDepend(['TARGET_F2000_4']):
|
|
|
|
src += Glob(STANDALONE_DIR+'/board/ft2004/*.c')
|
2023-05-11 10:25:21 +08:00
|
|
|
path += [STANDALONE_DIR + '/board/ft2004']
|
2022-11-10 22:22:48 +08:00
|
|
|
|
2023-08-29 10:27:54 +08:00
|
|
|
if GetDepend(['TARGET_E2000Q']):
|
2022-11-10 22:22:48 +08:00
|
|
|
src += Glob(STANDALONE_DIR+'/board/e2000/*.c')
|
2023-05-11 10:25:21 +08:00
|
|
|
path += [STANDALONE_DIR + '/board/e2000']
|
2023-08-29 10:27:54 +08:00
|
|
|
src += Glob(STANDALONE_DIR+'/board/e2000/q/*.c')
|
|
|
|
path += [STANDALONE_DIR + '/board/e2000/q']
|
2022-11-10 22:22:48 +08:00
|
|
|
|
2023-08-29 10:27:54 +08:00
|
|
|
if GetDepend(['TARGET_E2000D']):
|
|
|
|
src += Glob(STANDALONE_DIR+'/board/e2000/*.c')
|
|
|
|
path += [STANDALONE_DIR + '/board/e2000']
|
|
|
|
src += Glob(STANDALONE_DIR+'/board/e2000/d/*.c')
|
|
|
|
path += [STANDALONE_DIR + '/board/e2000/d']
|
2022-11-10 22:22:48 +08:00
|
|
|
|
2023-08-29 10:27:54 +08:00
|
|
|
if GetDepend(['ARGET_E2000S']):
|
|
|
|
src += Glob(STANDALONE_DIR+'/board/e2000/*.c')
|
|
|
|
path += [STANDALONE_DIR + '/board/e2000']
|
|
|
|
src += Glob(STANDALONE_DIR+'/board/e2000/s/*.c')
|
|
|
|
path += [STANDALONE_DIR + '/board/e2000/s']
|
2023-05-11 10:25:21 +08:00
|
|
|
|
2023-08-29 10:27:54 +08:00
|
|
|
if GetDepend(['TARGET_PHYTIUMPI']):
|
|
|
|
src += Glob(STANDALONE_DIR+'/board/phytium-pi/*.c')
|
|
|
|
path += [STANDALONE_DIR + '/board/phytium-pi']
|
|
|
|
|
2022-11-10 22:22:48 +08:00
|
|
|
if GetDepend(['TARGET_D2000']):
|
2023-05-11 10:25:21 +08:00
|
|
|
path += [STANDALONE_DIR + '/board/d2000']
|
2022-11-10 22:22:48 +08:00
|
|
|
|
|
|
|
# driver
|
|
|
|
|
2023-05-11 10:25:21 +08:00
|
|
|
## spim
|
|
|
|
if GetDepend(['BSP_USING_SPI']):
|
|
|
|
src += Glob(STANDALONE_DIR+'/drivers/spi/fspim/*.c')
|
|
|
|
path += [STANDALONE_DIR + '/drivers/spi/fspim']
|
|
|
|
|
2022-11-10 22:22:48 +08:00
|
|
|
## serial
|
2023-05-11 10:25:21 +08:00
|
|
|
if GetDepend(['BSP_USING_UART']):
|
2022-11-10 22:22:48 +08:00
|
|
|
src += Glob(STANDALONE_DIR+'/drivers/serial/fpl011/*.c')
|
2023-05-11 10:25:21 +08:00
|
|
|
path += [STANDALONE_DIR + '/drivers/serial/fpl011']
|
2022-11-10 22:22:48 +08:00
|
|
|
|
2023-05-11 10:25:21 +08:00
|
|
|
## can
|
|
|
|
if GetDepend(['BSP_USING_CAN']):
|
|
|
|
src += Glob(STANDALONE_DIR+'/drivers/can/fcan/*.c') + Glob(STANDALONE_DIR+'/drivers/can/fcan/*.S')
|
|
|
|
path += [STANDALONE_DIR + '/drivers/can/fcan/']
|
2022-11-10 22:22:48 +08:00
|
|
|
|
2023-05-11 10:25:21 +08:00
|
|
|
## qspi
|
|
|
|
if GetDepend(['BSP_USING_QSPI']):
|
|
|
|
src += Glob(STANDALONE_DIR+'/drivers/qspi/fqspi/*.c') + Glob(STANDALONE_DIR+'/drivers/qspi/fqspi/*.S')
|
|
|
|
path += [STANDALONE_DIR + '/drivers/qspi/fqspi/']
|
2022-11-10 22:22:48 +08:00
|
|
|
|
2023-08-02 13:27:09 +08:00
|
|
|
## eth
|
|
|
|
if GetDepend(['BSP_USING_ETH']):
|
|
|
|
src += Glob(STANDALONE_DIR+'/drivers/eth/fxmac/*.c') + Glob(STANDALONE_DIR+'/drivers/eth/fxmac/*.S')
|
|
|
|
path += [STANDALONE_DIR + '/drivers/eth/fxmac/'] + [STANDALONE_DIR + '/drivers/eth/fxmac/phy/']
|
|
|
|
|
|
|
|
## sdio
|
|
|
|
if GetDepend(['BSP_USING_SDIO']):
|
|
|
|
src += Glob(STANDALONE_DIR+'/drivers/mmc/fsdio/*.c') + Glob(STANDALONE_DIR+'/drivers/mmc/fsdio/*.S')
|
|
|
|
path += [STANDALONE_DIR + '/drivers/mmc/fsdio/']
|
|
|
|
|
|
|
|
## gpio
|
|
|
|
if GetDepend(['BSP_USING_GPIO']):
|
|
|
|
src += Glob(STANDALONE_DIR+'/drivers/pin/fgpio/*.c') + Glob(STANDALONE_DIR+'/drivers/pin/fgpio/*.S')
|
|
|
|
path += [STANDALONE_DIR + '/drivers/pin/fgpio/']
|
|
|
|
|
|
|
|
## iopad
|
|
|
|
if GetDepend(['ENABLE_IOPAD']):
|
|
|
|
src += Glob(STANDALONE_DIR+'/drivers/iopad/fiopad/*.c') + Glob(STANDALONE_DIR+'/drivers/iopad/fiopad/*.S')
|
|
|
|
path += [STANDALONE_DIR + '/drivers/iopad/fiopad/']
|
|
|
|
|
2022-11-10 22:22:48 +08:00
|
|
|
# phytium ports rt-thread drivers
|
|
|
|
PORT_DRV_DIR = cwd + '/drivers'
|
|
|
|
|
|
|
|
src += Glob(PORT_DRV_DIR + '/*.S')
|
2023-05-11 10:25:21 +08:00
|
|
|
src += Glob(PORT_DRV_DIR + '/*.c')
|
|
|
|
|
|
|
|
# phytium ports rt-thread examples
|
|
|
|
PORT_DRV_DIR = cwd + '/examples'
|
|
|
|
|
|
|
|
src += Glob(PORT_DRV_DIR + '/*.c')
|
|
|
|
|
|
|
|
# sdkcomfig.h
|
|
|
|
path += [cwd]
|
2022-11-10 22:22:48 +08:00
|
|
|
|
2023-05-11 10:25:21 +08:00
|
|
|
# add group
|
2022-11-10 22:22:48 +08:00
|
|
|
ASFLAGS = ''
|
|
|
|
group = DefineGroup('FT_DRIVER', src, depend=[
|
|
|
|
''], CPPPATH=path, ASFLAGS = ASFLAGS)
|
|
|
|
|
|
|
|
|
|
|
|
Return('group')
|