编译uboot的过程分析

This commit is contained in:
weidongshan
2023-05-15 00:50:47 +08:00
parent 79a6a28a54
commit f7959b7669
2 changed files with 20 additions and 16 deletions

View File

@@ -359,14 +359,16 @@ endif
![](pic/10_u-boot_cfg.png)
## 5.3 编译过程详细分析(IMX6ULL)
### 5.3.1 结论
以IMX6ULL为例先说结论
![image-20230423141920708](pic/12_create_imx.png)
细节如下:
* 执行make命令时要编译得到哪些文件由`ALL-y`决定
* 规则如下
@@ -434,7 +436,6 @@ endif
$(DTB): arch-dtbs
$(obj)/dt.dtb: $(DTB) FORCE
$(call if_changed,shipped)
targets += dt.dtb
$(DTB): arch-dtbs
@@ -472,7 +473,10 @@ endif
### 5.3.2 顶层Makefile
顶层Makefile里指定了第1个文件head-y、指定了要编译哪些子目录libs-y
顶层Makefile里
* 包含架构相关的Makefile里面指定了第1个文件head-y
* 指定了要编译哪些子目录libs-y
从顶层Makefile开始分析
@@ -551,7 +555,7 @@ $(u-boot-dirs): prepare scripts
然后使用scripts/Makefile.build进行处理$(Q)$(MAKE) $(build)=$@ ,展开就是:
```shell
make -f /scripts/Makefile.build obj=arch/arm/cpu/armv7/
make -f scripts/Makefile.build obj=arch/arm/cpu/armv7/
```
scripts/Makefile.build是编译u-boot源码的关键