MKOVMAKE(8) System Manager's Manual MKOVMAKE(8)
mkovmake - optimizing overlay makefile generator
mkovmake [-On [basesize] [-n]] [-f makefile] [-s ovsize]
[-v max ov's] [-o program] [-l libraries ...]
[archives.a ...] basemodules.o ... -Z ovmodules.o ...
Mkovmake produces an overlay makefile (see make(1)) for a given set of object modules (see ld(1)). It is intended to be used inside make-
files in order to avoid computing module sizes and base/overlay structures each time changes are made in the source. Mkovmake can be
included, as shown in the examples below, inside makefiles of distributed sources so that the base and overlays would be automatically con-
structed whenever the program is made by a PDP-11. The makefile generated contains the make entry necessary for loading the modules
together into an automatic-overlay executable.
There are several options to allow various levels of user involvement in the construction process. These options set the sizes of various
components or the name of either the generated makefile or the make entry inside it. If these options are not used, mkovmake will guess at
the best sizes and use standard names, respectively.
-On Use optimizer level n.
-O1 Put only those modules listed before the -Z in the base, and construct optimal overlays for the remaining modules. The algo-
rithm of optimization for overlays is to iteratively add the module with the greatest number of "ties" with the modules cur-
rently on the overlay. A "tie" is a match between a global undefined symbol (see nm(1)) in one module with a global text
symbol in another. This measure is on a per-kbyte of text basis, and modules are added until no more will fit. If n is not
specified, level 1 optimization is assumed.
-O2 Optimize both the base and the overlays. If a -Z flag is used, modules before it will be placed in the base, plus those mod-
ules with the greatest number of global text symbols per kbyte of text, until no more modules will fit. If no -Z appears on
the command line, mkovmake will assume no initial base preference and will examine all modules for base and overlay optimiza-
tion. This is recommended for beginners.
If level-2 optimization is specified and the following argument begins with a number, it will be used as the size of the
base, without libraries. If not used, mkovmake will guess at how much room the libraries will take up, upto 24k. If base-
size is followed by the letter "k" or "K", it will be multiplied by 1024. If it is less than 10, it will be multiplied by
-n List the global text and undefined symbols as they are encountered, preceded by the module name and a "T" for text or "U" for
If no optimization is specified, modules will be packed on overlays as they appear in the command line until no more fit.
Specify the name of the generated makefile. If not specified, stdout will be used.
Specify the maximum size of overlays. Just as basesize above, if followed by a "k" or "K", ovsize will be multiplied by 1024, and
if less than 10, it will be multiplied by 8192. If ovsize is not specified, mkovmake will compute the total amount of text that is
not already assigned to the base, and guess at the size of overlays. Mkovmake guesses, pessimisticly, that 1/16th of each overlay
will be left blank.
Specify the maximum number of overlays to use. The default is NOVL, 15.
The name of the program being made. This is used in the make entry generated after the base and overlay definitions. If not used,
the makefile macro $(PROGRAM) will be inserted.
Extra libraries or archives, such as termlib or m can be specified, and will be placed in the generated make entry preceding the c
library. If not used, $(LIBS) will be inserted. Multiple libraries and archives can be specified and will be placed together in
the order they appear on the command line.
basemodules.o ... -Z ovmodules.o ...
Specify modules to be placed in the base and overlays, respectively. Mkovmake will ignore all redundancies, so ovmodules.o may be a
macro of all modules, while basemodules.o may be a subset. If using level-2 optimization, only one list, the macro of all modules,
If mkovmake is being used inside a makefile, the following lines can be inserted to automatically construct the base and overlay defini-
tions and load the result. The macro $(OBJS) is the list of all modules, mybigprogram is the program being made, and termlib is a library
that has to be loaded with the object modules:
mkovmake -fOvmakefile -O2 $(OBJS) -omybigprogram -ltermlib
make -f Ovmakefile
If it is known that $(BASE) is a macro of the only modules that are wanted in the base, $(GAME) is the program being made, and $(LIBS) con-
tains libraries (with -l prefixed) to be loaded with the modules, the following lines can be used:
mkovmake -fOvmakefile -O -o$(GAME) $(LIBS) $(BASE) -Z $(OBJS)
make -f Ovmakefile
If the user just wants a sample optimal makefile for the modules in the current working directory,
mkovmake -O2 *.o
make(1), nm(1), ld(1), strip(1), a.out(5), nlist(3)
mkovmake: unknown file type.
A command-line argument not recognized as an option argument didn't end in .o or .a.
mkovmake: not enough memory for ...
mkovmake failed to use malloc(2) to clear space for a needed list.
mkovmake: specified modules don't fit in base.
Level-2 optimization was used, and some modules were specified to be put in the base. But these modules were too big. Use basesize
to increase the base allotment, or reduce the number of base modules.
Certain pathological cases may cause unpredictable results. In particular, if the argument to an -f, -o, or -l option is separated from
the f, o, or l by a space or tab, and the argument ends, for some reason, in .o, the second parsing of the command line will think it's a
name of an object module and attempt to open it. Otherwise, options and names of modules may be freely mixed.
Mkovmake assumes that all arguments ending with .o or .a are simple object modules or archives, respectively, rather than looking at the
magic number and complaining if not.
There is no way to tell mkovmake to put a certain group of modules together on an overlay.
Mkovmake is incapable of telling how often a routine is called, or whether an executable could be loaded even without overlays.
Dennis T. Flaherty,
U of Notre Dame
June 30, 1990 MKOVMAKE(8)