mamake - make abstract machine make


mamake [ options ] [ target ... ] [ name=value ... ]


mamake reads make abstract machine target and prerequisite file descriptions from a mamfile (see -f) and executes actions to update targets that are older than their prerequisites. Mamfiles are generated by the --mam option of nmake(1) and gmake(1) and are portable to environments that only have sh(1) and cc(1).

In practice mamake is used to bootstrap build nmake(1) and ksh(1) in new environments. Mamfiles are used rather than old-make makefiles because some features are not reliably supported across all make variants:

action execution

Multi-line actions are executed as a unit by $SHELL. There are some shell constructs that cannot be expressed in an old-make makefile.

VPATH is properly interpreted. This allows source to be separate from generated files.

Ordered subdirectory recursion over unrelated makefiles.

mamprobe(1) is called to probe and generate system specific variable definitions. The probe information is regenerated when it is older than the mamprobe command.

For compatibility with nmake(1) the -K option and the recurse and cc-* command line targets are ignored.


Explain reason for triggering action. Ignored if -F is on.
-f file

Read file instead of the default. The default value is Mamfile.
Ignore action errors.
Continue after error with sibling prerequisites.
Print actions but do not execute. Recursion actions (see -r) are still executed. Use -N to disable recursion actions too.
-r pattern

Recursively make leaf directories matching pattern. Only leaf directories containing a makefile named Nmakefile, nmakefile, Makefile or makefile are considered. The first makefile found in each leaf directory is scanned for leaf directory prerequisites; the recusion order is determined by a topological sort of these prerequisites.
-C directory

Do all work in directory. All messages will mention directory.
-D level

Set the debug trace level to level. Higher levels produce more output.
Force all targets to be out of date.
Like -n but recursion actions (see -r) are also disabled.
Print the program version and exit.
-G, --debug-symbols

Compile and link with debugging symbol options enabled.
-S, --strip-symbols

Strip link-time static symbols from executables.


gmake(1), make(1), mamprobe(1), nmake(1), sh(1)



mamake (AT&T Research) 2011-08-31

Glenn Fowler <>

Copyright © 1999-2012 AT&T Intellectual Property