一.makefile 中的同名目标
下面程序怎么执行?为什么?
实验1 :makefile 中出现同名目标时
.PHONY : all
all :
@echo "command-1"
all :
@echo "command-2"
VAR := test
all :
@echo "all : $(VAR)"
mhr@ubuntu:~/work/makefile1$ make all
makefile:12: warning: overriding recipe for target 'all'
makefile:8: warning: ignoring old recipe for target 'all'
all : test
mhr@ubuntu:~/work/makefile1$
mhr@ubuntu:~/work/makefile1$
以最新定义的命令为准,之前定义的全部忽略。
过程:当make解释器解析这个makefile到 @echo “command-2” 的时候 ,就会将 @echo “com