的Makefile:当功能被称为
问题描述:
我们准备创建有关ucore.img目标文件的Makefile:当功能被称为
$(kernel):
@echo test
$(call create_target,kernel)
# -------------------------------------------------------------------
bootblock = $(call totarget,bootblock)
$(bootblock): $(call toobj,boot/bootasm.S) $(call toobj,$(bootfiles))
@echo + ld [email protected]
$(call create_target,bootblock)
# -------------------------------------------------------------------
$(call create_target_host,sign,sign)
# -------------------------------------------------------------------
# create ucore.img
UCOREIMG := $(call totarget,ucore.img)
$(UCOREIMG): $(kernel) $(bootblock)
$(V)dd if=/dev/zero [email protected] count=10000
$(call create_target,ucore.img)
但我不能看到当这些功能有关call
将被称为
$(call create_target,kernel)
$(call create_target,bootblock)
$(call create_target,ucore.img)
答
我真的不明白你问的问题。由于这些函数显示为正常的makefile语句,而不是在配方内或正常(递归)赋值语句的右侧,它们将在解析生成文件时展开。
所以,当提出的是读你的makefile,它看到行:
$(call create_target,kernel)
将扩大在这个时候,call
函数的引用,试图解析下一行之前。您不会告诉我们任何实际的宏定义是什么create_target
,totarget
,toobj
,因此我们无法提供任何有关该扩展结果的信息。