Archive

Posts Tagged ‘convert’

Ubuntu Linux: How to Convert from HTML to JPG

March 30th, 2011 No comments

Here is an easy way to convert from HTML to JPG. Actually, I’m converting the HTML to PDF and then from PDF to JPG.
Read more…

Building ffmpeg in Debian (Lenny)

November 1st, 2010 No comments

I’ve adapted the instructions from this Ubuntu thread for Debian Lenny.
The original idea was to build ffmpeg with AAC support, but then I’ve found some other problems with mp3 codec, so I needed to apply a patch and rebuild everything.
Read more…

Converting Visual Studio solutions to Makefiles

May 23rd, 2008 9 comments

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)

where:

  • 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)

example:

exlist = [('../extsrc/zlib/projects/visualc6/Makefile.ag',
'	$(MAKE) -C $(dir_root)extsrc/zlib -f Makefile libz.a\n',
'	$(MAKE) -C $(dir_root)extsrc/zlib -f Makefile clean\n')]
dirrepl = [['winnt', 'linux']]
librepl = [['zlib', 'z'], ['nspr', 'nspr4 -lplc4 -lplds4']]
#
Sln2Make("../winnt/test.sln", exlist, dirrepl, librepl)

To correct the path case, I’ve used a script published by Moshe Zadka here.
Download sln2make here. Use this code at your own risk, it is released under BSD license.