'清洁'不起作用 [英] 'make clean' not working
问题描述
所以我为c程序制作了一个makefile.由于某种原因,我的清理"无法正常工作.这是我的makefile文件的一部分:
so I made a makefile for a c program. For some reason my 'clean' is not working. Here's a little bit of my makefile:
CC=gcc
FLAGS=-c -Wall -I.
CLEANC=rm -rf *.o
move.o: move.c
$(CC) $(FLAGS) move.c
/*Lot more codes like this^^^*/
clean:
$(CLEANC)
在命令提示符下运行"make clean"时,显示以下信息:
When I run 'make clean' in command prompt, I'm shown the following:
rm -rf *.o
process_begin: CreateProcess(NULL, rm -rf *.o, ...) failed.
make (e=2): The system cannot find the file specified.
makefile:116: recipe for target 'clean' failed
make: *** [clean] Error 2
我不知道自己在做什么错.我尝试将CLEANC更改为
I can't figure out what I'm doing wrong. I've tried changing CLEANC to
rm -f *.o
rm *.o
rm *o
rm -f *.o test.exe //test.exe is executable
但是无论我尝试什么,它仍然给我同样的错误.我真的可以使用帮助.提前致谢.
but it still gave me the same error no matter what I tried. I could really use the help. Thanks in advance.
推荐答案
从出现在错误输出中的CreateProcess
来看,我假设您正在Windows下运行make
.
Judging from the CreateProcess
appearing in your error output I assume you are running make
under Windows.
这意味着没有rm
命令,应改用del
,并且还应相应调整-rf
标志.
This means that there is no rm
command, you should use del
instead and -rf
flags should also be adjusted accordingly.
这篇关于'清洁'不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!