Configuration record hierarchies

A typical makefile has a hierarchical structure.

Thus, running clearmake 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).

Figure 1: Configuration record hierarchy

hierarcy

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.o, msg.o, and libhello.a as build dependencies of derived object hello:

    hello: hello.o msg.o libhello.a
    ...

    Accordingly, the CR for hello is the parent of the CRs for the .o files and the .a file.

  • In a build script

    For example, in the following build script, derived object libhello.a in another directory is referenced in the build script for derived object hello:

    hello: $(OBJS)
         cd ../lib ; $(MAKE) libhello.a
         cc -o hello $(OBJS) ../lib/libhello.a

    Accordingly, the CR for hello is the parent of the CR for libhello.a.

    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 for hello. The second line of the build script links the CR for ../lib/libhello.a with that of hello.

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 DevOps Code ClearCase® 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, ClearCase 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.