Go to the first, previous, next, last section, table of contents.

Multiple-Package Example

Consider a program Prog, which makes use of two custom Modula-3 libraries, LibA and LibB. Let's say that these packages are all located in your personal ~/m3 directory, so you have ~/proj/Prog/src, ~/proj/LibA/src, and ~/m3/LibB/src directories, each with its own collection of modules and an m3makefile.

The library m3makefiles would look something like this:

And similarly, PublicModule2, and PrivateModule2 for LibB.

The m3makefile for the main program Prog might look like this:


How to Build a Program

First you need to compile each directory:

Finally, you need to compile your main program

If there are no errors in the compilation, you should be able to find an executable in your TARGET diretory.


Hints

You can use the "override" command in your m3makefile in order to use a library that has not been shipped to the public repository. This comes handy when you'd like to test an existing library before shipping it to the public repository.


Go to the first, previous, next, last section, table of contents.