• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2918
  • Last Modified:

Generate NMAKE Makefile from VC++ project?

Is there a quick way to generate a valid makefile for nmake given an existing Visual C++ project? I'm using VS 2008.
0
mrjoltcola
Asked:
mrjoltcola
  • 3
  • 2
3 Solutions
 
DanRollinsCommented:
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
 
DanRollinsCommented:
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
 
itsmeandnobodyelseCommented:
>>>> 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
itsmeandnobodyelseCommented:
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
 
mrjoltcolaAuthor Commented:
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
 
itsmeandnobodyelseCommented:
>>>> 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now