makefile中命令'-rm'中的破折号表示什么?

makefile中命令'-rm'中的破折号表示什么?,makefile,gnu-make,Makefile,Gnu Make,今天我在makefile里看到了一些奇怪的东西 -rm中的-是打字错误,还是有什么意思 appname = hello obj = hello.o gcc = gcc cflags = -g -Wall $(appname):$(obj) $(gcc) $(cflags) $(obj) -o $(app) -lpthread # p_test.o:p_test.c # $(gcc) $(cflags) -c hello.c .PHONY:clean clean: -r

今天我在makefile里看到了一些奇怪的东西

-rm
中的
-
是打字错误,还是有什么意思

appname = hello
obj = hello.o
gcc = gcc
cflags = -g -Wall

$(appname):$(obj)
    $(gcc) $(cflags) $(obj) -o $(app) -lpthread

# p_test.o:p_test.c
#   $(gcc) $(cflags) -c  hello.c

.PHONY:clean
clean:
    -rm $(obj)

.PHONY:run
run:
    ./hello 1

这意味着忽略错误,请参阅

因此,如果在发出
make clean
$(obj)
不存在,则您的
make
不会失败