Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/src/cm/Doc/manual.tex
ViewVC logotype

Diff of /sml/trunk/src/cm/Doc/manual.tex

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 634, Mon May 1 10:03:50 2000 UTC revision 642, Thu May 11 07:30:29 2000 UTC
# Line 1  Line 1 
1  \documentclass[titlepage]{article}  \documentclass[titlepage,letterpaper]{article}
2  \usepackage{times}  \usepackage{times}
3  \usepackage{epsfig}  \usepackage{epsfig}
# Line 13  Line 13 
14  \title{{\bf CM}\\  \title{{\bf CM}\\
15  The SML/NJ Compilation and Library Manager \\  The SML/NJ Compilation and Library Manager \\
16  {\it\small (for SML/NJ version 110.28 and later)} \\  {\it\small (for SML/NJ version 110.29 and later)} \\
17  User Manual}  User Manual}
19  \setlength{\parindent}{0pt}  \setlength{\parindent}{0pt}
# Line 801  Line 801 
801  runtime system in order to perform stand-alone linkage of the given  runtime system in order to perform stand-alone linkage of the given
802  program. Upon failure, {\tt CM.mk\_standalone} returns {\tt NONE}.  program. Upon failure, {\tt CM.mk\_standalone} returns {\tt NONE}.
804  \subsubsection*{Support for {\tt make}}  \subsubsection*{Finding all sources}
806  CM has some limited support for generating dependency information that  The {\tt CM.sources} function can be used to find the names of all
807  is usable by other compilation management tools, in particular, the  source files that a given library depends on.  It returns the names of
808  {\tt make} program found in {\sc Unix}.  all files involved with the exception of skeleton files and binfiles
809    (see Section~\ref{sec:files}).  Stable libraries are represented by
810    their library file; their description file or consitutent members are
811    {\em not} listed.
813    Normally, the function reports actual file names as used for accessing
814    the file system.  For (stable) library files this behavior can be
815    inconvenient because these names depend on architecture and operating
816    system.  For this reason, {\tt CM.sources} accepts an optional pair of
817    strings that then will be used in place of the architecture- and
818    OS-specific part of these names.
820    \begin{verbatim}
821      val sources :
822        { arch: string, os: string } option ->
823        string ->
824        { file: string, class: string, derived: bool } list option
825    \end{verbatim}
827    In case there was some error analyzing the specified library or group,
828    {\tt CM.sources} returns {\tt NONE}.  Otherwise the result is a list
829    of records, each carrying a file name, the corresponding class, and
830    information about whether or not the source was created by some tool.
832    Examples:
834    \begin{description}
835    \item[generating ``make'' dependencies:]
836    To generate dependency information usable by Unix' {\tt make} command,
837    one would be interested in all files that were not derived by some
838    tool application.  Moreover, one would probably like to use shell
839    variables instead of concrete architecture- and OS-names:
840    \begin{verbatim}
841      Option.map (List.filter (not o #derived))
842        (CM.sources (SOME { arch = "$ARCH", os = "$OPSYS" })
843             "foo.cm");
844    \end{verbatim}
845    \item[finding all {\tt noweb} sources:]
846    To find all {\tt noweb} sources (see Section~\ref{sec:builtin-tools}),
847    e.g., to be able to run the document preparation program {\tt noweave}
848    on them, one can simply look for entries of the {\tt noweb} class.
849    Here, one would probably want to include derived sources:
850  \begin{verbatim}  \begin{verbatim}
851    val makedepend :    Option.map (List.filter (fn x => #class x = "noweb"))
852        { group: string, targetname: string, outstream: TextIO.outstream }      (CM.sources NONE "foo.cm");
       -> bool  
853  \end{verbatim}  \end{verbatim}
854    \end{description}
 A call to {\tt CM.makedepend} writes a dependency entry for target  
 {\tt targetname} to the specified output stream.  The syntax is the  
 one used by {\tt make}'s makefiles. The actual dependencies are those  
 implicitly given by library {\tt group}, while the targetname is an  
 arbitrary, uninterpreted string.  
 Source items that appear in the dependency list can be:  
 \item ML source file names which are members of non-stable libraries,  
 \item CM description file names for non-stable libraries and groups, or  
 \item names of files containing stable libraries.  
 Note that names of stable libraries vary depending on operation system  
 and CPU type.  
856  \subsection{The autoloader}  \subsection{The autoloader}
857  \label{sec:autoload}  \label{sec:autoload}
# Line 1059  Line 1083 
1083  section~\ref{sec:libreg} for how to to circumvent this restriction.)  section~\ref{sec:libreg} for how to to circumvent this restriction.)
1085  \subsection{Built-in tools}  \subsection{Built-in tools}
1086    \label{sec:builtin-tools}
1088  \subsubsection*{The ML-Yacc tool}  \subsubsection*{The ML-Yacc tool}
# Line 1229  Line 1254 
1254  with suffix {\tt .nw} are automatically recognized as belonging to  with suffix {\tt .nw} are automatically recognized as belonging to
1255  this class.  this class.
1257  The noweb tool takes a list of targets.  Each target individually can  The list of targets that are to be extracted from a noweb file must be
1258  have a variety of options.  A target is specified by a separate  specified using tool options.  A target can then have a variety of its
1259  tool option labelled {\tt target}.  The tool option usually has the  own options.  Each target is specified by a separate tool option
1260  form of a sub-option list.  Recognized sub-options are:  labelled {\tt target}.  The option usually has the form of a
1261    sub-option list.  Recognized sub-options are:
1263  \begin{description}  \begin{description}
1264  \item[name] the name of the target  \item[name] the name of the target

Removed from v.634  
changed lines
  Added in v.642

ViewVC Help
Powered by ViewVC 1.0.0