Solved

Generate NMAKE Makefile from VC++ project?

Posted on 2009-03-30
6
2,851 Views
Last Modified: 2013-12-14
Is there a quick way to generate a valid makefile for nmake given an existing Visual C++ project? I'm using VS 2008.
0
Comment
Question by:mrjoltcola
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 49

Assisted Solution

by:DanRollins
DanRollins earned 200 total points
ID: 24023121
I beleive not.  VS6 had an "Export Makefile..." menu item, but Microsoft has changed to the MSBuild technique.
If all you want is a command-line way to do a build, you can use something like:
   MSBuild /target:Debug myproject.csproj
See:
   MSBuild Reference
    http://msdn.microsoft.com/en-us/library/0k6kkbsd.aspx
0
 
LVL 49

Assisted Solution

by:DanRollins
DanRollins earned 200 total points
ID: 24023203
From http://social.msdn.microsoft.com/forums/en-US/msbuild/thread/7a572ada-edfc-4c85-ab35-0bdd5352b17c/
> In older VS versions, I could generate Makefiles from the project.

We cut this feature in VC7 because it was a bug farm and we couldn't get
it to work properly without fundamentally changing the feature. The more
I get feedback on this, though, the more I get convinced that may be
this was not the right decision :(

0
 
LVL 39

Accepted Solution

by:
itsmeandnobodyelse earned 300 total points
ID: 24031668
>>>> If all you want is a command-line way to do a build,

For VC compiling it is vcbuild and not msbuild (I hope they didn't change it from VS2005 cause I actually didn't use it for VS2008 projects til now).

You'll get the possible options by typing

   vcbuild /?

at the command prompt.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 39

Expert Comment

by:itsmeandnobodyelse
ID: 24031722
The vcbuild is quite mighty and I didn't miss the nmake. In VC6 we were used to generate makefiles from dsp project files which indeed was a 'bug farm' and I was really happy when we ported to VC8 and vcbuild and dropped the OS/2 branch which was the major reason for using makefiles.
0
 
LVL 40

Author Comment

by:mrjoltcola
ID: 24031779
Thanks guys, my main problem is maintaining this for open source projects. On UNIX I used to use autoconf, and it may very well support nmake, but I doubt it.

Secondly, trying to run vcvars32.bat to get the right environment involves either asking the user, or detecting it, so I am just trying to figure out the best approach.

It would seem someone would have written a tool, by now, to export a makefile.

Anyway, to the answers, vcbuild will do for now. I will just continue to maintain a separate makefile for UNIX, and possibly will write a Perl script to generate one from the project file at some point.

Points to both of you!
0
 
LVL 39

Expert Comment

by:itsmeandnobodyelse
ID: 24032191
>>>> I will just continue to maintain a separate makefile for UNIX

Yes, I did the same for a dll project at Windows/VC7 and AIX/xlC and - though I made the AIX makefile programatically by evaluating the source files from vcproj it actually was *not* a conversion of a vcproj to a unix makefile but something very much less, i. e. updating the list of source files in an existing unix make file. And I don't think that more is senseful.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand columnThat will then direct you to their download page.From that page s…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question