mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-10-02 14:23:19 +08:00
ToolsCI / Tools (push) Has been cancelled
RT-Thread BSP Static Build Check / 🔍 Summary of Git Diff Changes (push) Has been cancelled
pkgs_test / change (push) Has been cancelled
utest_auto_run / A9 :components/dfs.cfg (push) Has been cancelled
utest_auto_run / A9 :components/lwip.cfg (push) Has been cancelled
utest_auto_run / A9 :components/netdev.cfg (push) Has been cancelled
utest_auto_run / A9 :components/sal.cfg (push) Has been cancelled
utest_auto_run / A9 :cpp11/cpp11.cfg (push) Has been cancelled
utest_auto_run / AARCH64-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / A9-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / RISCV-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / XUANTIE-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / AARCH64 :default.cfg (push) Has been cancelled
utest_auto_run / AARCH64-smp :default.cfg (push) Has been cancelled
utest_auto_run / A9 :default.cfg (push) Has been cancelled
utest_auto_run / A9-smp :default.cfg (push) Has been cancelled
utest_auto_run / RISCV :default.cfg (push) Has been cancelled
utest_auto_run / RISCV-smp :default.cfg (push) Has been cancelled
utest_auto_run / A9 :kernel/atomic_c11.cfg (push) Has been cancelled
utest_auto_run / RISCV :kernel/atomic_c11.cfg (push) Has been cancelled
utest_auto_run / A9-rtsmart :kernel/ipc.cfg (push) Has been cancelled
utest_auto_run / RISCV-rtsmart :kernel/ipc.cfg (push) Has been cancelled
utest_auto_run / XUANTIE-rtsmart :kernel/ipc.cfg (push) Has been cancelled
utest_auto_run / A9 :kernel/ipc.cfg (push) Has been cancelled
utest_auto_run / A9-smp :kernel/ipc.cfg (push) Has been cancelled
utest_auto_run / RISCV :kernel/ipc.cfg (push) Has been cancelled
utest_auto_run / A9-rtsmart :kernel/kernel_basic.cfg (push) Has been cancelled
utest_auto_run / RISCV-rtsmart :kernel/kernel_basic.cfg (push) Has been cancelled
utest_auto_run / XUANTIE-rtsmart :kernel/kernel_basic.cfg (push) Has been cancelled
utest_auto_run / A9 :kernel/kernel_basic.cfg (push) Has been cancelled
utest_auto_run / A9-smp :kernel/kernel_basic.cfg (push) Has been cancelled
utest_auto_run / RISCV :kernel/kernel_basic.cfg (push) Has been cancelled
utest_auto_run / AARCH64-rtsmart :kernel/mem.cfg (push) Has been cancelled
utest_auto_run / A9-rtsmart :kernel/mem.cfg (push) Has been cancelled
utest_auto_run / RISCV-rtsmart :kernel/mem.cfg (push) Has been cancelled
utest_auto_run / XUANTIE-rtsmart :kernel/mem.cfg (push) Has been cancelled
utest_auto_run / AARCH64 :kernel/mem.cfg (push) Has been cancelled
utest_auto_run / AARCH64-smp :kernel/mem.cfg (push) Has been cancelled
utest_auto_run / A9 :kernel/mem.cfg (push) Has been cancelled
utest_auto_run / A9-smp :kernel/mem.cfg (push) Has been cancelled
utest_auto_run / RISCV :kernel/mem.cfg (push) Has been cancelled
utest_auto_run / RISCV-smp :kernel/mem.cfg (push) Has been cancelled
RT-Thread BSP Static Build Check / ${{ matrix.legs.RTT_BSP }} (push) Has been cancelled
RT-Thread BSP Static Build Check / collect-artifacts (push) Has been cancelled
* 添加 rdk_s100 bsp * 添加 CI 看护
79 lines
2.2 KiB
Python
79 lines
2.2 KiB
Python
import os
|
|
import sys
|
|
import rtconfig
|
|
|
|
if os.getenv('RTT_ROOT'):
|
|
RTT_ROOT = os.getenv('RTT_ROOT')
|
|
else:
|
|
RTT_ROOT = os.path.join(os.getcwd(), '..', '..', '..')
|
|
|
|
sys.path = sys.path + [os.path.join(RTT_ROOT, 'tools')]
|
|
from building import *
|
|
|
|
TARGET = 'rtthread.' + 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('rtconfig')
|
|
|
|
# prepare building environment
|
|
objs = PrepareBuilding(env, RTT_ROOT)
|
|
|
|
def _replace_cortex_r52_with_startup(objects):
|
|
startup_dir = os.path.join(Dir('#').abspath, 'startup')
|
|
startup_names = set(
|
|
name for name in os.listdir(startup_dir)
|
|
if os.path.isfile(os.path.join(startup_dir, name))
|
|
)
|
|
cpu_dir = os.path.abspath(os.path.join(RTT_ROOT, 'libcpu', rtconfig.ARCH, rtconfig.CPU))
|
|
|
|
def _source_path(node):
|
|
for attr in ('srcnode', 'rfile'):
|
|
if hasattr(node, attr):
|
|
source = getattr(node, attr)()
|
|
if hasattr(source, 'abspath'):
|
|
return os.path.abspath(source.abspath)
|
|
if hasattr(node, 'abspath'):
|
|
return os.path.abspath(node.abspath)
|
|
return None
|
|
|
|
def _filter(items):
|
|
filtered = []
|
|
for item in items:
|
|
if isinstance(item, list):
|
|
filtered.append(_filter(item))
|
|
continue
|
|
|
|
if not hasattr(item, 'abspath'):
|
|
filtered.append(item)
|
|
continue
|
|
|
|
item_path = _source_path(item)
|
|
if item_path is None:
|
|
filtered.append(item)
|
|
continue
|
|
|
|
item_name = os.path.basename(item_path)
|
|
if item_name in startup_names and item_path.startswith(cpu_dir + os.sep):
|
|
continue
|
|
|
|
filtered.append(item)
|
|
|
|
return filtered
|
|
|
|
return _filter(objects)
|
|
|
|
objs = _replace_cortex_r52_with_startup(objs)
|
|
|
|
# make a building
|
|
DoBuilding(TARGET, objs)
|