%
% MMSGEN Tool Document
%


\input{read_general:[procedures]sesdfmt.tex} % Latex input file defining 
					     % standard format

\newcommand{\revision}{Rev. A}			% latest revision letter

\newcommand{\version}{Version 1}		% latest version 

\newcommand{\mmsgen} {{\it MMSGEN \/}}
\newcommand{\runningtitle}{MMSGEN Tool}  	% title for top of page
\newcommand{\control}{ SCI89136 }	% ST ScI control number
\newcommand{\modname}{{\bf mmsgen.tex}}	% file name in library
\newcommand{\modlibe}{{\bf read\_tools:[sogs]}} 	% BROWSE directory
\renewcommand{\date}{{\bf November 29, 1988}}		% Date of Issue
\renewcommand{\author}{Ted Bauer}		% Author(s) of Document

\thispagestyle{empty}			% No header or number on first page
\markboth{\control \hspace{0.3in} \runningtitle \hspace{0.3in} 
\version \hspace{0.3in}}{\control \hspace{0.3in} \runningtitle 
\hspace{0.3in} \version \hspace{0.3in}}

\begin{document}
\vspace*{1in} 
\begin{center} 

{\Large{\bf MMSGEN Tool}}\footnote{This is module {\bf 
\modname{}} in library {\bf \modlibe{}}, printed \today} \\

\bigskip
\begin{bf} 
\control \\
\date \\
\bigskip 
\end{bf} 
\author \\ 
\bigskip
\vspace*{2.0in}
{\bf Abstract } \\
\bigskip
\end{center}

The \mmsgen tool is used to generate a compile MMS for files with
the following extensions:  .FOR, .EQF, .EQE, .FBL, .C, .SCN, .MSG, .MAR, .MBL,
.X.

\clearpage				% Table of Contents page

\tableofcontents

\clearpage

\renewcommand{\thesection}{\arabic{section}}
\renewcommand{\thepage}{\thesection-\arabic{page}}

\section{Introduction}

The \mmsgen tool is used to generate a compile MMS for files with
the following extensions:  .FOR, .EQF, .EQE, .FBL, .C, .SCN, .MSG, .MAR, .MBL,
.X.  It scans one or more input files creating one or more MMS files with 
the correct dependency list and action lines to build or compile to target
object file.

\section{Features}

\subsection{Handles Various Source Languages}

The \mmsgen tool can create MMS files for a variety of different 
source languages.  The tool keys off of the file extension to determine
what to source language is.  There are different parsers for the different
source languages to parse for their include file statements to set up
the dependency lists.  Nested includes will be supported in a 
future version.

\subsection{Multiple Input Files}

One or more source files can be specified as input to \mmsgen.  
Wildcards and/or lists of source files can be specified.  Stretched logical
names are handled by using the first ocurrance of a file over the stretch.

\subsection{System Dependencies}

System dependencies can be included/excluded in the output MMS files. 
A system dependency is any file or library module that resides in 
the SYS\$LIBRARY directory.  Including system dependencies in the output
MMSes does slow down the execution of the MMS but for completeness you may
want to include these system dependencies.  By default, system dependencies are
included.

\subsection{Text/Macro Library Dependencies}

If a dependency is determined to be a text or macro module the \mmsgen
tool will search a user specified libraries to set up the dependency
so that it points to the module's library.

\subsection{Action Lines}

There is a default set of action lines for each source language that
handled by the tool.  The user can override one or more of these 
default action rules.  The default rule for each source language is given
in a later section.

\subsection{Forced Dependencies}

The user can force certain dependencies that are not prevalent in the
source code yet are important for the execution of the output MMS.

\subsection{Execution of Output MMSes}

You can optionally have \mmsgen execute the output MMS file it creates.
When this feature is used, the tool checks for the existence of 
all dependencies before it executes the MMS.

\section{Invoking the MMSGEN Tool}

Use the following command to invoke the \mmsgen tool:

