next up previous contents
Next: 4.1.2 Linking and execution Up: 4.1 Structure CM Previous: 4.1 Structure CM   Contents


4.1.1 Compiling

Two main activities when using CM are to compile ML source code and to build stable libraries:


  val recomp : string -> bool
  val stabilize : bool -> string -> bool

CM.recomp takes the name of a program's ``root'' description file and compiles or recompiles all ML source files that are necessary to provide definitions for the root library's export list. ( Note: The difference to CM.make is that no linking takes place.)

CM.stabilize takes a boolean flag and then the name of a library and stabilizes this library. A library is stabilized by writing all information pertaining to it, including all of its library components (i.e., subgroups), into a single file. Sublibraries do not become part of the stabilized library; CM records stub entries for them. When a stabilized library is used in other programs, all members of the library are guaranteed to be up-to-date; no dependency analysis work and no recompilation work will be necessary. If the boolean flag is false, then all sublibraries of the library must already be stable. If the flag is true, then CM will recursively stabilize all libraries reachable from the given root.

After a library has been stabilized it can be used even if none of its original sources--including the description file--are present.

The boolean result of CM.recomp and CM.stabilize indicates success or failure of the operation ( true = success).


next up previous contents
Next: 4.1.2 Linking and execution Up: 4.1 Structure CM Previous: 4.1 Structure CM   Contents
Matthias Blume
2001-07-19