CM can be used to build stand-alone programs. In fact SML/NJ itself--including CM--is an example of this. (The interactive system cannot rely on an existing compilation manager when starting up.)
A stand-alone program is constructed by the runtime system from existing binfiles or members of existing stable libraries. CM must prepare those binfiles or libraries together with a list that describes them to the runtime system.
val mk_standalone : bool option ->
{ project: string, wrapper: string, target: string } ->
string list option
Here, project and wrapper name description files and target is the name of a heap image--with or without the usual implicit heap image suffix; see the description of SMLofNJ.exportFn from the (SML/NJ-specific extension of the) Basis Library [RG99].
A call of mk_standalone triggers the following three-stage procedure:
The idea is that project names the library that actually implements the main program while wrapper names an auxiliary wrapper library responsible for issuing a call of SMLofNJ.exportFn (generating target) on behalf of project.
The programmer should normally never have a need to invoke CM.mk_standalone directly. Instead, this function is used by an auxiliary script called ml-build (see Section 14.1).