linux makefile指令无法执行最后的clean 30
具体的执行过程和makefile文件如下Tab键是有的#makefilegdb:gdb1.ogdb2.ogdb3.ogccgdb1.ogdb2.ogdb3.o-ogdbg...
具体的执行过程和makefile文件如下 Tab键是有的
#makefile
gdb:gdb1.o gdb2.o gdb3.o
gcc gdb1.o gdb2.o gdb3.o -o gdb
gdb1.o:gdb1.c
gcc -c gdb1.c
gdb2.o:gdb2.c
gcc -c gdb2.c
gdb3.o:gdb3.c
gcc -c gdb3.c
.PHONY:clean
clean:
rm *.o
[root@localhost temp]# make
gcc -c gdb1.c
gdb1.c: In function ‘main’:
gdb1.c:3: warning: return type of ‘main’ is not ‘int’
gcc gdb1.o gdb2.o gdb3.o -o gdb
[root@localhost temp]# ls
a.out gdb1.c gdb2.o hello.c optimize.c s5 s8
gcc_text.c gdb1.o gdb3.c hi.sh s3 s6 s9
gdb gdb2.c gdb3.o makefile s4 s7 tst
[root@localhost temp]# vi makefile
[root@localhost temp]#
刚刚用make clean试了一下是可以执行rm *.o命令的 展开
#makefile
gdb:gdb1.o gdb2.o gdb3.o
gcc gdb1.o gdb2.o gdb3.o -o gdb
gdb1.o:gdb1.c
gcc -c gdb1.c
gdb2.o:gdb2.c
gcc -c gdb2.c
gdb3.o:gdb3.c
gcc -c gdb3.c
.PHONY:clean
clean:
rm *.o
[root@localhost temp]# make
gcc -c gdb1.c
gdb1.c: In function ‘main’:
gdb1.c:3: warning: return type of ‘main’ is not ‘int’
gcc gdb1.o gdb2.o gdb3.o -o gdb
[root@localhost temp]# ls
a.out gdb1.c gdb2.o hello.c optimize.c s5 s8
gcc_text.c gdb1.o gdb3.c hi.sh s3 s6 s9
gdb gdb2.c gdb3.o makefile s4 s7 tst
[root@localhost temp]# vi makefile
[root@localhost temp]#
刚刚用make clean试了一下是可以执行rm *.o命令的 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询