使用 GNU make 时环境变量 MAKE_MODE 允许使用哪些值?
我通常有一个 MAKE_MODE 环境设置(Windows XP,使用 GNU make,在 Cygwin 和本机下)
set MAKE_MODE=UNIX
我现在发现我的构建服务器(没有定义 MAKE_MODE)和本地构建之间的差异。这可能是完全不同的东西,但它让我想知道我还可以为 MAKE_MODE
指定哪些其他值。
我想我知道 MAKE_MODE=UNIX
应该告诉 GNU make 使用 /bin/sh
- 如果它找到它 - ,但我很快检查了 GNU make 手册并找不到描述。谷歌搜索只告诉我我已经知道的信息,但没有给出有效的替代方案。
是不定义变量的唯一选择吗?当使用 CMD.exe 和 GNU make 的本机版本时它有影响吗?
编辑:到目前为止,我已经找到了值“unix”、“win32”、“null”和未定义的引用,但没有解释,也没有规范。但是查看 GNU make 3.82 的源代码显示没有出现任何字符串“MAKE_MODE”,因此无论是否设置此环境变量,GNUmake 本身显然都不会改变其行为。
EDIT2:我检查了 MinGW 的 GNU make 的源代码,但再次什么也没发现。也许这是 CygWin 特定的?
I usually have an environment setting for MAKE_MODE (Windows XP, using GNU make, both under Cygwin and native)
set MAKE_MODE=UNIX
I now found differences between my build server (which has no MAKE_MODE defined) and a local build. This may be something completely different, but it got me wondering what other values I could specify for MAKE_MODE
.
I think I know that MAKE_MODE=UNIX
is suppose to tell GNU make to use /bin/sh
- if it finds it - , but I quickly checked the GNU make manual and couldn't find a description. A google search only told me what I already know, but doesn't give a valid alternative.
Is the only alternative to not define the variable? Does it have influence at all when using CMD.exe and a native version of GNU make?
EDIT: So far I have found references for the values 'unix', 'win32', 'null' and undefined, but no explanations, and no specifications. But a look at the source code for GNU make 3.82 shows not a single occurrence of the string "MAKE_MODE", so GNUmake itself apparently doesn't change its behavior when this environment variable is set or not.
EDIT2: I checked the source code for GNU make for MinGW, and again found nothing. Maybe it's CygWin specific?
EDIT3: I found a reference that it might be property of an old version of GNU make, so I checked version 3.75. No luck, the string MAKE_MODE does not appear in the source code at all. The next step really must be the Cygwin version of GNU make. I know from 10 years ago that the Cygwin port in those days was not integrated in the regular source tree.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在 Cygwin 网站上发现了一个古老的邮件列表条目,解释了基本的内容MAKE_MODE的运行效果。这明确表明该变量与 GNU make 的 Cygwin 实现有关。
我将深入研究源代码,并在找到更多详细信息时添加到此答案中。
更新:在维护者 Christopher Faylor 的最近的帖子中我发现 GNU make 3.81 版有以下更新:
我还没有真正找到 MAKE_MODE 允许的值,但在 Cygwin 的 GNU make 的最新版本中不再需要或支持它,并且它用于在 Cygwin 的 make 中支持 DOS 文件名。
如果您确实想了解允许的值集,请查看 3.81-1 之前的 Cygwin make 版本的源代码。我猜唯一有用的值是
unix
,所有其他值都具有相同的含义。案件结案了吗?这里的浏览量仍然不多...
I found an ancient mailing list entry on the Cygwin site, explaining the basic operational effect of MAKE_MODE. This definitely indicates that the variable has to do with the Cygwin implementation of GNU make.
I'll dig around in the source code, and add to this answer when I find more details.
UPDATE: In a more recent post by maintainer Christopher Faylor I found the following update for GNU make version 3.81:
I've not really found the values allowed for MAKE_MODE, but it's not any more necessary or supported in most recent versions of GNU make for Cygwin, and it was used for supporting DOS filenames in Cygwin's make.
And if you really want to know the set of allowed values, look in the source for Cygwin's make version before 3.81-1. I guess the only useful value was
unix
, all others will have meant the same.Case closed? There's still not many views here...