A python script to convert Microsoft Visual Studio 2005 solution files (*.sln) and the associated project files (*.vcproj) into a set of Makefile’s.
The class Sln2Make does all the work, parses the sln and vcproj files and generates a main Makefile and one Makefile.ag for every project in the solution. The Makefiles.ag generated will have two targets, ‘all’ and ‘clean’, the script also includes the dependent libraries if they are properly defined in the solution. To use it, just instantiate the class with the following parameters:
Sln2Make(slnpath, exlist, dirrepl, librepl)
- slnpath is the path to the solution file
- exlist an optional list of files to exclude, optionally you can pass the content of an alternative make file using this syntax: [[dest, make_all_replacement, make_clean_replacement], …]
- dirrepl a list of directory replacement rules
- librepl library name replacement rules (when win library name doesn’t match OS’s library name)
To correct the path case, I’ve used a script published by Moshe Zadka here.
Use this code at your own risk, it is released under BSD license.