SML# Document

Chapter 27. The smlsharp command

The smlsharp command invokes the SML# compiler to translate SML# programs into machine code, generate object files, and link them together into an executable file. Similarly to the traditional C compiler driver command, the user can do only one step of this compilation sequence by specifying a mode switch to the smlsharp command. The interactive session is also invoked by the smlsharp command.

The synopsis of smlsharp command is as follows:

smlsharp [ option ] [ -- ] [ inputFile ]

Each argument of smlsharp command is either a command line option or input file name. A command line usually starts with a minus sign (-). The order of command line options does not matter except for a few options such as -I and -L. Optional -- indicates the end of the command line option sequence; any arguments after -- are not interpreted as options. Arguments other than options are input file names. The input file names may be interleaved with the option sequence. Regardless of the order of options and input file names, all command line options are interpreted at first, and then the effect of the options are applied to all input files.

In addition, several environment variables affects the behavior of the smlsharp command. Such environment variables also affects not only smlsharp but also all programs compiled by the SML# compiler.

In this chapter, we introduce smlsharp's command line options and environment variables separately for each category.

Contents