\bigskip
\begin{verbatim}
   $ SET COMMAND SOGSTOOLS:MMSGEN
   $ MMSGEN     <For-what-sources>
                [<MMS-target-directory>]
                /EXECUTE=[<MMS-execute-string>]
                /TEST_DEPENDENCY
                /LOG
                /CONCAT=<Concat-string>
                /OUTPUT=<Output-directory>
                /MASTER_TARGET=<Master-target-name>
                /TARGET_EXTENSION=<Target-extension>
                /SYSTEM
                /OTHER_DEPENDENCIES=<Dependency-list>
                /SEARCH_LIBRARIES=<Library-list>
                /ACTION=<Action-list>
                /MACRO_LIST=[<Macro-mnemonics-table>]
                /PREFACE=[<Preface-file>]

\end{verbatim}
\bigskip

\subsection{Parameters}

{\bf $<$For-what-sources$>$ \/} is a list of input source file
names. Wildcards are allowed, and there is no limit to the amount
of input files.  Source names must have \mmsgen - supported extensions.
Also, you can specify a file of source file names with one source file 
name per line starting in column one (comment lines have ! in column one).
This file {/bf must \/} have the extension {\bf .SOURCE\_LIST \/}.\\

{\bf $<$MMS-target-directory$>$ \/} is a directory specification
or logical name that is the holding area for the MMS targets (objects).
For example, you may want all of you objects to go into an area
called SPSS\_OBJECT.  The logical name must have a 
colon at the end of it.
In this case you would specify SPSS\_OBJECT: as
this parameter.\\

\subsection{Qualifiers}

The {\bf /EXECUTE \/} qualifier tells \mmsgen to go ahead and execute the
MMS procedure that it creates after it creates it.  You can optionally
pass an MMS exectution string the will be used when MMS is invoked by
\mmsgen.  For example, /EXECUTE="/LOG/FROM\_SOURCES" will be passed onto
MMS when the MMS file gets executed.  All dependencies are verified for 
existence before the MMS gets executed.  It will not be executed if there
are any missing dependencies. Note that when there are multiple MMS
files created /EXECUTE cannot be specified and is ignored.\\

{\bf /TEST\_DEPENDENCY \/} is a qualifier that tells \mmsgen to verify
the existence of all dependencies.  Missing dependencies are reported. \\
Specifying /EXECUTE implies /TEST\_DEPENDENCY.\\

The {\bf /LOG \/} qualifier allows you to control \mmsgen message
logging.  Specifying /NOLOG will suppress all informational messages.\\

{\bf /CONCAT \/} allows you to have a string concatenated onto the
output MMS file name.  By default the output MMS file has the same
name as the source.  Specifying /CONCAT will cause an "\_COMPILE"
to be concatenated to the source file name.  
Likewise, you can specify a different string,
e.g. /CONCAT="\_BUILD".\\

The {\bf /OUTPUT \/} qualifier allows you to route the output MMS files
to a different directory.  You must specify a directory or logical
name when using this qualifier.  The logical name must have a 
colon at the end of it.  You can also specify a specific file name which 
becomes the single output file for that \mmsgen run.  This is useful if
you want to merge many MMSes into one MMS file.

The {\bf /MASTER\_TARGET \/} qualifier when used with /OUTPUT tells
\mmsgen to build a master target so that all targets below get
executed.  You must specify the master target name.  A dummy 
action will be executed for this master target.\\

MMS targets built by \mmsgen are by default .OBJ.  This can
be overridden by using the {\bf /TARGET\_EXTENSION \/} qualifier and
specifying a new target extension.\\

{\bf /SYSTEM \/} qualifier controls the inclusion/exclusion of system
dependencies in the output MMS.  Specifying /NOSYSTEM
will cause any system dependencies to be excluded.  A system dependency
is anything that resides in the SYS\$LIBRARY directory.\\

You can force some dependencies that are not indicated in the source
by listing them via the {\bf /OTHER\_DEPENDENCIES \/} qualifier.  A
list of dependencies can be specified, in double quotes, separated by
commas, and enclosed in parenthesis when there are more than one.
These will be copied verbatim into the MMS output files.  No syntax checking is
performed on these dependencies.\\

When \mmsgen determines that a dependency must reside in a text or macro
library it will go out and search for these modules in a list of libraries that
you have specified.  The {\bf /SEARCH\_LIBRARIES \/} allows you to specify this
list.  The $<$Library-list$>$ is one or more libraries separated by commas, and
enclosed by parenthesis when there are more than one.\\


