Solved

Generate NMAKE Makefile from VC++ project?

Posted on 2009-03-30
6
2,803 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
  • 3
  • 2
6 Comments
 
LVL 49

Assisted Solution

by:DanRollins
DanRollins earned 200 total points
Comment Utility
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
Comment Utility
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
Comment Utility
>>>> 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 39

Expert Comment

by:itsmeandnobodyelse
Comment Utility
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
Comment Utility
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
Comment Utility
>>>> 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

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…
Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

762 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now