uboot的默认目标all

# Include autoconf.mk before config.mk so that the config options are available
# to all top level build files.  We need the dummy all: target to prevent the
# dependency target in autoconf.mk.dep from being the default.
all:
sinclude $(obj)include/autoconf.mk.dep
sinclude $(obj)include/autoconf.mk

乍一看这几句话,以为uboot是要构建 autoconf.mk.dep和 autoconf.mk。肯定不是,换种写法会更好看一点。

# Include autoconf.mk before config.mk so that the config options are available
# to all top level build files.  We need the dummy all: target to prevent the
# dependency target in autoconf.mk.dep from being the default.
all:


sinclude $(obj)include/autoconf.mk.dep
sinclude $(obj)include/autoconf.mk

看英文部分注释,需要这个仿制品(dummy)all来避免autoconf.mk.dep的目标变为默认目标。

Makefile中共有三个all目标,最后的那个all只在你还没执行make xxxx_config 配置的时候会执行且提示你系统还没配置呢!第一个和第二个all在执行了make xxxx_config配置后生效。当它又遇到后面的all时,make会将两次的依赖整合起来,这个语法是make所支持的。

所以这个all就是摆设在这里充当默认目标的。

这篇文章写的很好,关于uboot顶层Makefile的分析:uboot makefile构建分析

你可能感兴趣的:(uboot)