强制 Eclipse 生成标准 Unix makefile
我有一个 Eclipse 项目,我已经研究了一段时间了,我想将其开源。 但要做到这一点,我希望像大多数其他开源程序一样拥有一个干净的 Makefile。 我知道我可以自己制作,但如果 Eclipse 可以为我管理它会更好。 让 Eclipse 生成 CMake 文件会更好,但如果最简单的话,我可以满足于简单的 makefile。 那么,我怎样才能让 Eclipse 做到这一点呢? 互联网上有一些帖子建议在创建项目时选择“托管制作”,但它们是几年前的内容并且已经过时了。 当我尝试创建 C 项目时,可以选择创建“Makefile 项目”,但它会在名为“Linux GCC”的文件夹中创建 makefile,并使所有内容变得混乱。 有什么建议么?
I have an Eclipse project I've been working on for some time now, and I'd like to open source it. But to do that I'd like to have a clean Makefile like the majority of other open source programs. I understand I could make my own, but it would be better if Eclipse could manage it for me. Getting Eclipse to generate a CMake file would be even better, but I can settle for a plain makefile if that is easiest. So, how can I get Eclipse to do this? There are a few posts on the internet that suggest selecting "Managed make" when creating a project, but they were from a few years ago and are outdated. When I try to create a C project, there is the option to create a "Makefile project", but it creates the makefile in a folder called "Linux GCC" and makes everything cluttered. Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我已经成为 *nix 人 25 多年了,并且是 make 的忠实粉丝。 然而,让您的 Eclipse 项目依赖于 make 将会排除 Mac 和 Windows 社区。 为什么不直接导出 Eclipse 项目并将其作为 Eclipse 项目开源呢? 然后,用户可以根据需要准备好扩展。 您没有指定项目编写的语言,如果是 Java(对于 Eclipse 来说很常见)为什么不为项目创建一个 ant 构建文件?
只是一个想法。
I've been a *nix guy for 25+ years and am a big fan of make. However, making your Eclipse project dependent upon make is going to exclude the Mac and Windows community. Why don't you just export the Eclipse project and open source it as an Eclipse project? Then users can can have it ready to extend if they choose. You didn't specify the language your project is written in, if it's Java (pretty common for Eclipse) why not create an ant build file for the project?
Just a thought.
我最终只是手动创建了一个 CMake 项目。 制作 CMake 文件实际上并不难,而且比尝试让 Eclipse 为您做这件事要容易得多。 另外,它们是跨平台的。
I ended up just creating a CMake project by hand. CMake files are really not that hard to make, and it's a lot easier than trying to get Eclipse to do it for you. Plus, they're cross-platform.
是否有一个 CMakeBuilder Eclipse 插件,与此 教程 非常适合您想要做的事情?
最终结果类似于:
(来源:vtk.org)
Would a CMakeBuilder eclipse plugin, associated with this tutorial be a good fit for what you are trying to do?
The end result would be something like:
(source: vtk.org)
如果您使用“调试”配置构建项目,则 Eclipse 生成的 makefile 将存储在项目的“调试”文件夹中(如果您使用“发布”配置构建项目,则存储在“发布”文件夹中)。
If you've been building your project using the Debug configuration the makefile Eclipse generates is stored in the Debug folder of your project (or the Release folder if you've built it using the release configuration).