其中有这样一个规则
config: scripts_basic outputmakefile FORCE
$(Q)mkdir -p include/linux include/config
$(Q)$(MAKE) $(build)=scripts/kconfig $@
请问
第一:$(build)中的build变量在哪里定义?
第二:[email protected],那该规则岂不成无限循环了?
------解决方案--------------------
第一:build可能不在顶层makefile里定义,而在别处定义。
第二:[email protected]
想了解更多,最好参考《跟我一起写makefile>>
------解决方案--------------------
1. build 定义在 scrips/Kbuild.include 文件中, 定义如下:
build :=-f $(if$(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
2. build可以看出, $(buidl)作为make的参数,指定了新的makefile。 所以不用担心make会循环执行这个规则,因为执行的是定义在-f指定的makefile文件中的新规则。