Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert nmake makefile into Visual Studio 2005 project

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.

like image 735
Zathrus Avatar asked Sep 30 '08 18:09

Zathrus


2 Answers

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.

like image 108
Taylor Price Avatar answered Sep 24 '22 19:09

Taylor Price


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.

like image 44
crashmstr Avatar answered Sep 22 '22 19:09

crashmstr