我正在尝试重新编译一个已经有 Windows 端口的应用程序(所以它应该可以工作)
当然,你还需要运行./configure
所以你需要 MSYS 或 MSYS2。
配置部分运行良好。现在当我跑步时make -n
(所以它显示执行了哪些规则)我得到:
$ make -n
if test ! -f config.h; then \
rm -f stamp-h1; \
make stamp-h1; \
else :; fi
! was unexpected
make: *** [config.h] Error 255
! was unexpected
是法语消息的近似翻译(因此可能略有不同),但让我想起了神秘的 Windows 批处理文件消息。所以我想make
使用 Windows 本机 shell 运行其命令行(对于大多数简单命令来说这不是问题,但当它依赖于类似 bash 的 shell 时则不是问题),通过使用 make debug 模式确认了这一假设:
$ make -d
GNU Make 3.82
Built for i686-pc-mingw32
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
<I'll spare you that boring part then:>
Invoking recipe from Makefile:164 to update target `config.h'.
Creating temporary batch file C:\msys64\tmp\make11752-1.bat
Batch file contents:
@echo off
if test ! -f config.h; then rm -f stamp-h1; make stamp-h1; else :; fi
从制作文档来看,make
采取SHELL
环境。变量考虑在内。
SHELL
被设置为unix风格的路径,但我尝试用$ export SHELL="C:/msys64/usr/bin/bash.exe"
反映本机 Windows 路径(make
可能不知道 MSYS2)但无济于事)
那么如何告诉make
to use bash
shell 而不是 Windows shell ?