The default base rules provides a set of high level assertion operators to support building common types of targets (executables, libraries, java classes, etc.) from common languages. Users can program their own assertions to simplify Makefiles and to avoid redundant specification of project build procedures. Details are specified only once in a base or global Makefile, updating these automatically updates the behavior in all Makefiles for enhanced portability.
The following example uses the built-in double colon (
assertion operator. An executable named
abc will be
generated from the source files listed on the right hand side and
linked with libxyz. The man page
abc.1 will be installed
in the corresponding man directory if the
action is used.
INSTALLROOT = $(VROOT) .SOURCE.a : $(LIBDIR) abc :: a.c b.c c.c -lxyz abc.1
$ nmake install + cc -O -I- -c a.c + cc -O -I- -c b.c + cc -O -I- -c c.c + cc -O -o abc a.o b.o c.o ../../lib/libxyz.a + cp abc ../../bin/abc + cp abc.1 ../../man/man1/abc.1