Oberon ||
Compiler & Tools ||
Library ||
Module Index ||
Search Engine
Ulm's Oberon System:
mmo
NAME
mmo - make makefile for Oberon
SYNOPSIS
mmo
{(+|-){a|A|L}}
[-(c|C|u)
makefile]
{(+|-)l
library}
[-p
proto]
{-t
target | +t target module...}
{macro=val}
{file}
DESCRIPTION
Mmo
is a general tool for extracting dependency information from Oberon
source files and libraries.
By default, mmo generates output in a form acceptable by
GNU make(1) onto standard output.
Makefiles generated by mmo may be customized and updated.
Customization covers addition of own text to the makefile
(e.g. rules for source file printing and installing) and
changes of the parts generated by mmo
(e.g. change of oc options).
Makefiles are structured into sections by mmo
to allow separation of parts generated by mmo and parts
added from other sources.
Sections are either named and of interest for mmo or
unnamed and remain unaffected on updates.
Sections are delimited by comments which start at the beginning of a line.
Named section headers consist of the leading "#" which introduces
the comment and a name and some optional specifications enclosed in braces,
e.g. "# {flags: +a -A -l -P}".
Makefile updating depends on the various settings found from earlier
mmo-runs in the makefile and the options given at the command line.
Option settings at the command line become the defaults for the
next update.
Options at the command line and in the section named "options"
are introduced either by "+" (representing TRUE or add) or by
"-" (FALSE or delete).
Following options are recognized:
- (+|-)a
-
Switches whether symbol files are to be archived into SYM or not.
oc(1) requires SYM to be created first; this could be
easily done by "ar q SYM".
Default is FALSE.
- (+|-)A
-
If set, it causes objects to be maintained in a library
(default name: lib.a).
Default is FALSE.
- (+|-)l lib
-
Adds or deletes the given library.
The library name must be equal to one of the directories found in
OBPATH or OBLIB.
The list of libraries is passed to oc(1) and used to
collect library dependencies.
- (+|-)L
-
If set, it requests all dependencies to the library to be included
in the makefile.
To achieve this, OBPATH, OBLIB and
all libraries specified by +l are considered.
Dependencies enclose those to the symbol files and to the objects
of the libraries.
Default is FALSE.
- (+|-)P
-
If set, all reference cycles
(e.g. module a imports b and module b imports a)
are printed to standard error.
The main problem of reference cycles is the undefined order of initialization;
so every reference cycle member must not use anything of the other members
during initialization.
Default is FALSE.
- (+|-)t target
-
Adds or deletes a target which is the result of a ld-run of oc(1).
A target is given by a core of modules (which may be among the
sources or members of the library).
Mmo calculates the transitive closure of the core set and
generates the appropriate linkage line.
The target name determines the name of the output file.
The name of the output file may be changed independently from the
target name by editing the makefile (change of T_target).
On makefile creation the list of targets defaults to those
modules which are not imported by any other modules.
If A is set to TRUE, the list defaults to the empty list.
Modes of operation include makefile creation and makefile updates
in some variants:
- -c makefile
-
Creates the given makefile.
Makefile creation depends on a prototype which is a short makefile
consisting of the wanted section headings and some additional rules
like cleanup and source file printing.
In fact, makefile creation works like makefile updates with
different source and target makefile.
The prototype is searched for in the current directory
(.mmo_proto), in the parent directory (../.mmo_proto),
in the home directory, and finally in the library directory
($OBLIB/mmo_proto).
The list of sources to be considered may be specified at the
command line and defaults to all Oberon sources in the current
working directory.
- -C makefile
-
Works like -c but requests no prototype to be taken.
Instead, all sections are generated by mmo in the
appropriate order.
- -p proto
-
Allows to specify a prototype for -c.
- -u makefile
-
Updates the given makefile.
The list of sources may be given at the command line and
defaults to the list given earlier (src macro in the
"macros" section).
"-" may be given as makefile or prototype to cause
standard input or output to be taken.
"mmo -u -" reads a makefile from standard input and prints
the updated version to standard output.
Mmo
prints a newly created makefile to standard output if
none of this options has been given (i.e. mmo -c -).
Some macro definitions may be overridden in the command line
(e.g. OC or OCFLAGS).
Macro definitions are given as macroname=value.
All remaining arguments are taken as Oberon source files.
DIAGNOSTICS
No output is written to the target makefile in case of errors.
Beside messages printed to standard error, errors are
indicated by an exit code of 1.
Error messages include:
- mmo: bad options found in makefile: options
-
Results from errors in the specifying part of the "options" section.
Only boolean option may be given and command line syntax is required.
- mmo: bad reference cycle: module
-
Reference cycles of imports of definitions are impossible to compile.
The given module name is one of the cycle members.
- mmo: syntax error: filename
-
Mmo parses the beginning of a source file (module header
and import list) and aborts on syntax errors.
- mmo: unknown section name: section name
-
Named sections with unknown names disappear on updating and
cause this warning to be printed.
FILES
- .mmo_proto
-
prototype for makefile creations
- *.ts
-
temporary files which are needed by mmo rules
SEE ALSO
GNU make(1), oc
BUGS
The output of mmo is not accepted by standard make(1).
The +L option increases the time needed by GNU make(1)
significantly.
Edited by: borchert, last change: 2001/12/06, revision: 1.6, converted to HTML: 2001/12/06
Oberon ||
Compiler & Tools ||
Library ||
Module Index ||
Search Engine