Source dependencies declared explicitly

Learn how to declare source dependencies.

The HCL VersionVault build auditing facility tracks only the MVFS objects used to build a target. Sometimes, you might track other objects. For example:

  • The version of a compiler that is not stored in a VOB
  • The version of the operating system kernel, which is not referenced at all during the build
  • The state of a flag-file, used to force rebuilds

You can force such objects to be recorded in the CR by declaring them as dependencies of the makefile target:

hello.o: hello.c hello.h /usr/5bin/cc my.flag
      rm -f hello.o
      cc -c hello.c

This example illustrates dependency declarations for these kinds of objects:

  • (hello.c, hello.h): Dependencies on MVFS objects are optional. These are recorded by clearmake and MVFS anyway.
  • /usr/5bin/cc: Dependencies on build tools are required to track the build tools that are not stored in VOBs. These dependencies are listed as non-MVFS objects in the configuration record.
  • my.flag: Dependencies on view-private objects can implement a flag-file capability.

    Use view-private files as flag files, rather than using non-MVFS files (such as /tmp/flag). In a parallel build, a view-private flag file is guaranteed to be the same object on all hosts; there is no such guarantee for a non-MVFS file.

As an alternative to declaring your C compiler as a build dependency, you can place it (and other tools) in a tools VOB. The versions of such tools are recorded, eliminating the need for explicit dependency declarations. Additional issues in the auditing of build tools are discussed in the section Explicit dependencies on searched-for sources.