{\bf /ACTION \/} allows you to override default action line rules for the 
different source types.  You can specify one or more of these overriding 
actions by listing them in double quotes, separated by commas, and
enclosed by parenthesis when there are more than one.  The syntax of the 
$<$Action-list$>$ entry is:

\begin{verbatim}
                   <Source-extension> "-" <New-action-line>
\end{verbatim}

The $<$New-action-line$>$ must contain a \%\% specifying the
source file to be compiled.  For example:

\begin{verbatim}
                   ".FOR-$(FREDFOR) $(FREDFLAGS) %%"
\end{verbatim}

{\bf /MACRO\_LIST \/} allows you to specify the file of VAX MACRO
instructions (built-ins) to be used when \mmsgen parses MACRO files for their
dependencies.  The format of this table is described in a later section.
Specifying /MACRO\_LIST without the file will cause a default file defined
in the MMSGEN.CLD file to be used.\\

{\bf /PREFACE \/} allows you to specify the file of MMS statements to
be included at the top of the output \mmsgen .MMS files.  
Specifying /PREFACE without the file will cause a default file defined
in the MMSGEN.CLD file to be used.\\

\clearpage

\subsection{Examples}

Some sample \mmsgen invocations follow:

{\tt\small
 \begin{verbatim}

   $ MMSGEN fred.for


   $ MMSGEN/EXECUTE fred.for 


   $ MMSGEN/EXECUTE/ACTION=".FOR-$(FORT) $(FORTFLAGS) %%" fred.for 


   $ MMSGEN/EXECUTE fred.for /OTHER_DEPENDENCY=("FRED.CLD", "FRED.LIS")


   $ MMSGEN f*.for,r*.c


   $ MMSGEN SPSS_SOURCE:*.FOR SPSS_OBJECT: /CONCAT="_COMPILE" 
       /OUTPUT=SPSS_MMS_BUILD:


   $ MMSGEN fred.mar /SEARCH_LIB=DIRLIB:MACLIB.MLB


   $ MMSGEN fred.c /TEST_DEPENDENCY /NOSYSTEM 


   $ MMSGEN fred.c, forfred.for /SEARCH_LIB=DIRLIB:INCLIB.TLB


   $ MMSGEN fred.mbl /MACRO_LIST=my_macro_mnemonics.list 
       /SEARCH_LIB=(SOMEDIR:SOME_MACRO1.MLB, SOMEDIR:SOME_MACRO2.MLB)


   $ MMSGEN *.FOR /OUTPUT=COMPILE_ALL.MMS /MASTER_TARGET=ALL.DAT


   $ MMSGEN fred.x /TARGET_EXT=.o


   $ MMSGEN *.c,*.for,*.x,*.scn,*.eqf /PREFACE /EXECUTE /OUTPUT=one.mms


   $ MMSGEN oss_nk.source_list oss_nk_object: 
 \end{verbatim}
}

\clearpage

\section{Language Specifics}

This section details specific notes on each language as it is processed
by the \mmsgen tool.

\subsection{FORTRAN/FBL}

Any FORTRAN include statements is extracted and set up as a dependency.
This includes system include modules or other text library modules.
Some sample FORTRAN include statements follow:

\begin{verbatim}

       INCLUDE '($SSDEF)'
       INCLUDE 'SYS$LIBRARY:FORSYSDEF.TLB($SSDEF)'
       INCLUDE '(ZXPY)'
       INCLUDE 'ZXPY.FOR'
       INCLUDE 'DIRDDL:ZXPY.FOR'

\end{verbatim}

All include statements that appear in FORTRAN comments are ignored.
Also include statements that appear on DEBUG lines (that are 
compiled when you specify FORTRAN/DLINES) are ignored and will not be
included in the depndency list.  Include statements that have continuation 
lines will not be processed.

The default action line for FORTRAN/FBL source files is:

\begin{verbatim}

       $(FORT) $(FFLAGS) %%

\end{verbatim}

\subsection{EQF/EQE}

EQF/EQE include statements are identical to FORTRAN includes.
Any include statement is extracted and 
set up as a dependency. This includes system include modules or other 
text library modules.
Some sample EQF include statements follow:

\begin{verbatim}

       INCLUDE '($SSDEF)'
       INCLUDE 'SYS$LIBRARY:FORSYSDEF.TLB($SSDEF)'
       INCLUDE '(ZXPY)'
       INCLUDE 'ZXPY.EQF'
       INCLUDE 'DIRDDL:ZXPY.EQF'

