2016-12-29 52 views
1

我們準備創建有關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) 

回答

0

我真的不明白你問的問題。由於這些函數顯示爲正常的makefile語句,而不是在配方內或正常(遞歸)賦值語句的右側,它們將在解析生成文件時展開。

所以,當提出的是讀你的makefile,它看到行:

$(call create_target,kernel) 

將擴大在這個時候,call函數的引用,試圖解析下一行之前。您不會告訴我們任何實際的宏定義是什麼create_target,totarget,toobj,因此我們無法提供任何有關該擴展結果的信息。