Recompilation management helps the programmer recompile only what is necessary after a change to a unit signature or unit body.
Type-safe linking prevents the programmer from creating unsafe or meaningless programs. The load function and the batch linker ensure probabilistically type-safe linking, so it is virtually impossible to cause the system to create a type-unsafe program.
Consider the example program in Section 4.6 consisting of the three units Evaluate, Expr, and Reduce. Assume their source files *.sig and *.sml reside in a particular directory. Copy a Makefile stub (see below) to that directory, and change to that directory.
Step (3) must be repeated whenever you have modified a component of the program system. Step (2) need only be repeated if the inter-dependencies of some components change, or if you add or remove an explicit signature file. Step (1) need only be repeated when you add or delete an entire unit of the program system.
Old versions of the compiled *.ui and *.uo files can be removed by executing:
The inter-dependencies are computed by a small ML program mosmldep, which correctly handles nested comments and strings in the source files.
To use the Makefile below, first edit it so that all the required units (.uo files) appear on the line beginning with `all:', then proceed as explained in Section 6.1. You do not need to edit any other part of the Makefile. In particular, the dependencies following DO NOT DELETE THIS LINE are generated automatically when executing make depend (as above). A copy of the Makefile can be found in mosml/tools/Makefile.stub.
You will need only the Unix utility make.
To use the Makefile below, first edit it so that all the required
units (.uo files) appear on the line beginning with `all:', then
proceed as explained in Section 6.1. You do not need
to edit any other part of the Makefile. In particular, the
dependencies following DO NOT DELETE THIS LINE are generated
automatically when executing make depend (as above). A copy of
this makefile can be found in
mosml\
tools\
makefile.stb.
You will need a DOS version of make, such as that from Borland C++ version 2.0 or 3.0.
Recompilation management for DOS is essentially as for Unix, except for the usual complications that follow from the restrictions on the length of file names, and from their case-insensitivity.
Under MS DOS, filenames are all the same case and can be at most 8 characters long (plus a 3 character extension). Since file names are used as unit names, this may cause problems. We attempt to circumvent these problems as follows: