4
0
mirror of https://github.com/RT-Thread/rt-thread.git synced 2025-01-19 17:03:29 +08:00
zhugengyu 1537544f6a
[bsp/phytium] add phytium bsp to support e2000 bootup with smp (#6566)
add phytium board (E2000) bsp
support usart
support SMP with demo
2022-11-10 09:22:48 -05:00

59 lines
1.5 KiB
Python

import os
import sys
import rtconfig
IS_EXPORTED = False
# setup RT-Thread Root Path
if os.getenv('RTT_ROOT'):
RTT_ROOT = os.getenv('RTT_ROOT')
else:
RTT_ROOT = os.getcwd() + '/../../..'
sys.path = sys.path + [os.path.join(RTT_ROOT, 'tools')]
try:
from building import *
except:
print('Cannot found RT-Thread root directory, please check RTT_ROOT')
print(RTT_ROOT)
exit(-1)
if RTT_ROOT == 'rt-thread':
IS_EXPORTED = True # if kenrel and bsp has been exported by export_project.py
# setup Phytium BSP Root Path
if IS_EXPORTED:
BSP_ROOT = '.'
else:
BSP_ROOT = RTT_ROOT + '/bsp/phytium'
TARGET = 'rtthread_a64.' + rtconfig.TARGET_EXT
DefaultEnvironment(tools=[])
env = Environment(tools = ['mingw'],
AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
CC = rtconfig.CC, CFLAGS = rtconfig.CFLAGS,
CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CXXFLAGS,
AR = rtconfig.AR, ARFLAGS = '-rc',
LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS)
env.PrependENVPath('PATH', rtconfig.EXEC_PATH)
env['ASCOM'] = env['ASPPCOM']
Export('RTT_ROOT')
Export('BSP_ROOT')
Export('rtconfig')
# prepare building environment
objs = PrepareBuilding(env, RTT_ROOT, has_libcpu = False)
if not IS_EXPORTED: # if project is not exported, libraries and board need to manually add
# include libraries
objs.extend(SConscript(os.path.join(BSP_ROOT + '/libraries', 'SConscript')))
# include board
objs.extend(SConscript(os.path.join(BSP_ROOT + '/board', 'SConscript')))
# make a building
DoBuilding(TARGET, objs)