Chapter 3
Using DEC/CMS with MMK
This chapter describes the use of Digital's DEC/Code Management System (DEC/CMS) with MMK.
3.1. The /CMS Qualifier
The MMK command supports a /CMS qualifier, which activates the automatic use of the currently set DEC/CMS library, or another DEC/CMS library that you specify, for the current build. This causes source files to be fetched out of the DEC/CMS library automatically, if needed. In addition, the MMK description file will automatically be fetched out of the DEC/CMS library if it does not exist.
The built-in suffix list and dependency rules in MMK include default rules for fetching source files out of DEC/CMS libraries. Suffixes ending in a tilde character (“~”) signify DEC/CMS library elements. The built-in DEC/CMS element rules are used only if /CMS is specified on the MMK command.
3.2. Explicit CMS Element References
You can explicitly reference a CMS library element in your MMK description file by adding a tilde to the end of the file specification. For example:
MAIN.FOR : MAIN.FOR~
You can also explicitly name the CMS library from which the element should be fetched, by specifying a device and/or directory name:
MAIN.FOR : SOURCE_DISK:[CMS_SOURCE]MAIN.FOR~
If you do not explicitly name the CMS library, the currently set CMS library (set with CMS SET LIBRARY) will be used.
3.2.1. Specifying the Element Generation
By default, MMK uses the qualifier /GENERATION=1+ on all CMS FETCH operations, to get the highest-numbered generation of a particular element, or whichever generation you specify on the MMK /GENERATION qualifier. If you need to build a dependency on a specific generation of an element, you may do so by specifying the /GENERATION qualifier on the file name:
MAIN.FOR : MAIN.FOR~/GENERATION=37
The above example would cause generation 37 of the MAIN.FOR file in the current CMS library to be used for the build.
3.3. Inference Rules for CMS Files
MMK comes with built-in inference rules for fetching source files from a CMS library. Like DEC/MMS, MMK uses these rules only when you specify the /CMS qualifier on the MMK command. This allows you to have a makefile like the following:
TEST.EXE : TEST.OBJ
$(LINK)$(LINKFLAGS) $(MMS$SOURCE)
TEST.OBJ : TEST.FORIf you have a CMS library set and you specify the /CMS qualifier on the MMK command, MMK will automatically check to see if TEST.FOR resides in the CMS library and will fetch it out of the library if needed.
However, MMK also allows you to omit the second dependency in the makefile, and will automatically “double-infer” the existence the .FOR file, even if it has not yet been fetched out of the CMS library.
3.3.1. CMS and Prefixed Inference Rules
You can have MMK automatically search specific CMS libraries for source files by using prefixed inference rules. For example, if you were working on a cross-platform development project which used two CMS libraries - one for OS-specific source code and another for common source code - you might use the following prefixed rules:
{CMSSRC:[VMS_SPECIFIC]}.FOR~{}.FOR :
{CMSSRC:[COMMON]}.FOR~{}.FOR :This sequence would cause MMK to automatically search the CMSSRC:[VMS_SPECIFIC] CMS library for a FORTRAN source file, then search the CMSSRC:[COMMON] library. If the file were not located in either library, MMK would fall back to using the currently set CMS library. You must still have a CMS library set and you must specify the /CMS qualifier for prefixed CMS inference rules to be tried.