将 Makefile 转换为 MsBuild
我想知道是否有好的做法、好的工具可以将一堆 Windows Makefile 项目移动到某种 msbuid (VS 2010) 格式? 如果您认为使用工具来实现它不是一个好主意,也许您确实知道诸如依赖性分析器之类的东西来制作清单?
I would like to know if there is good practices, good tools to move a bunch of windows makefile projects to some msbuid (VS 2010) format?
If you think that' not a good idea to make it using a tool, maybe you do know something like a dependency analyser to make a checklist?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最近将基于“make”的遗留构建转换为 MSBuild,我不得不说没有真正简单的方法。诚然,我正在处理的遗留构建实际上是调用 msbuild 来构建 .sln(我相信将其他流程放在适当位置的构建工程师是 Old-Skool,并且正在使用最适合他的工具集,而不是 .Net )。
然而,我注意到 make(特别是 nmake.exe/build.exe)工具是基于目录的 - 子目录是在父目录之前“构建”的。而 msbuild 的情况并非如此 - 它是基于解决方案和项目的。
将您的代码放入 Visual Studio 项目中,位于“平面”目录结构中(将所有项目作为单个“源”文件夹的子级,从长远来看确实会让您的生活更轻松 - 不要让项目位于多个目录中” 使用多种解决方案
将构建分解为“层” - 将 slns 的构建排序到帮助程序 .bat 文件中 - 从长远来看,这将帮助您转换为 TeamBuild
(我的答案开始得到失控 - 你的问题让我想起了那个美国人访问爱尔兰迷路的笑话,他问当地人“你怎么去基拉尼?”,当地人回答“好吧,我不会从这里开始” ..你能提供更多关于你实际构建的内容吗?我确信我和其他人可以给你无数的建议,但不知道你正在使用什么)
Having recently converted a legacy "make" based build to MSBuild, I'd have to say that there is no real easy way. Granted, the legacy build I was working on was actually calling msbuild to build .sln (I believe that the build engineer that put the other process in place was Old-Skool, and was using the toolset that best suited him, rather than .Net).
However, what I noticed was that the make (specifically nmake.exe/build.exe) tools were directory based - subdirs were "built" before parent dirs. Whereas that is not the case for msbuild - it's solution and project based.
Get your code into Visual Studio projects, living in a "flat" directory structure (having all projects as children of a single "Source" folder will really make your life easier in the long run - don't have projects that live several dirs "down the tree"
Use multiple solutions to break the build into "tiers" - order the build of the slns into a helper .bat file - this will help you in the long term to convert to TeamBuild
(my answer started to get out of control - your question reminds me of that joke with the American visiting Ireland who gets lost, and he asks a local "how do you get to Kilarney?", and the local replies "well, I wouldn't start from here".. Can you give a bit more detail about what you are actually buiding? Is it .Net code? I'm sure there is countless advice I and others could give you, but don't know what you are working with)