Build Systems: Make vs. SCons

In the process of recent work on an upcoming project, I decided that I wanted a build system that would do things that GNU Make either doesn’t do or at least doesn’t do readily. Doing a bit of investigation, I discovered that there really aren’t a whole lot of options out there. In fact, the four major systems I found were:


Initially, I had been using GNU Make, but I ran into some limitations with it. As a quick aside, I suspect that it is possible to use Make to do all of what I’m going to mention, however I’m no master of esoteric art of writing Makefiles, and consequently figuring these things out in Make would have been no easier than learning a new build system. The single biggest feature I wanted was the ability to have several different build configurations, namely release builds and debug builds. The only way I know of to do this in Make would involve setting environment variables when make is invoked; e.g: CFLAGS=-g make.
Additionally, I wanted to be able to have all intermediate files as well as output files be located in a different subdirectory than the source code. That is, if all code is in src/, the build output would end up in build/.

First I looked at Perforce Jam as well as Boost.Build, but I found the combination of odd syntax and minimal documentation to be sufficient to move on.
Next, I considered Apache Ant, but given that I try to avoid Java based tools when I can, as well as the XML based configuration files, I opted to but Ant on the back burner while I explored other avenues.

Finally, I came to SCons, a Python based system which uses Python scripts to control the build. This alone sets it out from all the other options I examined, as it does not try to invent a new language, but rather simply reuses a general purpose language. SCons has the ability to do what I wanted: varying configurations and separate source and build directories, coupled with a configuration language I happen to already know. That being said, I do have some problems with SCons. It tries very hard to be multi-platform, and as such tends to require a bit more of an abstract approach when defining things like compiler parameters. This is all well and good, but it feels a bit like to much control is being taken from me. Additionally, it feels a little bit slow, due in large part to how it handles dependencies and determines what has changed (it parses source files looking for includes, and uses strong hashes to determine if a file changes rather than timestamps).

Overall however, SCons seems to be the best bet, at least for my needs.

Leave a Reply

By submitting a comment here you grant this site a perpetual license to reproduce your words and name/web site in attribution.