1
請考慮下面的MakefileGNU的奇怪行爲,當使用``%``爲目標
foo:
@echo '[email protected]'
test:
@echo '[email protected]'
@echo '---'
# Catch-all target
%: test
@echo '+++'
@echo '[email protected]'
當發出make bar
以下是控制檯輸出:
$ make bar
test
---
+++
Makefile
+++
bar
我我想了解Makefile
的來源,它表明它在某個時刻被作爲參數接受,並且也知道如何在這樣的方案中擺脫它。這是使用
GNU Make 4.1
Built for x86_64-apple-darwin13.4.0
確定,很清楚的感謝。 – jfbu
'IIRC,它必須在捕獲所有目標之前'這不應該是必須的,匹配任何規則只有在沒有其他規則匹配時纔會考慮。 – user657267
@ user657267你是對的。 –