\end{verbatim}

All include statements that appear in EQF comments are ignored.
Also include statements that appear on DEBUG lines are ignored and will not be
included in the depndency list.  Include statements that have continuation 
lines will not be processed.

The default action line for EQF/EQE source files is:

\begin{verbatim}

       $(EQF) %% $(DATABASE) $(FFLAGS)

\end{verbatim}

\subsection{C}

C include statements have different meanings depending upon
the syntax used.  They may contain angle brackets, double quotes, or nothing
around the include file name.  Each of these syntacies is interpreted differently
by the C compiler and also by the \mmsgen tool.
All include statements are recognized and set up as a dependency.
Some sample C include statements follow:

\begin{verbatim}

#include   ssdef
#include   <ssdef>
#include   "sys$library:ssdef.h"
#include   "dirinc:zxpy.h"

\end{verbatim}

All include statements that appear in C comments are ignored.
Use of conditional compilation statements are ignored, that is an include
statement that appears within a conditional compilation segment will
ALWAYS be picked up by the \mmsgen tool.  Include statements that contain 
interspersed comments will not be recognized.

The default action line for C source files is:

\begin{verbatim}

       $(CC) $(CFLAGS) %%

\end{verbatim}

\subsection{SCAN}

SCAN include statements have a simple format and any 
all include statements are recognized and set up as a dependency.
Some sample SCAN include statements follow:

\begin{verbatim}

         INCLUDE FILE 'any_file.scn';
         INCLUDE FILE 'dirinc:any_file.scn';

\end{verbatim}

All include statements that appear in SCAN comments are ignored.

The default action line for SCAN source files is:

\begin{verbatim}

       SCAN/OBJECT=$(MMS$TARGET) $(SCANFLAGS) %%

\end{verbatim}

\subsection{MACRO/MBL}

MACRO files are the most difficult to parse for dependencies namely because
there is no clear define include statement in MACRO.  Any macro
that is not a built-in macro should be set up as a dependency from a macro 
library.  

The default action line for MACRO/MBL source files is:

\begin{verbatim}

       $(MACRO) $(MFLAGS) %%

\end{verbatim}

\subsubsection{Built-In Macros}

In  order to have \mmsgen create VAX MACRO MMS files, you must provide a
list of the built-in macros to be ignored.  A list is provided that is 
not totally complete.  Missing built-ins can be added as they are encountered.
This file has one built-in macro per line starting in column 1.

This file can be specified by using the /MACRO\_LIST qualifier or by defining 
the logical name MMSGEN\$MACRO\_MNEMONICS to point to the file.

\subsubsection{Macro Libraries}

You will also need to specify what macro libraries are to be searched for
non built-in macros.  The \mmsgen tool will go out and search all of the 
listed macro libraries and set up the dependency for that user-written 
macro based on the first encounter of the macro in any library.

\subsection{MESSAGE}

VAX Message Utility files do not have include statements and MMSes are 
therefore easy to generate for these.  The message object target is dependent 
upon the message source - and that's it!.

The default action line for MESSAGE source files is:

\begin{verbatim}

       MESSAGE/OBJECT=$(MMS$TARGET) %%

\end{verbatim}

\subsection{}

SPP (a RATFOR-like language used in IRAF) include statements are 
similar to C includes,
only a little more restrictive in that there are no text libraries
that are associated with them.  All SPP include statements are recognized by
\mmsgen and set up as a dependency.  SPP files have a .X extension.

Some sample SPP include statements follow:

\begin{verbatim}

include <xwhen.h>
include <fset.h>
include <ctype.h>
include "iraflib:irafdefs.h"

\end{verbatim}

All include statements that appear in SPP comments are ignored.

The default action line for SPP source files is:

\begin{verbatim}

       $(XC) $(XFLAGS) %% -o $(MMS$TARGET)

\end{verbatim}

\section{Notes On Text/Macro Library Dependencies}

When the \mmsgen tool sets up dependencies on user-specified libraries
the dependencies will look like:

\begin{verbatim}
             <Library-spec> '(' <Library-module> ')'
\end{verbatim}

