【发布时间】:2011-08-11 13:22:02
【问题描述】:
我有以下简单的makefile:
all:
fat_imgen.exe
其中fat_imgen.exe 是与makefile 位于同一目录中的可执行文件。当我尝试运行它时,会发生这种情况:
>make
fat_imgen.exe
make: fat_imgen.exe: Command not found
make: *** [all] Error 127
如果我在同一个命令提示符下运行 fat_imgen,那么它会按预期启动 - 为什么找不到 fat_imgen.exe?
这都是在 Mingw / Windows 下运行的。
【问题讨论】:
-
./fat_imgen.exe ? (只是猜测)
-
@Alex 是的,成功了
-
哇,这可以使用一些“解释”。
-
@Hans Well
./是 GNU shell 语法,用于“在当前目录中执行某些内容”,在 GNU shell 下需要。我的猜测是 make 以某种方式模拟了这种行为,尽管我读过的所有内容都表明 make 应该只是将命令传递给 shell,而 shell 应该是 cmd.exe 所以它仍然没有意义! -
@Kragen:make使用的shell是/bin/sh,不是cmd.exe