smake

smake
Login

smake is an easy to use utility that allows developers to build makefiles with a fully capable, yet extremely easy to use script language, Tcl. This allows one to use all the facilities that Tcl provides to deal with large projects like namespaces, packages, database access etc. With the traditional UNIX make this is difficult and often ugly hacks are involved. Plus, with Tcl you can easily replace the dependency checking routines to suit the needs of the project (f.ex. to automatically check and fetch new versions of the file from the net, without having to specify the operation for each target). smake includes a fairly sophisticated but easy to understand rule system, which (unlike make) offers the possibility to specify general rules and more specific exceptions to these rules

Tcl is a syntactically simple, portable but powerful language which is easy to learn and expand. It takes less than an hour to learn enough to be able to create sophisticated makefiles for smake (a simple example is included in the documentation). Basic make style makefiles can be built with smake without even that knowledge, as the smake syntax is extremely straightforward and clear to understand.

Example

This is a very simple dislay of a Smakefile. It specifies targets, with code to execute if the dependencies have been updated. Note that the code within each target block is executed every time a target is checked, while the depend block is executed only if one of the dependencies have changed. By default, the target is marked as 'changed' if its dependency block is run, but this can be overridden.

target hello.o { 
  depend {foo.h main.c} {
    compile main.c 
  }
}
target foo.o {
  depend {foo.c foo.h} {
    compile foo.c
  }
}
target testiprg {
  depend {foo.o main.o} {
    link testiprg {foo.o main.o} Tcl8.0
  }
}
target all {
  depend testiprg {}
}

On 2011-06-14 18:05:48 UTC anonymous added:
This looks amazing. Good luck to ya.