Showing posts with label SCons. Show all posts
Showing posts with label SCons. Show all posts

Wednesday, August 18, 2010

Build Systems in a Rush - A Quick Recipe for SCons (C-Code Compiling)

In general, I like using SCons more than makefiles. Why? Well, the following 3 points are a big drawcard:
  1. It's files are based on Python. So no funking around with yet another ancient/archaic shell language
  2. SCons works nicely (as a 1-step process) on a Windows computer once installed, without needing special shells or whatnot. This practically knocks out CMake (it's a two-step process, which ends up creating makefiles or msvc projectfiles, both of which have their downsides) and standard mingw-makefiles (which I cannot ever seem to get running without using a special msys shell, and/or other arcane invokations) 
  3. Being able to show simplified progress info instead of blurting out compiler commands every time (i.e. "Compiling XYZ" vs "gcc -o afkhaf aghaffoof.c -lfghj -lagfhkja -akfha -Wah -Wajgh -aekfh -laksighf-lajfhjf -alkhaf- lakghaf- -lajigfb -lafgjh..."). Sure, this is doable with makefiles too, but it seems that everytime people do it there, it needs more environment variables to be set. Meanwhile with scons, we can easily turn it on/off with command-line options. No wonder so many people miss and ignore compiler warnings, leading to some very weird bugs in their code (also a factor leading to the issues in a previous post).
Despite this, at times I have resorted to using one of my home-brewed py-scripts to just compile some simple stuff when I've been too lazy to read through the SCons docs to get things done (or when there were some problems which I couldn't fix in time).

Fortunately, this time it didn't happen, so now I think I've finally got a reasonable scons template. The template included here is what I'm using to compile the code for one of my assignments, btw.