SourceForge has been redesigned. Learn more.

Tree [702725] pm tip /

Read Only access

File Date Author Commit
 build-tools 2011-08-27 David Given David Given [27150c] Fixed typo in previous checkin...
 examples 2006-10-12 dtrg dtrg [9380b3] Moved the sample pmfiles and their supporting s...
 lib 2007-04-30 dtrg dtrg [adc1d4] Fixed bug 1710252, which was resulting in dynam...
 lua 2009-02-28 dtrg dtrg [444a93] Applied tweak to allow pm to run on Interix.
 src 2011-08-27 David Given David Given [12872f] Bumped version number again.
 tests 2011-08-26 dtrg dtrg [76a739] Fix a test bug where files weren't getting clos...
 .hgtags 2011-08-27 David Given David Given [702725] Added tag release- for changeset 7ee072e...
 .project 2007-10-04 dtrg dtrg [30fd28] Added Eclipse project file.
 CHANGELOG 2011-08-27 David Given David Given [12872f] Bumped version number again.
 LICENSE 2010-03-12 dtrg dtrg [bcf4fb] Updated for version 0.1.5.
 README 2011-08-27 David Given David Given [12872f] Bumped version number again.
 build 2010-03-11 dtrg dtrg [3fe88b] Yet more bootstrap tweaking, this time to work ...
 mkdist 2011-08-27 David Given David Given [ce825e] Don't release .hg files.

Read Me

                             PRIME MOVER V0.1.6.2

                            (C) 2011 David Given


Prime Mover (hereafter pm) is a build tool, similar to make, but (hopefully)
more flexible and considerably more powerful. It is based on the Lua scripting
language, but a knowledge of Lua is not required to use it.

For a full description, and for the documentation, see the Prime Mover website:

pm supports:

* Automatic dependency checking for C and C++ files
* Explicit dependency graphs
* Arbitrarily complex rules (because you can embed chunks of Lua script in
  your pmfiles to do anything you like)
* Can handle multiple directories at the same time (no more recursive
* Easy cross-compilation (object files are stored in pm's own object file
  cache, not in your build tree)
* Easy deployment (all of pm's core code consists of exactly *one* file, which
  can be run on any platform --- no installation or compilation needed!)
* Object oriented design (making it very easy to create your own rules by
  specialising one of the existing ones)
pm's differs from make primarily in that all dependencies in pm are explicit.
make will attempt to determine what needs to be done to build a file, based on
a set of rules that tell it how to transform file types. This works well
until you need to have *different* rules apply to two files of the same
type... which then causes make to quickly become unmanageable. pm avoids this
by requiring all rules to be explicit. This is much less work than it sounds,
never fear.

Here is an example pmfile that will build a simple C program:

include ""         -- load the C rules

default = cprogram {   -- default target builds a C program
  cfile "main.c",      -- cfile transforms a C source file into an object file
  cfile "utils.c",
  cfile "aux.c",
  install = pm.install("myprogram") -- once built, this makes the result available

If this is saved as 'pmfile' in the current directory, it can be invoked by
simply doing:

...and it will build.


The full documentation for Prime Mover is far out of the scope of this
document. Instead, see the Prime Mover website:

In particular, if you use Prime Mover, please join the mailing list. This will
allow you to ask questions, hopefully receive answers, and get news about any
new releases. You can subscribe or view the archives at the following page:


As a Prime Mover user, you will want to look at the following directories
in the distribution.

  - bin: contains the Prime Mover executables themselves.
  - lib: contains the standard plugins.
  - examples: contains some example pmfiles.
  - examples/source: source code used by the example pmfiles.
If you wish to modify Prime Mover itself, you'll also need to know about
these directories.

  - src: contains the Prime Mover source code itself.
  - lua: contains the Lua interpreter source code.
  - build-tools: contains some utilities used as part of the build process.
  - tests: the unit tests that are run during the build process.

Prime Mover is a cross platform application. As a result, the executables will
run anywhere. This means that I can supply working versions with this archive,
so that they can be used without needing to build them yourself. (This avoids
any painful bootstrapping issues.)

You can find the Prime Mover executables in the bin directory.


However, if you wish to modify Prime Mover --- that is, the core application,
not the plugins --- you still need to know how to rebuild the Prime Mover

This is done using the 'build' script. This will rebuild all three
executables, and then automatically run the unit tests. In order to build
Prime Mover, you must have the following software available:

  - Lua 5.0 or 5.1
  - uuencode
  - the usual collection of Unix file and text utilities


The lua directory contains patched versions of:

 - Lua 5.0.2
 - lposix for Lua 5.0 by Luiz Henrique de Figueiredo <>

The build-tools directory contains (among other things written by me):

 - LuaSrcDiet by Kein-Hong Man <> 


Prime Mover was written by me, David Given. You may contact me at, or visit my website at There may or
may not be anything interesting there.