Makefile 没有检测到我设置的规则

问题描述 投票:0回答:1

我创建了一个 makefile,并声明了 2 条规则,测试和清理,当我尝试运行 make 时,它无法识别这些规则,并且出现错误。

这是我写的代码:

PYTHON = python3

test: test.in
    $(PYTHON) process.py $< out.txt

clean:
    rm -f out.txt

我尝试运行 make clean 或 make test,但出现以下错误:

make: *** No rule to make target 
测试'。停下来。`

我位于正确的目录中,这是目录内容的列表:

 % ls Makefile.mk     process.py      test.in

任何帮助将不胜感激,因为这是我第一次创建 makefile

python makefile
1个回答
0
投票

Makefile 命名不正确,我以为它需要文件扩展名,但错了。

© www.soinside.com 2019 - 2024. All rights reserved.