问题
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. 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. 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.
TIA.
回答1:
You can also use cccl with make for windows.
cccl is a wrapper around Microsoft Visual C++'s cl.exe and link.exe. It converts Unix compiler parameters into parameters understood by cl and link.
回答2:
What you can do is create a project from existing code. Visual C++ does a pretty good job at compilation without makefiles.
You could also install MinGW and that has make and the compilers.
http://www.mingw.org/
回答3:
Use the nmake commandline tool. 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.
回答4:
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.
I don't have 2008 on me, but w/ VisualStudio2005 you can build a solution with a rule something like this
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.)
来源:https://stackoverflow.com/questions/1227506/unix-makefile-in-windows-visual-studio-2008