• uboot 顶层Makefile-make xxx_deconfig过程说明三


    一. 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

    同上一篇文章类似分析。各个变量值如下:

    1. src= scripts/kconfig
    2. kbuild-dir = ./scripts/kconfig
    3. kbuild-file = ./scripts/kconfig/Makefile
    4. include ./scripts/kconfig/Makefile

    可以看出, Makefilke.build 会读取 scripts/kconfig/Makefile 中的内容,此文件有如下所示内
    容:
    1. 113 %_defconfig: $(obj)/conf
    2. 114 $(Q)$< $(silent) --defconfig=arch/$(SRCARCH)/configs/$@
    3. $(Kconfig)
    4. 115
    5. 116 # Added for U-Boot (backward compatibility)
    6. 117 %_config: %_defconfig
    7. 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)

    其中,变量值为:

    1. silent=-s 或为空
    2. SRCARCH=..
    3. 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 是怎么生成的了。

  • 相关阅读:
    windows 离线安装 vue 环境
    工具大全使用
    compression记录(compress)
    【C语言】初识指针(终篇)
    14条最佳JavaScript代码编写技巧
    基于STM32结合CubeMX学习Free-RT-OS的源码之信号量与互斥量
    微服务实践k8s&dapr开发部署实验(3)订阅发布
    进程(1)——什么是进程?【linux】
    接口自动化测试用例如何设计
    SpringMVC基础概述
  • 原文地址:https://blog.csdn.net/wojiaxiaohuang2014/article/details/132865645