2
假設我有一個Makefile:依賴Makefile中
all: $(BINARY)
$(BINARY): $(OBJS) $(DEBUG_OBJS)
#Link objects here
$(OBJS): headers
#Compile code into objects without debug option
$(DEBUG_OBJS): headers
#Compile code into objects with debug option
headers:
#Create on-the-fly header files
正如你所看到的,目標headers
由兩個$(OBJS)
和$(DEBUG_OBJS)
需要。問題是,headers
會被調用兩次嗎?此外,將下面的代碼等於/相當於上面:
all: $(BINARY)
$(BINARY): headers $(OBJS) $(DEBUG_OBJS)
#Link objects here
$(OBJS):
#Compile code into objects without debug option
$(DEBUG_OBJS):
#Compile code into objects with debug option
headers:
#Create on-the-fly header files
在
,將頭得到$(OBJS)
和$(DEBUG_OBJS)
通過$(BINARY)
之前叫什麼名字?
非常感謝! – Sagar 2010-12-01 19:58:22