diff --git a/tools/docs/README.md b/tools/docs/README.md index 295f6a4c03..a1c34073cb 100644 --- a/tools/docs/README.md +++ b/tools/docs/README.md @@ -69,33 +69,7 @@ pkgs --list # 列出已安装包 ## 构建系统架构图 -``` -┌─────────────────────────────────────┐ -│ 用户命令 (scons) │ -└──────────────┬──────────────────────┘ - │ -┌──────────────▼──────────────────────┐ -│ SConstruct (主脚本) │ -│ ┌─────────────────────┐ │ -│ │ PrepareBuilding() │ │ -│ │ 环境初始化 │ │ -│ └──────────┬──────────┘ │ -└────────────────┼───────────────────┘ - │ -┌────────────────▼────────────────────┐ -│ building.py │ -│ ┌──────────┬──────────┐ │ -│ │ 组件收集 │ 依赖处理 │ │ -│ └──────────┴──────────┘ │ -└─────────────────────────────────────┘ - │ - ┌────────┴────────┐ - │ │ -┌───────▼──────┐ ┌────────▼────────┐ -│ SConscript │ │ rtconfig.h │ -│ 组件脚本 │ │ 功能配置 │ -└──────────────┘ └─────────────────┘ -``` +![arch](./readme_arch.drawio.png) ## 主要特性 diff --git a/tools/docs/guide_arch.drawio.png b/tools/docs/guide_arch.drawio.png new file mode 100644 index 0000000000..d2e4945744 Binary files /dev/null and b/tools/docs/guide_arch.drawio.png differ diff --git a/tools/docs/process.drawio.png b/tools/docs/process.drawio.png new file mode 100644 index 0000000000..af03d7593e Binary files /dev/null and b/tools/docs/process.drawio.png differ diff --git a/tools/docs/readme_arch.drawio.png b/tools/docs/readme_arch.drawio.png new file mode 100644 index 0000000000..ab50274cd2 Binary files /dev/null and b/tools/docs/readme_arch.drawio.png differ diff --git a/tools/docs/tech_arch.drawio.png b/tools/docs/tech_arch.drawio.png new file mode 100644 index 0000000000..901f665168 Binary files /dev/null and b/tools/docs/tech_arch.drawio.png differ diff --git a/tools/docs/构建系统使用指南.md b/tools/docs/构建系统使用指南.md index 1e54f1d4d9..c2ed136a2e 100644 --- a/tools/docs/构建系统使用指南.md +++ b/tools/docs/构建系统使用指南.md @@ -23,32 +23,7 @@ RT-Thread使用基于SCons的构建系统,提供了统一的跨平台构建体 ### 系统架构图 -``` -┌─────────────────────────────────────────────────────────────┐ -│ 用户命令 │ -│ (scons, scons --target=xxx) │ -└─────────────────────┬───────────────────────────────────────┘ - │ -┌─────────────────────▼───────────────────────────────────────┐ -│ SConstruct │ -│ (BSP根目录构建脚本) │ -└─────────────────────┬───────────────────────────────────────┘ - │ -┌─────────────────────▼───────────────────────────────────────┐ -│ building.py │ -│ (核心构建引擎和函数库) │ -├─────────────────────┬───────────────────────────────────────┤ -│ PrepareBuilding() │ DefineGroup() │ DoBuilding() │ -│ 环境初始化 │ 组件定义 │ 执行构建 │ -└─────────────────────┴─────────┬─────────────────────────────┘ - │ - ┌───────────────────────┼───────────────────────┐ - │ │ │ -┌───────▼────────┐ ┌────────▼────────┐ ┌────────▼────────┐ -│ SConscript │ │ rtconfig.py │ │ rtconfig.h │ -│ (组件脚本) │ │ (工具链配置) │ │ (功能配置) │ -└────────────────┘ └─────────────────┘ └─────────────────┘ -``` +![arch](./guide_arch.drawio.png) ## 快速开始 diff --git a/tools/docs/构建系统技术原理.md b/tools/docs/构建系统技术原理.md index d0a9ac0aaa..4fb1608c99 100644 --- a/tools/docs/构建系统技术原理.md +++ b/tools/docs/构建系统技术原理.md @@ -15,40 +15,7 @@ ### 整体架构图 -``` -┌────────────────────────────────────────────────────────────────────┐ -│ 用户接口层 │ -│ ┌─────────────┐ ┌──────────────┐ ┌─────────────┐ ┌──────────┐│ -│ │ 命令行接口 │ │ menuconfig │ │ 环境变量 │ │ 配置文件 ││ -│ │ (scons) │ │ (Kconfig) │ │ (RTT_xxx) │ │ (.config)││ -│ └──────┬──────┘ └──────┬───────┘ └──────┬──────┘ └─────┬────┘│ -└─────────┼─────────────────┼──────────────────┼───────────────┼─────┘ - │ │ │ │ -┌─────────▼─────────────────▼──────────────────▼───────────────▼─────┐ -│ 构建引擎层 │ -│ ┌─────────────────────────────────────────────────────────────┐ │ -│ │ building.py │ │ -│ ├─────────────┬───────────────┬─────────────┬────────────────┤ │ -│ │ 环境准备 │ 组件收集 │ 依赖处理 │ 构建执行 │ │ -│ │ Prepare │ DefineGroup │ GetDepend │ DoBuilding │ │ -│ └─────────────┴───────────────┴─────────────┴────────────────┘ │ -└────────────────────────────────────────────────────────────────────┘ - │ │ │ │ -┌─────────▼─────────────────▼──────────────────▼───────────────▼─────┐ -│ 工具支撑层 │ -│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌─────────┐ ┌──────┐│ -│ │ utils.py │ │options.py│ │package.py│ │mkdist.py│ │预处理││ -│ │ 工具函数 │ │命令选项 │ │包管理 │ │分发打包 │ │器 ││ -│ └──────────┘ └──────────┘ └──────────┘ └─────────┘ └──────┘│ -└────────────────────────────────────────────────────────────────────┘ - │ │ │ │ -┌─────────▼─────────────────▼──────────────────▼───────────────▼─────┐ -│ 目标生成器层 │ -│ ┌────────┐ ┌────────┐ ┌────────┐ ┌────────┐ ┌────────────┐ │ -│ │keil.py │ │iar.py │ │gcc.py │ │vsc.py │ │cmake.py等 │ │ -│ └────────┘ └────────┘ └────────┘ └────────┘ └────────────┘ │ -└────────────────────────────────────────────────────────────────────┘ -``` +![arch](./tech_arch.drawio.png) ### 设计原则 @@ -598,45 +565,7 @@ def MkDist_Strip(program, BSP_ROOT, RTT_ROOT, Env): ### 完整构建流程图 -``` -┌──────────────┐ -│ 用户输入 │ -│ scons │ -└──────┬───────┘ - │ -┌──────▼───────┐ -│ SConstruct │ ← 读取rtconfig.py -│ 主脚本 │ ← 调用PrepareBuilding -└──────┬───────┘ - │ -┌──────▼───────┐ -│ 环境初始化 │ -│ ·设置路径 │ -│ ·检测工具链 │ -│ ·解析配置 │ -└──────┬───────┘ - │ -┌──────▼───────┐ -│ 递归处理 │ -│ SConscript │ ← 调用DefineGroup -│ ·收集源文件 │ ← 检查依赖GetDepend -│ ·设置参数 │ -└──────┬───────┘ - │ -┌──────▼───────┐ -│ 构建执行 │ -│ DoBuilding │ -│ ·合并对象 │ -│ ·链接程序 │ -└──────┬───────┘ - │ -┌──────▼───────┐ -│ 后处理 │ -│ ·生成bin文件 │ -│ ·显示大小 │ -│ ·自定义动作 │ -└──────────────┘ -``` +![process](./process.drawio.png) ### 依赖解析流程