Configuration record hierarchies
A typical makefile has a hierarchical structure.
A typical makefile has a hierarchical structure. Thus, running clearmake or omake once to build a high-level target can cause multiple build scripts to be executed and multiple CRs to be created. Such a set of CRs can form a configuration record hierarchy, which reflects the structure of the makefile (see the following figure).
An individual parent/child link in a CR hierarchy is established in one of two ways:
- In a target/dependencies line
For example, the following target/dependencies line declares derived objects
hello.obj
,msg.obj
, andlibhello.lib
as build dependencies of derived objecthello.exe
:hello.exe: hello.obj msg.obj libhello.lib ...
Accordingly, the CR for
hello.exe
is the parent of the CRs for the.obj
files and the.lib
file. - In a build script
For example, in the following build script, derived object
libhello.lib
in another directory is referenced in the build script for derived object hello.exe:hello.exe: $(OBJS) cd ..\lib & $(MAKE) libhello.lib link /out: hello.exe $(OBJS) ..\lib\libhello.lib
Accordingly, the CR for
hello.exe
is the parent of the CR forlibhello.lib
.Note: The recursive invocation of clearmake in the first line of this build script produces a separate CR hierarchy, which is not necessarily linked to the CR forhello.exe
. The second line of the build script links the CR for..\lib\libhello.lib
with that ofhello.exe
by causing the link to read..\lib\libhello.lib
and making it a detected dependency.
The catcr and diffcr commands have options for handling CR hierarchies:
- By default, they process individual CRs.
- With the -recurse option, they process the entire CR hierarchy of each derived object specified, keeping the individual CRs separate.
- With the -flat option, they combine (or flatten) the CR hierarchy of each specified derived object.
Some VersionVault features process entire CR hierarchies automatically. For example, when the mklabel command attaches version labels to all versions used to build a particular derived object (mklabel -config), it uses the entire CR hierarchy of the specified DO. Similarly, VersionVault maintenance procedures do not scrub the CR associated with a deleted DO if it is a member of the CR hierarchy of a higher-level DO.