Makefile 生成器:预制文件与烘焙文件?

发布于 2024-07-13 10:28:41 字数 956 浏览 5 评论 0原文

对于我的 C++ 构建过程,我使用 Bakefile,这是一个不错的小型 Makefile 生成器,它可以让您指定XML 中的构建目标,它可以从中生成各种 Makefile 或项目文件。 它工作得很好,我用它来生成 GNU 自动工具脚本。

现在我听说了 Premake,它似乎也有类似的功能。 您在 Lua 中指定目标,它会相应地生成 Makefile。

有谁知道 Bakefile 和 Premake 之间的区别? 有人有两者的经验吗? Premake 似乎更新并且开发更活跃?

XML 解析器 ticpp 使用 Premake,但它需要您在构建 ticpp 之前下载 premake。 难道他们不能为各种系统预先生成 Makefile,这样你就不必先下载并安装 premake 了吗?

注意:我知道有很多关于什么是最好的构建工具的线索,通常答案是CMakeSCons果酱。 但是,我对用户在构建我的项目之前不必下载的东西感兴趣。

For my C++ build process, I am using Bakefile, a nice little Makefile generator, which lets you specify your build targets in XML, and it can generate various Makefiles or project files from it. It works fine and I use it to generate the GNU autotools scripts.

Now I heard of Premake, which seems to have a similar functionality. You specify your targets in Lua, and it generates Makefiles accordingly.

Does anyone know the differences between Bakefile and Premake? Does anyone have experience with both? Premake seems more recent and with more active development?

The XML parser ticpp uses Premake, but it requires you to download premake before you build ticpp. Can't they just pre-generate Makefiles for various systems so you don't have to download and install premake first?

Note: I know there are various SO threads about what the best build tool is, and usually the answer is CMake, SCons or Jam. However, I am interested in something that my users won't have to download before they build my project.

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

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

发布评论

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

评论(3

勿忘初心 2024-07-20 10:28:42

不完全是一个答案,但我全心全意地推荐 premake4,它太棒了。

Not exactly an answer, but I whole-heartedly recommend premake4, it's fantastic.

囚你心 2024-07-20 10:28:42

是的,Premake 确实允许您生成 Makefile(或 Visual Studio 解决方案,或...),然后您可以根据需要进行分发。 Premake 本身在其源代码包中包含预先生成的 makefile。

在目标机器上下载并运行 Premake 允许通过系统自动分析或通过命令行标志手动定制 makefile。 对于某些项目来说,这是值得的权衡,但这不是必需的。

Yes, Premake does allow you to generate a Makefile (or Visual Studio solution, or...) which you can then distribute, if you want. Premake itself includes pre-generated makefiles in its source packages.

Downloading and running Premake on the target machine allows the makefile to be customized, either by automated analysis of the system, or manually via command-line flags. For some projects that's a worthwhile trade-off, but it isn't required.

强辩 2024-07-20 10:28:42

在使用 Premake 4 和新版本的 Bakefile 后,它们似乎针对不同的用例。

  • Bakefile 面向您想要的:在本地生成构建文件,然后用它们分发您的项目。 我对这个工具有丰富的经验。
  • Premake 更像是 CMake:本地 makefile 生成。 有时,您有许多奇特的配置需要在目标计算机上运行。 Bakefile 可以让您使用插件来完成此任务,但它很快就会变得混乱。 不过,您可以预先生成文件。

对于您的使用,我推荐 Bakefile。 听起来你不需要任何花哨的东西。

After using both Premake 4 and the new version of Bakefile, it seems that they target different use cases.

  • Bakefile is oriented towards what you want: generate the build files locally and then distribute your project with them. I have had great experience with this tool.
  • Premake is more like CMake: local makefile generation. Sometimes, you have lots of fancy configs that need to be run on the target machine. Bakefile lets you accomplish this using plugins, but it can get messy fast. However, you can pre-generate files.

For your usage, I'd recommend Bakefile. Sounds like you don't need anything fancy.

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