ML-BUILD(1)
===========
:doctype:	manpage
:man source:	SML/NJ
:man version:	{version}

NAME
----
ml-build - command-line build tool for SML/NJ programs

SYNOPSIS
--------
*ml-build* ['OPTIONS'] 'group.cm' ['main' ['heap-image']]

DESCRIPTION
-----------
*ML-Build* is a command-line tool for building applications from SML source
files using the Compilation Manager and SML/NJ compiler.

OPTIONS
-------

*-h*::
  print a help message and exit.

*-C*'ctl'='value'::
  set the control 'ctl' to 'value'.

*-D*'name'='value'::
  define the CM variable 'name' to have the given value.

*-D*'name::
  define the CM variable 'name' to have the value 1.

*-U*'name'::
  remove any definition of the CM variable 'name'.

*-S* 'setup.cm'::
  load and execute the code specified by the CM file 'setup.cm' prior to the main
  build process.  This option allows one to customize the compiler via side-effect.

*-standalone*::
  use the *heap2exec*(1) tool to create a standalone executable program.

EXAMPLES
--------

`ml-build foo.cm`::
  builds the program `foo.<arch>-<opsys>` assuming a main function named `Main.main`.

`ml-build foo.cm Foo.main`::
  builds the heap-image file `foo.<arch>-<opsys>` with main function named `Foo.main`.

`ml-build sources.cm Foo.main prog`::
  builds the heap-image file `prog.<arch>-<opsys>` with main
  function named `Foo.main`.  This file can be loaded using the `@SMLload`
  option to the *sml*(1) command.

`ml-build sources.cm Main.main prog`::
  builds the executable program `prog` with main function named `Main.main`.

AUTHOR
------
*ML-Build* was written by Matthias Blume with modifications by John Reppy.

SEE-ALSO
--------
*heap2exec*(1), *ml-makedepend*(1), *sml*(1), *smlnj*(7)

COPYING
-------
Copyright (C) 2025 The Fellowship of SML/NJ

This is free software; see the source for copying  conditions.   There  is  NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
