为什么我的 make 命令仍然显示 "No targets ..."?

Why my make command still says "No targets ..."?

我是Makefile的新手,我试着做一个最简单的Makefile。但是我不明白为什么即使我清楚地位于 Makefile 的正确路径中,make 命令仍然显示“make: *** No targets specified and no makefile found. Stop.”?~

这是我的 Makefile 内容:

 CC=gcc
 CFLAGS=-I.

 exercise1: exercise1.c
     $(CC) -o exercise1 exercise1.c

..TH\Week1 中的文件:exercise1.c,Makefile

尝试以下操作,看看是否有效。确保文件名或任何内容中没有拼写错误。

CC = gcc

exercise1: exercise1.c
    $(CC) -o $@ exercise1.c

也可以尝试 运行 使用这样的目标名称:

make exercise1

我刚刚尝试将 Exercise1 文件夹复制到其他地方,并且成功了!我终于找到了错误。它位于 Makefile 的路径名中。该路径经过名为LT Mạng 的目录,似乎cmd/Powershell/Terminal 无法读取特殊字符。只需再次更改此文件夹的名称,例如:LT Mang。它工作正常。