The SRC Modula-3 compiler imposes strict requirements on how you organize your source files. In general terms, it expects that you will organize your program as a collection of packages, which are themselves collections of interfaces and modules. Each package resides in its own package directory containing two subdirectories: the src directory, which contains the source code files; and the build directory, which is created when you run the compiler to hold the compiled code. For example, a package 'List' residing in the directory /proj/harry/m3 would contain source code in the directory /proj/harry/m3/List/src, and if your platform is SPARC, the build directory would be /proj/harry/m3/List/SPARC.
The m3build
command is used to compile a Modula-3 package. It
expects to be run from within a package directory, and executes instructions
in an file named 'm3makefile' located in the directory named 'src' in the
current directory. This means that if you are inside the src directory, you
must issue the command cd ..
to move to the parent directory
before you issue the m3build
command. Mysterious error
messages (like "Cannot find build directory SPARC") result if you do not
abide by this scheme.