How clearmake interprets double-colon rules

Double-colon rules are a special kind of makefile construct that allows several independent rules for one target, each with a possibly different build script.

The semantics given to these rules by other make programs (such as Gnu make, Sun make, and for clearmake when CRs are not being generated) are that commands within each double-colon rule are executed if the target is older than any dependencies of that particular rule. The result can be that none, any, or all of the double-colon rules are executed.

However, when clearmake creates CRs and associates them with the results of its builds, this interpretation runs the risk of generating incomplete CRs, which do not contain all the versions and build scripts used to build the targets. For this reason, clearmake interprets these rules in a more conservative way.

When building a target specified by a number of double-colon rules, clearmake concatenates all build scripts from all the double-colon rules for that target and runs them in a single audited script.

To produce the correct results, any subtargets must already have been built, so clearmake builds any out-of-date subtargets before it executes the concatenated build script.

As a result, you might observe these differences in behavior between clearmake and other make programs concerning double-colon rules:

  • clearmake runs more of the build scripts than other make programs.
  • clearmake might run the build scripts in a different order than other make programs.

However, given the intended use and standard interpretation of double-colon rules, these differences still produce correct builds and complete correct CRs.