GNU品牌,Microsoft nmake和posix标准品牌的相似/不同程度如何? [英] How similar/different are gnu make, microsoft nmake and posix standard make?

查看:89
本文介绍了GNU品牌,Microsoft nmake和posix标准品牌的相似/不同程度如何?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

gnu品牌,Microsoft nmake和posix标准品牌的相似/不同之处如何?

How similar/different are gnu make, microsoft nmake and posix standard make?

很明显,有诸如哪个OS?",哪个编译器?"之类的东西.和哪个链接器?",但我指的是makefile本身的语法,语义和命令行选项.

Obviously there's things like "which OS?", "which compiler?" and "which linker?", but I'm referring specifically to the syntax, semantics and command-line options of the makefiles themselves.

如果我基于gnu make的手册编写makefile,那么我需要注意的最重要的可移植性问题是什么?

If I write makefiles based on manuals for gnu make, what are the most important portability issues that I need to be aware of?

推荐答案

GNU Make和POSIX Make共享一个公共核心,因此GNU Make可以理解用于POSIX Make的makefile并以相同的方式解释它们-很少有例外.但是,许多GNU Makefile使用仅在GNU Make中可用的功能.有时这是故意的和有意识的;有时不是(有时不是"是一个问题).我对Microsoft nmake不太熟悉;我相信它很可能接近POSIX Make语义的核心,但是它将具有自己不同的扩展集.

GNU Make and POSIX Make share a common core so that GNU Make understands makefiles intended for POSIX Make and interprets them the same way - with very few exceptions. However, many GNU Makefiles use features that are only available in GNU Make. Sometimes this is deliberate and conscious; sometimes it isn't (and "sometimes isn't" is a problem). I'm less familiar with Microsoft nmake; I believe it is likely to hew close to the POSIX Make semantics at its core, but it will have its own divergent set of extensions.

通常来说,像autoconf这样的程序所产生的内容都接近可移植的Makefile.

Generally speaking, what the programs like autoconf produce are close to portable Makefiles.

要注意的是,使用GNU Make的所有主要功能都是将文件名(宏)映射为有用值的所有扩展功能符号.尽管它们无疑是有用的,但它们还是可移植性的陷阱.

The main things to be beware of using GNU Make are all the extended function notations for mapping file names (macros) into useful values. While they are undoubtedly useful, they are also a trap for portability.

POSIX -它们被认为是常见的扩展名:

The '%.x' notations for suffix rules are not defined by POSIX - they are recognized as a common extension:

包含字符'%''"'的目标的解释是实现定义的.

The interpretation of targets containing the characters '%' and '"' is implementation-defined.

这篇关于GNU品牌,Microsoft nmake和posix标准品牌的相似/不同程度如何?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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