将 gmake Makefile 转换为 make Makefile?

发布于 2024-12-20 19:33:46 字数 78 浏览 1 评论 0原文

是否存在将 gmake 的 GNU Makefile 转换为可用于 make (FreeBSD-make) 的 Makefile 的实用程序?

Does a utility exist to convert a GNU Makefile for gmake to a Makefile that can be used for make (FreeBSD-make)?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

子栖 2024-12-27 19:33:46

该实用程序称为开发人员(程序员、制作大师,...):-)
说实话,这项任务所需的人工智能足够复杂,而且对自动转换的需求足够接近 epsilon,以至于没有人会认真考虑对其进行编程。

如果您有 GNU makefile,最好使用 GNU make。

That utility is called a developer (programmer, make guru, ...) :-)
Seriously, the AI required for this task is complex enough and the demand for automatic conversion sufficiently close to epsilon that nobody would seriously consider programming one.

If you have a GNU makefile it is best to use GNU make.

风情万种。 2024-12-27 19:33:46

正如已经指出的那样,没有这样的转换器,我非常怀疑是否存在这样的转换器。据我了解,您有两个选择:

  1. 使用 GNU make port 到 FreeBSD。例如这个

  2. 修补 makefile 以使其与 FreeBSD make 兼容。实际上,LuaJIT 中并没有太多这样的内容(主要 Makefilesrc/Makefile)。这应该是相当容易的。只需确保您拥有所有工具(检查 shell 中的调用内容),然后逐步修复“错误”即可。

    例如,第 29 行的错误 (export PREFIX= /usr/local) 是由于 GNU make 指令 export 造成的,在 FreeBSD make 中没有类似的指令。 手册说“环境变量是在 shell 中的 Makefile 之外设置的,正在运行 make”,因此您必须遵守此要求。

    此外,您还需要修复所有 make 条件等,所有差异都收集在 BSD make 与 GNU make

As already noted there are no such converter and I very doubt there could exist such. As I understand you have two options:

  1. Use GNU make port to FreeBSD. For example this.

  2. Patch makefiles to make them compatible with FreeBSD make. Actually there are not too much of them in LuaJIT (main Makefile and src/Makefile). This should be rather easy. Just make sure you have all tools (check what is called in shell), and fix "error"s step by step.

    For example, error on line 29 (export PREFIX= /usr/local) is due to GNU make directive export which has no similar in FreeBSD make. The manual says "Environment variables are set outside the Makefile in the shell that is running make" and thus you have to comply with this requirement.

    Also you'll need to fix all make conditionals and etc, the whole bunch of differences is collected in BSD make vs. GNU make

变身佩奇 2024-12-27 19:33:46

不太可能存在这样的情况,因为有些事情可以在 GNU make 中完成,而在其他版本的 make 中却无法完成。其中,makefile 中用于操作字符串的函数宏和条件语句通常不可用。

It is unlikely that there is one because there are things you can do in GNU make that you can't do in other versions of make. Amongst others, the function macros for manipulating strings and the conditionals in the makefile are generally not available.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文