将 nmake makefile 转换为 Visual Studio 2005 项目
我们这里有一些使用 nmake 构建的旧 C 代码。
是否有一种自动方法将 Makefile 拉入 Visual Studio 2005 并创建项目? MSDN 上的一些搜索表明 VS6 可以做到这一点,但 VS7/8 似乎放弃了该功能。
如果有必要,我可以使用 project.mak 文件作为参考从头开始构建项目,但对于更复杂的项目,这可能不可行。
We have some old C code here that's built with nmake.
Is there an automated way to pull the Makefile into Visual Studio 2005 and create a project? Some searching on MSDN indicates VS6 could do this, but it looks like VS7/8 dropped the feature.
If necessary I can build the project from scratch using the project.mak file as a reference, but for more complex projects this may not be viable.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我积极参与了公司的一个项目,做同样的事情。 我发现我们的许多旧的基于 nmake 的项目有许多共同的设置。 因此,我选择了创建自定义项目向导 。
我花了好几天的时间才弄好它,但节省了很多时间。 它还允许我们让其他开发人员以一种让他们轻松的方式重新编译,同时强制执行我们想要的许多编译器设置。
使用向导,重新编译的步骤看起来很像:
1.) 创建项目。
2.) 编译并消除所有错误和警告。
3.) 添加需要链接的库。4
.) 完成。
I have been heavily involved in a project at my company to do the same thing. I found that many of the old nmake based projects of our had many common settings. Because of that, I went the route of creating a custom project wizard.
It took several days of fooling around with it to get right, but has saved a lot of time. It has also allowed us to bring other devs into the effort of re-compiling in a manner that makes it easy for them, yet enforces many of the compiler settings we would like.
With the wizard, the steps of recompiling look much like:
1.) Create project.
2.) Compile and stomp out all errors and warnings.
3.) Add libraries that need to be linked in.
4.) Done.
这是有关该主题的 VS 2005 文档的链接< /a>. 它还具有 VS 2003 和 VS 2003 的链接。 2008年,大概都是一样的。
编辑:我只想使用不会改变太多的旧代码来执行此操作,特别是在编译和链接参数的方式上,因为手动编辑 make 文件是更改代码方式的唯一方法编译。
Here is a link to the VS 2005 docs on the subject. It also has links to VS 2003 & 2008, which are probably the same.
Edit: I would only want to do this with old code that would not change much, especially in the way of compile and link parameters, as hand editing the make file is the only way to change how the code compiles.
这应该可以使用 Visual Studio 的 COM 接口实现,但我无法帮助您了解任何细节。
This ought to be possible using Visual Studio's COM-interface, but I can't help you with any details.