如何从 Visual Studio 解决方案文件创建 makefile?
我有一个 Visual Studio 项目,它使用解决方案文件来构建它。我想生成一个 makefile,以便我可以使用 makefile 而不是解决方案文件来构建它。 我需要这样做的原因是,我正在将我的项目合并到一个使用 makefile 构建的更大的软件系统中,并且我希望能够使用 makefile 构建整个系统。)
(如果您想知道, 自动从 Visual Studio 解决方案获取信息并将其转换为 makefile 格式的方法,还是需要手动执行此操作?
I have a Visual Studio project that uses a solution file to build it. I want to generate a makefile so that I can build it using the makefile instead of the solution file. (The reason I need to do this in case you are wondering is that I am incorporating my project into a larger software system that uses makefiles to build, and I want to be able to build the whole thing using the makefiles.)
Is there a way to automatically get the information from the Visual Studio solution and convert it into a makefile format, or do I need to do that manually?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这在 VC6 中曾经是可能的,它可以选择从 .dsp 项目文件生成 makefile。不再这样了,构建过程已经发生了太大的变化,无法实现这一目标。
不是真正的问题,您可以让 makefile 调用 vcbuild.exe 工具,它会构建一个 .vcproj 项目。您需要在 makefile 中使用的重要开关:
例如:
请注意,构建系统在 VS2010 中进行了重大修订,您将使用 msbuild.exe 来构建 .vcxproj 项目。
This used to be possible in VC6, it had an option to generate a makefile from a .dsp project file. No more, the build process has changed too much to make this achievable.
Not a real problem, you can have the makefile invoke the vcbuild.exe tool, it builds a .vcproj project. Important switches you'll want to use in your makefile:
For example:
Note that the build system got a major revision in VS2010, you'll use msbuild.exe instead to build the .vcxproj project.
虽然我从未使用过它,但这可能是一个替代方案。它相当旧,可能不适用于新项目。它曾经与 mingw 一起提供,但(不知道为什么)不再了。 题外话:就个人而言,如果项目不是很大,我会选择手动编写 Makefile。
Although I never used it, this might be an alternative. It's rather old and might not work well for new projects. It used to come with mingw but (don't know why) not anymore. Offtopic: Personally, if the project is not enormous, I would go with manually writing a Makefile.