MMS has default rules on how it handles these dependencies according
to the type of library being specified.  You may need to turn off 
these default rules (.SUFFIXES) before you execute the MMS if the default rules
that MMS uses are incorrect.  For example, MMS defaults say that text
libraries have .TXT modules.  It was for this reason that the 
/PREFACE feature was added.

\section{Default Action Lines Table}

\begin{verbatim}
  Language/FileType           Default Action Line
  -----------------           ---------------------------------------
       .C                     $(CC) $(CFLAGS) %%
       .EQF                   $(EQF) %% $(DATABASE) $(FFLAGS)
       .EQE                   $(EQF) %% $(DATABASE) $(FFLAGS)
       .FOR                   $(FORT) $(FFLAGS) %%
       .FBL                   $(FORT) $(FFLAGS) %%
       .MAR                   $(MACRO) $(MFLAGS) %%
       .MBL                   $(MACRO) $(MFLAGS) %%
       .MSG                   MESSAGE/OBJECT=$(MMS$TARGET) %%
       .SCN                   SCAN/OBJECT=$(MMS$TARGET) $(SCANFLAGS) %%
       .X                     $(XC) $(XFLAGS) %% -o $(MMS$TARGET)

\end{verbatim}

\clearpage

\section{Some Sample Output MMS Files}

{\tt\small
 \begin{verbatim}
  $!                    Sample 1
  $!   This MMS was generated by MMSGEN on all of its source files.
  $!
  $ MMSGEN *.SCN; /OUTPUT=ALL.MMS /MASTER_TARGET=ALL.ALL
  $!
  $ TYPE ALL.MMS

ALL.ALL : -
      FILE_UTILS.OBJ -
      MMSGEN.OBJ -
      MMSGEN_FIND_C_DEPENDENCIES.OBJ -
      MMSGEN_FIND_FORTRAN_DEPENDENCIES.OBJ -
      MMSGEN_FIND_MACRO_DEPENDENCIES.OBJ -
      MMSGEN_FIND_MODULE_IN_LIBRARY.OBJ -
      MMSGEN_FIND_SCAN_DEPENDENCIES.OBJ -
      MMSGEN_FIND_X_DEPENDENCIES.OBJ -
      MMSGEN_STRIP_MACRO_COMMENTS.OBJ
  ! $(MMS$TARGET) Updated 
  
FILE_UTILS.OBJ : FILE_UTILS.SCN
        SCAN/OBJECT=$(MMS$TARGET) $(SCANFLAGS) FILE_UTILS.SCN

MMSGEN.OBJ : MMSGEN.SCN
        SCAN/OBJECT=$(MMS$TARGET) $(SCANFLAGS) MMSGEN.SCN

MMSGEN_FIND_C_DEPENDENCIES.OBJ : MMSGEN_FIND_C_DEPENDENCIES.SCN
        SCAN/OBJECT=$(MMS$TARGET) $(SCANFLAGS) MMSGEN_FIND_C_DEPENDENCIES.SCN

MMSGEN_FIND_FORTRAN_DEPENDENCIES.OBJ : MMSGEN_FIND_FORTRAN_DEPENDENCIES.SCN
        SCAN/OBJECT=$(MMS$TARGET) $(SCANFLAGS) MMSGEN_FIND_FORTRAN_DEPENDENCIES.SCN

MMSGEN_FIND_MACRO_DEPENDENCIES.OBJ : MMSGEN_FIND_MACRO_DEPENDENCIES.SCN
        SCAN/OBJECT=$(MMS$TARGET) $(SCANFLAGS) MMSGEN_FIND_MACRO_DEPENDENCIES.SCN

MMSGEN_FIND_MODULE_IN_LIBRARY.OBJ : MMSGEN_FIND_MODULE_IN_LIBRARY.SCN
        SCAN/OBJECT=$(MMS$TARGET) $(SCANFLAGS) MMSGEN_FIND_MODULE_IN_LIBRARY.SCN

MMSGEN_FIND_SCAN_DEPENDENCIES.OBJ : MMSGEN_FIND_SCAN_DEPENDENCIES.SCN
        SCAN/OBJECT=$(MMS$TARGET) $(SCANFLAGS) MMSGEN_FIND_SCAN_DEPENDENCIES.SCN

MMSGEN_FIND_X_DEPENDENCIES.OBJ : MMSGEN_FIND_X_DEPENDENCIES.SCN
        SCAN/OBJECT=$(MMS$TARGET) $(SCANFLAGS) MMSGEN_FIND_X_DEPENDENCIES.SCN

MMSGEN_STRIP_MACRO_COMMENTS.OBJ : MMSGEN_STRIP_MACRO_COMMENTS.SCN
        SCAN/OBJECT=$(MMS$TARGET) $(SCANFLAGS) MMSGEN_STRIP_MACRO_COMMENTS.SCN
\end{verbatim}
}

