I have a few makefiles to build certain libraries for me. I now need to convert them to a VS project for convenience sake. I googled only to find the ways to convert a VS project to a makefile with the help of makefile wizard provided by VS. Also, I did find that there was this feature included in VS6 to convert the makefile into VS project. But this feature has been removed for the later versions. Also, I realized that VS6 downloads are no more available on the msdn site.
Is there any other way to convert a makefile to a visual studio project? or Can I get hold of VS6 from somewhere?
The only real option you have here is to manually do the conversion (or use the Makefile Project Wizard). You say you have 'a few' makefiles, don't know how much that is, but unless you're talking about > 10 or so it's not that much work to manually create a Visual Studio project for these. After all, all you do is create a new dll project and add source files to it. The default compiler/linker flags hardly need any tweaking. Oh yeah if you do tweak them, make sure to do those changes in a property sheet instead of in the project itself: the property sheet can be reused by other projects, it's a simple matter of the DRY principle.
Why is this the only real option? Firstly there is no tool that can reliably convert any arbitrary makefile to a VS project, simpy because makefiles can be in any format you want and a lot of their functionality simply has no counterpart in a VS project. Secondly, VS6 is at this date about 15 years old so even if you get it to run on your machine, the output it produces is still ancient and definitely not what you want to use for your projects.
This CodeProject article : Automatically Translate makefile C/C++ Project for Visual Studio offers a rudimentary solution aiming for VS 2013 C/C++ projects.
[ PS: not my article, but it addresses at least the main part of your VS6 question. ]
It is a simplistic script, and therefore fraught with assumptions and opportunities for failure. It may, however, give you a starting point that is workable, if your project fits within its domain of intent.
You will still need to:
In case that article goes away ... it is a VBS script that:
So, if you have nested projects (likely) you will need to tweak how the script works in its recursion step.
Good luck.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With