简体   繁体   English

Windows Visual Studio 2008中的Unix Makefile

[英]Unix Makefile in Windows Visual Studio 2008

I've done a decent search, but can't seem to find a way to get Visual Studio 2008 to use a unix Makefile, or even to create some MSVC compatible equivalent from the Makefile. 我做了一个不错的搜索,但似乎找不到让Visual Studio 2008使用unix Makefile,甚至从Makefile创建一些MSVC兼容等效的方法。 Does anyone have ideas or similar issues? 有没有人有想法或类似的问题?

Note: I already know the benefits/drawbacks of using Makefiles or not, and I don't want to hear your opinion. 注意:我已经知道使用Makefiles的好处/缺点,我不想听你的意见。 All I'm interested in right now is creating a Windows library from some originally unix code which only has a Makefile, and getting something functional out of it. 我现在感兴趣的是从一些最初的unix代码创建一个Windows库,它只有一个Makefile,并从中获得一些功能。

TIA. TIA。

You can also use cccl with make for windows . 你也可以使用ccclmake for windows

cccl is a wrapper around Microsoft Visual C++'s cl.exe and link.exe. cccl是Microsoft Visual C ++的cl.exe和link.exe的包装器。 It converts Unix compiler parameters into parameters understood by cl and link. 它将Unix编译器参数转换为cl和link理解的参数。

What you can do is create a project from existing code. 您可以做的是从现有代码创建项目。 Visual C++ does a pretty good job at compilation without makefiles. Visual C ++在没有makefile的情况下在编译方面做得非常好。

You could also install MinGW and that has make and the compilers. 你也可以安装MinGW,那就是make和编译器。

http://www.mingw.org/ http://www.mingw.org/

Use the nmake commandline tool. 使用nmake命令行工具。 Note it doesn't support everything that GNU Make does so you may need to edit the Makefile to make it compatible but it's the closest thing to what you want. 请注意,它不支持GNU Make所做的所有操作,因此您可能需要编辑Makefile以使其兼容,但它与您想要的最接近。

Typically what I see people do is use them the other way around: Use make as the master build system and have it invoke Visual Studio to build its stuff in batch mode. 通常,我看到人们会以相反的方式使用它们:使用make作为主构建系统并让它调用Visual Studio以批处理模式构建它的东西。

I don't have 2008 on me, but w/ VisualStudio2005 you can build a solution with a rule something like this 我没有2008,但是使用VisualStudio2005,您可以使用类似的规则构建解决方案

release = "Win32 Debug"
progname.exe : progname.sln
    devenv $< /Rebuild /"$(release)/"

(Note: I had to use spaces in this example, as tab just takes me to the next field.) (注意:在这个例子中我不得不使用空格,因为tab会将我带到下一个字段。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM