The simple and abstract examples assume a single, one-part or hierarchical project layout. This example illustrates one way to use Jam to build a project which consists of several "parallel" projects with no particular "root" directory or project.

Incidentally, we use c++ on this project instead of c.

For this example, we hypothesize a project consisting of several separate sub projects, each of which may be targeted to a particular operating system. We have the following directories:

The server runs on Windows NT and on various Unix platforms*. The mac, pcwin and xwindows directories contain code for the various clients. All the various servers and clients rely on code in the "shared" directory. Finally, the all-bin directory contains a Jamfile which determines which set of sub projects to build for a given platform. As usual, Jam can be run in any of the sub directories; only the sub project in that directory will be compiled.

The point of this arrangement is it allows the separate sub projects to be very independant. For example, if you are working on the Mac client, you need only the "mac" and "shared" directories. Alternately, let's say you want to build all the sub projects which are appropriate to the platform on (and for) which you are compiling (for example, when building a release). In this case, you would get all the sub projects from your version control system and run Jam in the all-bin directory. The Jamfile there controls which sub projects go into the package for a release on a given operating system.

Things to try:


*Actually, each "client" or "server" application just prints a version string and exits, and should probably run on just about anything, but let's pretend.