MinGW的品牌和MSYS的品牌之间有什么区别,哪里可以买到? [英] What are the differences between MinGW's make and MSYS's make and which one is available where?

查看:82
本文介绍了MinGW的品牌和MSYS的品牌之间有什么区别,哪里可以买到?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

很抱歉,这是一个愚蠢的问题,但是我正在努力在NetBeans中设置C ++(这需要MinGW).它在NetBeans的C/C ++部分的文档中说,它将仅适用于MSYS的品牌,而不适用于MinGW的品牌.我想知道两者之间的区别,因此我用Google搜索并提出了这个问题,其中说有两个不同的地方MinGW,mingw32-make(MinGW的品牌)和make(MSYS的品牌)随附的品牌.然后,我在MinGW网站的Wiki上进行了一些挖掘,发现该帖子埋在FAQ中:

Apologies if this is a rather dumb question but I'm working on getting C++ set up in NetBeans (which requires MinGW). It says in the documentation for the C/C++ part of NetBeans that it will only work with MSYS's make, not MinGW's make. I wanted to know the difference between the two, so I Googled it and came up with this question which says there are two different makes included with MinGW, mingw32-make (MinGW's make) and make (MSYS's make). I then dug a little on the MinGW website's wiki and found this post buried in the FAQ:

在某些情况下缺少make的本地"(即:依赖MSVCRT)端口 功能,由于缺少POSIX而已修改功能 在Win32上. MSYS发行版中也存在make的版本 这取决于MSYS运行时.该端口更多地作为make 旨在进行操作,并在执行过程中减少了头痛. 基于此,MinGW开发人员/维护人员/打包人员决定了 最好重命名本机版本,以便本机" 版本和MSYS版本可以同时存在而无需 文件名冲突.

The "native" (i.e.: MSVCRT dependent) port of make is lacking in some functionality and has modified functionality due to the lack of POSIX on Win32. There also exists a version of make in the MSYS distribution that is dependent on the MSYS runtime. This port operates more as make was intended to operate and gives less headaches during execution. Based on this, the MinGW developers/maintainers/packagers decided it would be best to rename the native version so that both the "native" version and the MSYS version could be present at the same time without file name collision.

那么,如果有两个make的副本,那么MSYS shell中有一个副本,而cmd.exe中有一个副本?两者之间的主要区别是什么?

So, if there's two copies of make, which one is available in the MSYS shell and which one is available in cmd.exe? What are the main differences between the two?

推荐答案

两个版本之间的主要实际区别(MSYS版本和本机版本)是,前者使用MSYS Shell执行命令,而后者使用cmd.这意味着使用MSYS版本的make可以编写与Unix或Linux系统上几乎相同的配方,而使用本机Windows版本则可能需要做不同的事情.对于简单的命令执行,它们的工作原理相同,但是对于更复杂的操作,配方必须有所不同,因为cmd的语法与Unix shells完全不同.

The main practical difference between the two makes, the MSYS version and the native version, is that former uses the MSYS shell to execute its commands, while the later uses cmd. This means with the MSYS version of make you can write recipes much the same as you would on Unix or Linux system, while with the native Windows version you might have to do things differently. For simple command execution they work the same, but for more complicated actions the recipes will have to differ because cmd has a much different syntax than Unix shells.

例如,您可以使用MSYS make处理类似的递归构建:

For example you might handle recursive builds like this with MSYS make:

recurse-subdirs:
    for i in $(SUBDIRS);            \
    do                              \
        cd $$i && make all || exit; \
    done

使用make的本机版本时,您必须改为执行以下操作:

While with the native version of make you'd have to do something like this instead:

recurse-subdirs: FORCE
    for %%i in ($(SUBDIRS)) do     \
        cd %%i && make all || exit

使用MSYS可以确保可以使用常规的Unix命令(例如rm *.o),而使用本机make则可以使用Windows命令(例如del *.o).

With the MSYS make its also safe to assume the usual Unix commands are available (eg. rm *.o), while with the native make you'll want to use Windows commands instead (eg. del *.o).

make的哪个版本取决于您设置PATH的方式.如果通过搜索PATH可以找到两个版本的make,一个名为make,一个名为mingw32-make,那么这两个命令都将可用.无论您使用的是MSYS Shell还是cmd,都是如此.

Which version of make is available is dependent on how you set the PATH. If both versions of make, one named make, and one named mingw32-make, can be found by searching PATH then both commands will be available. This true whether you're using the MSYS shell or cmd.

这篇关于MinGW的品牌和MSYS的品牌之间有什么区别,哪里可以买到?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