\clearpage

{\tt\small
 \begin{verbatim}
  $!                    Sample 2
  $ DEFINE MMSGEN$MACRO_MNEMONICS SOGSTOOLS:MMSGEN_MACRO_MNEMONICS.LIST
  $!
  $ MMSGEN SS_SOURCE:GPDULG.MAR /SEARCH=DIRLIB:MACLIB.MLB
  $!
  $ TYPE GPDULG.MMS

SS_OBJECT:GPDULG.OBJ : SS_SOURCE:GPDULG.MAR -
                DIRLIB:MACLIB.MLB(ZADLREC) -
                DIRLIB:MACLIB.MLB(ZADGNK) -
                SYS$LIBRARY:STARLET.MLB($JPIDEF) -
                DIRLIB:MACLIB.MLB(A_ENTRY) -
                SYS$LIBRARY:STARLET.MLB($GETTIM_S) -
                SYS$LIBRARY:STARLET.MLB($EXIT_S) -
                SYS$LIBRARY:STARLET.MLB($GETJPI_S) -
                DIRLIB:MACLIB.MLB(A_CALL) -
                SYS$LIBRARY:STARLET.MLB($RAB_STORE) -
                SYS$LIBRARY:STARLET.MLB($PUT) -
                DIRLIB:MACLIB.MLB(A_EXIT)
        $(MACRO) $(MFLAGS) SS_SOURCE:GPDULG.MAR + DIRLIB:MACLIB.MLB/LIBRARY


  $!                    Sample 3
  $ DEFINE MMSGEN$MACRO_MNEMONICS SOGSTOOLS:MMSGEN_MACRO_MNEMONICS.LIST
  $!
  $ MMSGEN SS_SOURCE:GPDULG.MAR /SEARCH=DIRLIB:MACLIB.MLB /NOSYSTEM
  $!
  $ TYPE GPDULG.MMS

SS_OBJECT:GPDULG.OBJ : SS_SOURCE:GPDULG.MAR -
                DIRLIB:MACLIB.MLB(ZADLREC) -
                DIRLIB:MACLIB.MLB(ZADGNK) -
                DIRLIB:MACLIB.MLB(A_ENTRY) -
                DIRLIB:MACLIB.MLB(A_CALL) -
                DIRLIB:MACLIB.MLB(A_EXIT)
        $(MACRO) $(MFLAGS) SS_SOURCE:GPDULG.MAR + DIRLIB:MACLIB.MLB/LIBRARY

\end{verbatim}
}

\clearpage

{\tt\small
 \begin{verbatim}
  $!                    Sample 4
  $ MMSGEN SH_SOURCE:GAINIT.FOR SH_NK_OBJECT: -
       /NOSYSTEM /SEARCH_LIB=DIRLIB:INCLIB.TLB
  $!
  $ TYPE GAINIT.MMS

SH_NK_OBJECT:GAINIT.OBJ : SH_SOURCE:GAINIT.FOR -
                DIRLIB:INCLIB.TLB(ZGAON) -
                DIRLIB:INCLIB.TLB(ZGPIDB) -
                DIRLIB:INCLIB.TLB(ZGPB) -
                DIRLIB:INCLIB.TLB(ZGFLAGS)
        $(FORT) $(FFLAGS) SH_SOURCE:GAINIT.FOR + DIRLIB:INCLIB.TLB/LIBRARY



  $!                    Sample 5
  $ MMSGEN SPSS_SOURCE:BLDLICAL.FOR SPSS_OBJECT: /CONCAT="_COMPILE"
  $!
  $ TYPE BLDLICAL_COMPILE.MMS

SPSS_OBJECT:BLDLICAL.OBJ : SPSS_SOURCE:BLDLICAL.FOR -
                DIRDDL:ZLICHDR.FOR -
                DIRDDL:ZLICCON.FOR -
                DIRDDL:ZLICSUO.FOR -
                DIRDDL:ZLICALO.FOR -
                DIRDDL:ZLICOSO.FOR -
                DIRDDL:ZLICSU.FOR -
                DIRDDL:ZLICPAR.FOR -
                DIRDDL:ZLICLNK.FOR -
                DIRDDL:ZLICPTH.FOR -
                DIRDDL:ZLICPTR.FOR -
                DIRDDL:ZLICDEC.FOR -
                DIRDDL:ZLICOS.FOR -
                DIRDDL:ZLICWIN.FOR -
                DIRDDL:ZLICAL.FOR
        $(FORT) $(FFLAGS) SPSS_SOURCE:BLDLICAL.FOR

\end{verbatim}
}

