没有规则来制作目标`-f'

Pra*_*nna 1 linux terminal makefile remote-server

我正在尝试制作ac文件

make –f makefile1
Run Code Online (Sandbox Code Playgroud)

这是我的make文件:

TestAssn1: test_assign1_1.o dberror.o storage_mgr.o
        cc -o TestAssn1 test_assign1_1.o dberror.o storage_mgr.o
test_assign1_1.o: test_assign1_1.c test_helper.h dberror.h storage_mgr.h
        cc -c test_assign1_1.c
dberror.o: dberror.c dberror.h
        cc -c dberror.c
storage_mgr.o: storage_mgr.c storage_mgr.h dberror.h
        cc -c storage_mgr.c
Run Code Online (Sandbox Code Playgroud)

但我只收到这条消息:

make: *** No rule to make target `–f'.  Stop.
Run Code Online (Sandbox Code Playgroud)

我该怎么纠正这个?

l0b*_*0b0 5

您需要在命令中使用普通的破折号(-)而不是破折号.

我的猜测是你从博客或其他网络资源中复制了这个命令.许多博客/网络框架都有一个错误,即使在代码格式化的文本中,他们也会用印刷版的正确对应方替换打字机标点符号.