views:

1340

answers:

4

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  A: 

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/

Daniel A. White
I tried creating a project from existing code, with little success.MinGW might work... I'll look further into that.
Justin
Be aware, that you may face problems if you will use MinGW compiled library for MSVC. I have posted an article on my blog regarding how to convert MSVC compiled dll to MinGW lib, but I don't know nothing for vice-versa.http://blog.stranadurakov.com/2009/04/01/create-mingw-library-from-dll/
Andrejs Cainikovs
alternatively you can use cygwin (downside is that the executable will also require cygwin dll). Cygwin can ease porting of code and makefiles as it comes with a posix/unix subsystem and a full set of utillities. Mingw = minimalistic. If it works it'd be my first choice too.
Adriaan
+1  A: 

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.

Mike McQuaid
I have used nmake before, and that might be my best option. I was really hoping for a solution I would use with Visual Studio though.
Justin
A: 

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.)

T.E.D.
+3  A: 

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.

Cristian Adam
This sounds like what I'm looking for. Thanks.
Justin