\clearpage

\section{MMSGEN Messages}

This section lists \mmsgen error/informational messages that may appear
during its use.

\begin{enumerate}

\item{\bf \%MMSGEN-I-SAME\_INCLUDE, Include file $<$Some-file$>$ is listed more than once \/}

The source file being processed contains the same include file declaration. 
This may or may not be acceptable.  Check the source file and you decide.\\

\item{\bf \%MMSGEN-I-OUT\_MMS\_IS, Creating output MMS file:  $<$Output-file$>$ \/}

Lists the name of the output MMS file being created.\\

\item{\bf\%MMSGEN-I-MISSING\_DEPENDENCY, Can't find dependency:  $<$Some-file$>$ \/}

\mmsgen was testing for the existence of a dependency and could not filnd it.
This may be a problem or may not be, however, if you are trying to
execute this MMS it will fail.\\

\item{\bf \%MMSGEN-I-WONT\_EXECUTE, Will not execute output MMS as instructed \/}

MMS will not be executed due to missing dependency.\\

\item{\bf \%MMSGEN-E-LIBNOTFND, Search library $<$Library-name$>$ not found \/}

One of the libaries specified on the /SEARCH\_LIBRARY qualifiers
is missing.  Check for it or typos.\\

\item{\bf \%MMSGEN-E-BADACTSYN, Illegal action syntax: \/}

An illegal /ACTION syntax was specified.  Read earlier section on
qualifiers to see format of these strings.\\

\item{\bf \%MMSGEN-E-MISSINGMACRO, MACRO mnemonics file not found \/}

\mmsgen cannot find the MACRO built-in mnemonics file.  This can be 
corrected by defining MMSGEN\$MACRO\_MNEMONICS or by specifying /MACRO
with the correct file.  You only need this when you are
\mmsgen ing MACRO source.\\

\item{\bf \%MMSGEN-E-MISSINGPREFACE, MMS PREFACE file $<$Preface-file$>$ not found \/}

\mmsgen cannot find the preface file specified.\\

\item{\bf \%MMSGEN-E-UNKNOWN\_LANG, Can't make a compile MMS for $<$Some-source$>$ \/}

Unsupported source file specified.

\item{\bf \%MMSGEN-I-PROBMMS, Problems creating complete MMS description for source file: $<$Some-source$>$ \/}

Unresolvable dependencies are left out of the output MMS file.  This MMS
may not be complete because of this. \

\item{\bf \%MMSGEN-E-CANFINDLIB, Include module $<$Module-name$>$ must map to a library \/}

A dependency that should exist in a text or MACRO library can't
be found in any of the user-specified libraries.

\end{enumerate}

\clearpage

\section{SOGS Notes}

	The \mmsgen tool was desingned so that it is not SOGS-dependent.
This means that some thought will need to be given when using this tool
to generate your SOGS compile MMSes.  

\begin{enumerate}

	\item{Output MMS File Names}

	The convention for SOGS compile MMS names is to concatenate
	"\_COMPILE" to the source module name.  \mmsgen facilitates
	this via the /CONCAT qualifier.  By specifying /CONCAT
	or /CONCAT="\_COMPILE", the tool will properly SOGSify
	the output file name. \\

	\item {Target Object Area}

	The compilation of a SOGS object typically takes a 
	module from a source area and places it in a
	target object area.  This target object area
	{\bf must be specified \/} on the command line
	or else the target are will be the default directory.
	This means that you must know where the target
	directory is for your modules.  This can be somewhat
	complicated in SOGS when you are dealing with subsystems
	that have kernel and non-kernel objects.\\

	\item{MACRO Libraries}

	When \mmsgen - ing MACRO files you will want to specify
	what .MLB libraries are to be searched.  This can be done 
	with the /SEARCH\_LIBRARY qualifier.  There are two
	SOGS macro libraries - one for kernel and non-kernel.
	You will need to be explicit about which one is to be searched.
	This again deals with knwoing what you are building as in previous
	item. \\

	\item{FORTRAN Libraries}

	When \mmsgen - ing SOGS FORTRAN files you will want to specify
	any FORTRAN include libries to be searched.  This again can be done with
	the /SEARCH\_LIBRARY qualifier.  The only SOGS FORTRAN include library
	is DIRLIB:INCLB.TLB.  There may be a SYS\$LIBRARY FORTRAN include module
	that may need to be specified.\\

	\item{SOGS Macro Mnemonics File}

	The SOGS MACRO mnemonics file will be in SOGSTOOLS and is
	called MMSGEN\_MACRO\_MNEMONICS.LIST.  This should be pointed
	to by the logical name MMSGEN\$MACRO\_MNEMONICS before running \mmsgen
	on SOGS MACRO code.\\

	\item{Output MMS Area}

	The /OUTPUT qualifier will typically point to one of the
	MMS build directories for a particular subsystem.  For example,
	PODPS MMSGEN statements would have a qualifier of 
	/OUTPUT=PODPS\_MMS\_BUILD:.  The logical name must have a 
	colon at the end of it.\\

\end{enumerate}

\section{About The Software}

There are 11 files that are associated with this tool:
\bigskip

\begin{enumerate}
\item {\it MMSGEN.MMS \/}
This is the MMS file that maintains the {\it MMSGEN.EXE \/} executable
for the \mmsgen tool.

\item {\it MMSGEN.CLD\/} 

This is the Command Language Definition file that describes the syntax
of the \mmsgen command.  It must be executed via the {\bf \$ set command \/}
prior to running the tool.

\item {\it MMSGEN.SCN \/} 

This is tha main program for the tool.  

\item {\it MMSGEN\_FIND\_FORTRAN\_DEPENDENCIES.SCN \/} 

Scans for VAX FORTRAN include files.

\item {\it MMSGEN\_FIND\_C\_DEPENDENCIES.SCN \/} 

Scans for VAX C include files.

\item {\it MMSGEN\_FIND\_SCAN\_DEPENDENCIES.SCN \/} 

Scans for VAX SCAN include files.

\item {\it MMSGEN\_FIND\_X\_DEPENDENCIES.SCN \/} 

Scans for X include files.

\item {\it MMSGEN\_FIND\_MACRO\_DEPENDENCIES.SCN \/} 

Scans for non built-in MACROs.  

\item {\it MMSGEN\_FIND\_MODULE\_IN\_LIBRARY.SCN \/} 

Searched a specified library for an entry.

\item {\it MMSGEN\_STRIP\_MACRO\_COMMENTS \/}

Strips out comments from a MACRO source line.

\item {\it FILE\_UTILS.SCN \/}

Contains a collection of SCAN file utilities that check for file existence,
file name parsing, etc.

\end{enumerate}

\section{Maintainence Notes}

Some items to be aware of when maintaining this tool are listed next:

\begin{enumerate}

\item{Adding New Languages}

	Supporting new languages requires the modification of the main
	program in MMSGEN.SCN to recognize the appropriate extension,
	and to call the appropriate dependency parser for that source language.
	The parser need not be written in SCAN.

\item{Dependency Trees}

	SCAN trees are used to build up the dependency lists for each source.
	These trees will have to be populated by any new parsers for the rest
	of the tool to work.  This is done by calling routine called 	
	ADD\_TO\_DEPENDENCY\_TREE.  This may be called from any VAX language.

\item{Macro Built-In Instruction List}

	This list was compiled by copying all the names listed in 
	the VAX MACRO manual but we have found that the list is still
	incomplete.  You may need to edit and add onto the provided 
	MMSGEN\_MACRO\_MNEMONICS.LIST file.

\item{Changing Defaults}

	You may change defaults on certain qualifiers by editing 
	MMSGEN.CLD file.

\end{enumerate}

\end{document}

