一. uboot 的 make xxx_deconfig配置
本文接上一篇文章的内容。地址如下:uboot 顶层Makefile-make xxx_deconfig过程说明二_凌肖战的博客-CSDN博客
本文继续来学习 uboot 源码在执行 make xxx_deconfig 这个配置过程中,顶层 Makefile有关的执行思路。
uboot执行配置过程时,执行了两条关键命令。本文分析第二条命令:
    make -f ./scripts/Makefile.build obj=scripts/kconfig xxx_defconfig二. %config目标对应的命令
 
 %config 目 标 对 应 的 命 令 为 : 
  
 
    make -f ./scripts/Makefile.build obj=scripts/kconfig xxx_defconfig同上一篇文章类似分析。各个变量值如下:
src= scripts/kconfig
kbuild-dir = ./scripts/kconfig
kbuild-file = ./scripts/kconfig/Makefile
include ./scripts/kconfig/Makefile 
 可以看出, 
 Makefilke.build  
 会读取  
 scripts/kconfig/Makefile  
 中的内容,此文件有如下所示内  
 
 
 容:  
 
 
113 %_defconfig: $(obj)/conf
114 $(Q)$< $(silent) --defconfig=arch/$(SRCARCH)/configs/$@ 
$(Kconfig)
115
116 # Added for U-Boot (backward compatibility)
117 %_config: %_defconfig
118 @: 
  目标  
  %_defconfig  
  刚好和我们输入的  
  xxx_defconfig  
  匹配,所以,会执行这条规则。 
 
 
 
 依赖为  
 $(obj)/conf 
 ,展开后就是  
 scripts/kconfig/conf 
 。 
 
 
 接下来,就是检查并生成依赖  
 scripts/kconfig/conf 
 。  
 
 
 conf  
 是主机软件,到这里我们就不要纠结  
 conf  
 是怎么编译出来的, 
 像  
 conf  
 这种主机所使用的工具类软件我们一般不关心它是如何编译产生的。 
 
 
 
 
 
 
 
 得到  
 scripts/kconfig/conf  
 以后,就要执行目标  
 %_defconfig  
 的命令:  
 
 
$(Q)$< $(silent) --defconfig=arch/$(SRCARCH)/configs/$@ $(Kconfig)其中,变量值为:
silent=-s 或为空
SRCARCH=..
Kconfig=Kconfig 
 目标  
 %_defconfig 的命令,展开后:  
 
 
 @scripts/kconfig/conf --defconfig=arch/../configs/xxx_defconfig Kconfig 
 上述命令用到了  
 xxx_defconfig  
 文件,比如  
 mx6ull_alientek_nand_defconfig 
 。这里会将  
 
 
 mx6ull_alientek_emmc_defconfig  
 中的配置输出到 
  .config  
 文件中,最终生成  
 uboot  
 根目录下  
 
 
 的 
 .config  
 文件。  
 
 
 
 
 
三. uboot的make xxx_deconfig 总结
 
 这个就是uboot配置命令  
 make xxx_defconfig  
 执行流程,总体执行思路如下: 
 
 
 

 
 至此,uboot配置命令  
 make xxx_defconfig对应,顶层Makefile大体思路 
 就分析完了,接下来就要分析一下  
 u-boot.bin  
 是怎么生成的了。  
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
                








![[Linux]进程间通信--管道](https://img-blog.csdnimg.cn/img_convert/cfb1a6a1be21f941483920c1091c7022.gif)









