none
NMAKE - more dynamic building and staging within Visual Studio 2010 RRS feed

  • Question

  • For an NMAKE guru this is probably and elementary question.

    I'm building open-source GEOTIFF libraries; however, to do so one must first edit the Makefile.vc and set  the BUILD (absolute) PATHS to TIFF and  PROJ4 directories at the start of the Makefile.vc residing in the libgeotiff repository.  This is not really acceptable since the path includes specific project folders/directories to your current build area. I'd like to make this more adaptable for any project.  Is there way to pass in paths in the NAMKE process, say as arguments? 

    Currently I nmake from the VS command line - Visual Studio Tools >> Visual Studio Command Prompt. This all works fine just a-bit clunky.

    I see I can create an  MAKEFILE visual studio project. Anyone aware of examples replacing the command namke  /f Makefile.vc process to the VS2010 Makefile project.   

    I use the nmake process to build static libraries from the open-source which I use to link to with a VB.NET(Managed)/CLI/C(Unmanaged) project

    At a high level of abstraction....

    I nmake PROJ4 to get a proj.lib library

    I nmake TIFF to get a libtiff.lib library

    Finally, I nmake LIBGEOTIFF to create geotiff.lib library which requires the latter two libraries above.

    So, If I were to create VS Makefile Projects would I create 3 separate Makefile projects?

    I have also tried to create a VS "Class Library" Project with some moderate success but but there were some other issues with function name resolution going between C++ and C. It seem best to stick with the suggested LIBGEOTIFF/TIFF linking process.

    I' suppose I'm looking for a other strategies.  Maybe the use of the VS 2010 Command line compilation is the best methodology. I have actually developed all the VB/CLI interfaces with my static (unmanaged) libraries and everything works fine. I just wanted to see if I could improve the library build processes on the open-source stuff.





    • Edited by dmk4170 Friday, April 15, 2016 2:10 PM
    Friday, April 15, 2016 12:07 PM

Answers

  • dmk4170,

    To begin from - your questions are not related to msbuild. Msbuild has nothing in common with nmake, any other make version or makefiles. This topic better fits in the VC++ forum.

    A VC++ makefile type project is just this: it tells to VC not to use its own build system, instead simply run nmake with /f makefile, or whaever command specified in the project. What happens next is 100% up to the makefile. It does not get any VC++ project setting, unless passed on the command line or environment.

    Often this is exactly what is need, even if looks uncomfortable to a VB person. C/C++ folks are better used to this.

    How this may be improved? An obvious answer is, convert the makefiles to proper VC++ projects. You can try to propose this to maintainers of the opensource project ;)

    A better option (from maintainer POV)  is generate the VC++ projects by Cmake. Cmake files are clean, simple and easy to compare/merge, but have certain learning ramp. VC++ projects are steaming mess of xml. So, a classic makefile is maybe a good enough compromise for everybody.

    In VC++, each library (or other component) needs a separate project. But a makefile can have several outputs, you can combine makefiles of all the libraries into one. Or just create a small batch file to run all makefiles and set it as the command for the VC++ makefile project.

    Regards,

     -- pa



    Tuesday, April 19, 2016 9:42 AM

All replies

  • dmk4170,

    To begin from - your questions are not related to msbuild. Msbuild has nothing in common with nmake, any other make version or makefiles. This topic better fits in the VC++ forum.

    A VC++ makefile type project is just this: it tells to VC not to use its own build system, instead simply run nmake with /f makefile, or whaever command specified in the project. What happens next is 100% up to the makefile. It does not get any VC++ project setting, unless passed on the command line or environment.

    Often this is exactly what is need, even if looks uncomfortable to a VB person. C/C++ folks are better used to this.

    How this may be improved? An obvious answer is, convert the makefiles to proper VC++ projects. You can try to propose this to maintainers of the opensource project ;)

    A better option (from maintainer POV)  is generate the VC++ projects by Cmake. Cmake files are clean, simple and easy to compare/merge, but have certain learning ramp. VC++ projects are steaming mess of xml. So, a classic makefile is maybe a good enough compromise for everybody.

    In VC++, each library (or other component) needs a separate project. But a makefile can have several outputs, you can combine makefiles of all the libraries into one. Or just create a small batch file to run all makefiles and set it as the command for the VC++ makefile project.

    Regards,

     -- pa



    Tuesday, April 19, 2016 9:42 AM
  • Pavel

    Thank you for your insight and sharing your professional experience.

    dmk

    Tuesday, April 19, 2016 12:04 PM
  • DotNet Wang

    I believe you might have replied into my thread while meaning to reply in another -- no problem.

    dmk

    Tuesday, April 19, 2016 12:06 PM
  • Hi dmk4170,

    I’m so sorry for my fault and thank you so much for your magnanimity.

    If you have any issues about using MSBuild, you’re welcome to post them here and I would do my best to help you. Besides, you could mark Pavel A’s reply as answer to close this thread to thank him and help other community members who have the similar questions if it’s helpful to you.

    Thank you for your support and understanding again.

    Best Regards,
    Li Wang


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, April 21, 2016 7:09 AM