Introducing the slam build system
[22nd February 2007]
I've spent countless hours battling with makefiles in the past. There are so many problems with make, it's beyond a joke. I wanted to build my software on multiple operating systems using a number of very different compilers in a number of different configurations (debug, release, profile, test, etc). I wanted my dependencies managed for me. I wanted my build scripts to be low maintenance. This is something that make just couldn't do for me.
The itch was too big to ignore. In scratching it I came up with slam. I hope you find it as useful as I do.
Boost.build has great support for multiple compilers out the box, but it's syntax and implementation is somewhat arcane, as it is based on Jam. It also has no support for pkg-config, which is something I really need since I use gtkmm for most of my home-brew GUIs.
SCons is really flexible, but rather buggy and slow. Writing a SConstruct that allowed me to select a compiler at runtime was a nightmare and there was no way to specify vendor-neutral compiler flags; I couldn't just tell it that I wanted to turn on the compiler's optimization facilities. Instead I had to set up the mappings myself for each compiler. Gah!
And so slam was born. It isn't the biggest and best build system available and it's only suitable for C and C++ projects, really. But it does exactly what I want and does it quite well. It's implemented in Python and so should run on your favourite operating system. So far there's support for MSVC 8, generic GCC, MinGW GCC and Apple's GCC. I'm going to try to implement toolset code for MSVC 7, Borland C++ and Digital Mars compilers in due course.
If you're interested in giving slam a go, then by all means have a read of the documentation and put it through its paces. It's still rather rough around the edges, but it's usable right now and I'd be interested in hearing what you think!
I can finally wave bye-bye to my makefiles!
All original content copyright© Edd Dawson.
Any opinions expressed by Edd are his own and are not necessarily shared by his employer. Or by anyone else, in fact.
All source code appearing on this website that was written by Edd Dawson is made available under the terms of the Boost software license version 1.0 unless otherwise stated or implied by the license associated with the work from which the code is derived.