- 论坛徽章:
- 0
|
makefile如下:
main:main.c fun1.c fun2.c
gcc fun1.c fun2.c main.c -o main
clean:
rm fun
1,在命令行下面输入:make 后编译成功,rm命令没有执行,我把他解释成clean目标的依赖并不比clean新
但是,为什么执行make clean 后,rm命令就执行了呢,clean目标的依赖依旧不比clean新阿
之所以提出这个问题是因为 执行make main并不引起对gcc命令的执行(前提是前面已经执行过make),这说明make后面加上目标名称,并不会引起强行执行目标所对应的指令
2,而gun make上说
clean:
rm -f *.o lexer.c
Normally, phony targets will always be executed because the commands associated with the rule do not create the target name.
我试验过了,clean默认是不执行的,到底是怎么回事啊
[ 本帖最后由 xdshting 于 2008-12-13 23:16 编辑 ] |
|