<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta name="robots" content="index,nofollow">



<title>ManualPage - MLton Standard ML Compiler (SML Compiler)</title>
<link rel="stylesheet" type="text/css" charset="iso-8859-1" media="all" href="common.css">
<link rel="stylesheet" type="text/css" charset="iso-8859-1" media="screen" href="screen.css">
<link rel="stylesheet" type="text/css" charset="iso-8859-1" media="print" href="print.css">


<link rel="Start" href="Home">


</head>

<body lang="en" dir="ltr">

<table bgcolor = lightblue cellspacing = 0 style = "border: 0px;" width = 100%>
  <tr>
    <td style = "
		border: 0px;
		color: darkblue; 
		font-size: 150%;
		text-align: left;">
      <a class = mltona href="Home">MLton 20051202</a>
    <td style = "
		border: 0px;
		font-size: 150%;
		text-align: center;
		width: 50%;">
      ManualPage
    <td style = "
		border: 0px;
		text-align: right;">
      <table cellspacing = 0 style = "border: 0px">
        <tr style = "vertical-align: middle;">
      </table>
  <tr style = "background-color: white;">
    <td colspan = 3
	style = "
		border: 0px;
		font-size:70%;
		text-align: right;">
      <a href = "Home">Home</a>
      &nbsp;<a href = "Index">Index</a>
      &nbsp;
</table>
<div id="content" lang="en" dir="ltr">
MLton is run from the command line with a collection of options followed by a file name and a list of files to compile, assemble, and link with. 
<pre>mlton [option ...] file.{c|cm|mlb|o|sml} [file.{c|o|s|S} ...]
</pre>The simplest case is to run <tt>mlton&nbsp;foo.sml</tt>, where <tt>foo.sml</tt> contains a valid SML program, in which case MLton compiles the program to produce an executable <tt>foo</tt>.  Since MLton does not support separate compilation, the program must be the entire program you wish to compile.  However, the program may refer to signatures and structures defined in the <a href="BasisLibrary">Basis Library</a>. <p>
Larger programs, spanning many files, can be compiled with the  <a href="MLBasis">ML Basis system</a>.  In this case, <tt>mlton&nbsp;foo.mlb</tt> will compile the complete SML program described by the basis <tt>foo.mlb</tt>, which may specify both SML files and additional bases. 
</p>
<p>
MLton also supports a limited subset of <a href="CompilationManager"> SML/NJ CompilationManager (CM)</a> files.  For example, <tt>mlton&nbsp;foo.cm</tt> will compile the complete SML program consisting of the concatenation of all the SML files referred to (either directly or indirectly) by <tt>foo.cm</tt>. 
</p>
<h2 id="head-3f170caead65df254d786032a409a6f6d204bca6">Next Steps</h2>

    <ul>

    <li>
<p>
 <a href="CompileTimeOptions">CompileTimeOptions</a> 
</p>
</li>
    <li>
<p>
 <a href="RunTimeOptions">RunTimeOptions</a> 
</p>
</li>
</ul>

</div>



<p>
<hr>
Last edited on 2005-12-01 19:31:43 by <span title="ppp-71-139-183-221.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
</body></html>
