【问题标题】:"make clean" issue in MSYS/CygwinMSYS/Cygwin 中的“清理”问题
【发布时间】:2013-01-18 20:34:14
【问题描述】:

我终于设法在 Windows 中编译了一个程序,这需要一段时间,如果没有这里的帮助,这将是不可能的。现在一切正常,除了:“make clean”产量

/bin/sh: del: command not found
Makefile:44: recipe for target `clean' failed
make: *** [clean] Error 127

在makefile中,clean命令看起来像

clean:
del /S *.o *~ *.out [...], eliminating all resulting .o and executables resulting from make.

mingw64 在路径中,我尝试在路径中使用 cygwin/bin 和不使用,两者结果相同。 “制作”是在 msys 中使用 mingw32-make 完成的。我还在msys 中尝试了“mingw-32-make clean”,但仍然没有运气;我也不确定 Cygwin 是否支持“make clean”。我在 Windows 7 64 位上运行整个程序。

我该如何解决这个问题?

【问题讨论】:

    标签: windows makefile recipe


    【解决方案1】:

    您似乎在混合您的平台。 del 是一个 cmd.exe 内置函数,这就是 Bash 无法找到它的原因。 del 的模拟是 rm

    尝试在cmd.exe下运行make

    编辑 Makefile,将 del /S 替换为 rm -f

    【讨论】:

      【解决方案2】:

      也可以在您的项目文件夹中创建一个名为 makefile.defs 的文件,并覆盖由 eclipse 自动设置为“del”的 makefile 变量 RM。该文件包含在 [Name of Config] 文件夹中的“makefile”中

      我的文件只包含:

      RM := rm -rf
      

      这对我来说很好。

      【讨论】:

        猜你喜欢
        • 2015-12-04
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-03-19
        • 2021-07-18
        • 1970-01-01
        • 2023-04-07
        • 1970-01-01
        相关资源
        最近更新 更多