【问题标题】:makefile erro " *** No target specified and no makefile found.stop."生成文件错误“ *** 未指定目标且未找到生成文件。停止。”
【发布时间】:2015-03-09 14:05:31
【问题描述】:

我有一个包含此代码的生成文件

all: hello.exe

hello.exe: hello.o
     gcc -o hello.exe hello.o

hello.o: hello.c
     gcc -c hello.c

clean:
     rm hello.o hello.exe

当我写这个命令时

  mingh32-make

我知道了:

  mingw32-make : *** No targets specified and no makefile found. Stop.

【问题讨论】:

  • 您的 makefile 是命名为 Makefile 还是 makefile?它是否在您运行mingw32-make 的同一目录中?
  • 我的makefile名称是makefile,它也在我运行mingw32-make的同一个目录中
  • 这不可能。你确定你在makefile名称上没有某种扩展名吗?如果您输入dir makefile,它是否会显示有关makefile 的信息?还是说“找不到文件”?然后,如果您在不更改目录的情况下立即运行mingw32-make,您会收到此错误吗?确保名称 makefile 中的所有字符都不是看起来或多或少相同的特殊字符。
  • makefile 的扩展名是 .txt,在输入 dir makefile 时会显示找不到文件
  • 之后我得到了和以前一样的错误。

标签: makefile mingw


【解决方案1】:

您可以通过两种方式解决此问题。

  1. 正如评论者所说,将您的文件从 makefile.txt 重命名为 makefile
  2. 另一种方式,使用mingw32-make -f makefile.txt

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-10-30
    • 2013-07-28
    • 2016-10-13
    • 1970-01-01
    • 2013-12-31
    • 2017-09-05
    • 1970-01-01
    相关资源
    最近更新 更多