Genmake

Editing makefiles is tedious and errorprone. Genmake is a collection of csh and awk scripts that can automate most of the process. Unfortunately, editing csh and awk scripts is also tedious and errorprone. But if you use genmake, the dirty work is already done for you.

What is Genmake?

Genmake is simply a program that examines your source code directory tree and creates or updates a corresponding "build directory" somewhere else (you tell it where). The build directory contains a makefile that can build all of the code in the source directory using almost any version of the make utility.

When genmake is finished, you compile and build your programs directly in the build directory, by cd'ing into the build directory and typing make (target), just as if you had created the makefile yourself. As make runs, the sources are read from the source directory, but all objects and executables end up in the build directory.

If you define the right shell variables before you run genmake (see instructions below), the resulting makefile will have all of the right rules to build your programs on whatever type of system you ran genmake on. Note: if you add, move, or delete any files in your source directory, then you must run genmake again to update the rules in the build directory. Note: make sure the noclobber option in your shell is disabled, or you may get a "file already exists" message.

This version of genmake includes a template for building multi-threaded C++ programs on Duke CS Sun and Alpha workstations for the CPS 210 class. If you run genmake on an alpha then you must build on an alpha. If you run genmake on a sun you must build on a sun. Genmake can be used to create two separate build directories (one for alphas and one for suns) building from the same source code.

Why should I bother with genmake?

How do I set up genmake so I can use it?

To "install" genmake for your use, follow these easy steps:

How do I build my programs with genmake?

To use genmake on a package of source code, follow these steps:

Does genmake really work?

There are a number of restrictions with this version of genmake.


chase@cs.duke.edu