The builder contains some built-in support for machine and operating system dependencies. The package structure makes provision for separate build directories for different machine and operating system combinations. The default behaviour of cm3 is to generate the compiled object files, libraries and programs in the build directory corresponding to the machine and operating system on which cm3 is executing.
The following set of variables exist to allow m3makefiles to be parameterised by machine and operating system.
TARGET This variable defines the machine type on which the library or program being built will execute. It is chosen from the standard set of machine types on which Modula-3 runs. Check the runtime or cm3 packages for the complete set. OS_TYPE This variable defines the operating system under which the library or program being built will execute. Currently, Modula-3 supports two operating system variants, POSIX and WIN32. The former breaks down further into specific variants, but this variation is not made available to clients. [There is a way if you absolutely need it, see the unix package.] BUILD_DIR This names the package sub-directory in which object files, libraries and programs will be built. It is usually, but not always, the same as TARGET.
The net effect of the above allows a single package to build a family of architectural variants, in different build sub-directories, where each variant uses the same set of m3makefiles, parameterized by the above variables. If this degree of flexibility is insufficient, then the extra variation must be specified in a separate package, which can use include_pkg to access the shared sources.
PKG_USE This defines the location of the public package repository, e.g. /proj/m3/pkg or /usr/local/lib/m3/pkg. WDROOT This defines the standard location for a user's private package repository, typically $HOME/m3/pkg. This is typically used in override calls.