
imkmf(1)                     Khoros                      imkmf(1)

PROGRAM
     imkmf - An Imakefile maker/updater

SYNTAX
     imkmf

     [-name]        name of object

     [-toolbox]     Toolbox name

     [-o]           Imakefile to be output

     [-type]        Imakefile type:
                     'lib' (library),
                     'dir' (directory),
                     'script' (script),
                     'prog' (vroutine),
                     'fprog' (vroutine w/ FORTRAN dependancies),
                     'xprog' (xvroutine),
                      or 'fxprog' (xvroutine w/ FORTRAN dependan-
                    cies)
                       [default = lib]

     [-V]           Gives the version for imkmf

     [-U]           Gives the usage for imkmf

     [-P]           Prompts for command line options

     [-A [file1]]   Creates the answer file called imkmf.ans or
                    file1

     [-a [file1]]   Uses imkmf.ans or file1 as the answer file

DESCRIPTION
     This program creates an Imakefile, assuming one does not
     already exist, or updates an already existing one to contain
     information sufficient to make the files contained in the
     directory.  If an Imakefile does not exist, imkmf copies a
     template, specified on the command  line with `-type', into
     the current directory and then proceeds to update it. If the
     '-toolbox' option is specified with the name of a valid
     toolbox, the resulting Imakefile will contain the project
     include file for that toolbox. If the '-toolbox' option is
     not specified, the Imakefile default project include file
     "Toolbox.def".  Updating is accomplished by looking at the
     names of all the files in the current directory and updating
     any existing "definition" that imkmf knows about.

     imkmf uses the following templates that can be found in
     $KHOROS_HOME/repos/config/imake_tmpls/:  Imakefile.l Library
     template file

     Imakefile.p
          Program template file

     Imakefile.x
          X11 Program template file

     Imakefile.d
          Directory template file

     Imakefile.s
          Script template file

     Imakefile.pf
          Program w/ FORTRAN dependancies template file

     Imakefile.x
          X11 Program w/ FORTRAN dependancies template file

     Since additional explanation of some of the arguments may be
     helpful, these are as follows:

     type:
          If the Imakefile does not exist, this option is
          required and specifies which of the templates to use
          (see FILES below).  There are five (5) known types:

          1) lib
          This option uses the library template which will create
          an Imakefile which will make, and optionally install, a
          library of the name specified with the -name option.

          2) dir
          This option uses the directory template which will
          create an Imakefile that knows about subdirectories and
          will `cd' into them one at a time to continue the make.

          3) script
          This option uses the script template which will create
          an Imakefile that knows about shell scripts and how to
          install them correctly.

          4) prog
          This option uses the program template which will create
          an Imakefile which will make, and optionally install, a
          general, non-X11 program of the name specified with the
          -name option.

          5) xprog
          This option uses the X11 program template which will
          create an Imakefile which will make,and optionally
          install, a program of the name specified with the -name
          option that uses the X11 libraries.

          6) fprog
          This option uses the program template which will create
          an Imakefile which will make, and optionally install, a
          general, non-X11 program that depends on FORTRAN of the
          name specified with the -name option.

          7) fxprog
          This option uses the X11 program template which will
          create an Imakefile which will make,and optionally
          install, a program of the name specified with the -name
          option that uses the X11 libraries and depends on FOR-
          TRAN.

     toolbox:
          This option is only used when an Imakefile does not
          exist. The toolbox option specifies the toolbox that
          the routine is associated with. Valid toolboxes can be
          listed using "kraftsman". The resulting Imakefile will
          contain a "#include" for the toolbox project file. The
          toolbox project file must be located in
          $TOOLBOX_NAME/repos/config/imake_conf and called
          $TOOLBOX_NAME.def. If the toolbox option is not speci-
          fied then the resulting Imakefile will contain
          "#include <Toolbox.def>" which is the default. This
          file is located in KHOROS_HOME/repos/config/imake_conf
          and is intended only for those who are working directly
          in Khoros source.

     name:
          This option is only used when an Imakefile does not
          exist and the type, specified with the -type option, is
          one of: lib, prog or xprog.  If the type is `lib', then
          this option specifies the name of the library which
          gets created (see examples).  If the type is `prog' or
          `xprog', then this option specifies the name of the
          program that gets created.

     output file:
          This option allow the user to specify an alternate out-
          put file to use other than the default file of
          `Imakefile'.

     KNOWN FIELDS:

     TOOLBOX        This field contains the name of the toolbox
                    so that the Imakefile can be regentered
                    automatically.

     SUBDIRS        This field is used in the "directory" tem-
                    plate and specifies all subdirectories found
                    in the current directory.

     SRCS           This field is used in the "library", "pro-
                    gram", and "X program" templates to specify
                    sources, not including FORTRAN sources (see
                    below), which exist in the current directory.
                    Sources currently consist of files with the
                    following suffixes: '.c', '.y' and '.l'.

     OBJS           This field is used in the "library", "pro-
                    gram", and "X program" templates to specify
                    resulting objects, not including FORTRAN
                    objects (see below).  Entries in this field
                    are created by changing the suffix on the
                    files specified in SRCS to a '.o'.

     FSRCS          This field is used in the "library" template
                    to specify FORTRAN sources which exist in the
                    current directory.  FORTRAN source is con-
                    sidered separately because the other sources,
                    which all produce C code, can be created for
                    use in shared libraries whereas FORTRAN
                    source can not (this is true depending on the
                    machine and version of f77 you have).

     FOBJS          This field is used in the "library" template
                    to specify FORTRAN objects only.  Entries in
                    this field are created by changing the suffix
                    on the files specified in FSRCS to a '.o'.

     HEADERS        This field is used in the "library", "pro-
                    gram", and "X program" templates to specify
                    include files, files with a '.h' suffix,
                    which exist in the current directory.

     SCRIPTS        This field is used in the "scripts" template
                    to specify script files, files with a '.csh'
                    suffix, which exist in the current directory.

     LIBRARY_NAME   This field is used in the "library" template
                    to specify the name of the resultant library.
                    This field gets defined with the name speci-
                    fied with the "-name" argument.

     PROGRAM_NAME   This field is used in the "program" and "X
                    program" templates to specify the name of the
                    resultant programs.  This field gets defined
                    with the name specified with the "-name"
                    argument.

     SCRIPT_NAME    This field is used in the "library" template
                    to specify the name of the directory in which
                    shell scripts sit.
                     This field gets defined with the name speci-
                    fied with the "-name" argument.

REQUIRED ARGUMENTS
     none

OPTIONAL ARGUMENTS
     -name  type: string
            desc: name of object
            default: null

     -toolbox
            type: string
            desc: Toolbox name
            default: null

     -o     type: outfile
            desc: Imakefile to be output

     -type  type: string
            desc: Imakefile type
            allowed values:
             'lib' (library),
             'dir' (directory),
             'script' (script),
             'prog' (vroutine),
             'fprog' (vroutine w/ FORTRAN dependancies),
             'xprog' (xvroutine),
              or 'fxprog' (xvroutine w/ FORTRAN dependancies)

EXAMPLES
     In these examples it is assumed that an Imakefile does not
     already exist.

     % imkmf -type prog -name trial -toolbox dsp_toolbox

     will create an Imakefile for the toolbox "dsp_toolbox"  from
     the "program" template and will update the new Imakefile
     such that when make is called, the executable will be put
     into file `trial'.

     % imkmf -type xprog -name test

     will create an Imakefile from the "X program" template and
     will update the new Imakefile such that when make is called,
     the executable will be put into file `test'.  The only
     difference between type "prog" and type "xprog" is that the
     "xprog" template contains X library references, and includes
     dependancies on Khoros libraries such as xvforms, xvutils,
     xvdisplay, and xvgraphics.

     % imkmf -type lib -name new

     will create an Imakefile from the "library" template and
     will update the new Imakefile such that when make is called,
     the resulting library will be put into file `libnew.a'.

     % imkmf -type dir -toolbox medic_toolbox

     will create an Imakefile for the toolbox "medic_toolbox"
     from the "directory" template.

     % imkmf -type script

     will create an Imakefile from the "script" template.

     If an Imakefile already exists, then imkmf just updates the
     Imakefile as described above.

SEE ALSO
     intro(1), verror(3), vgparms(3), vutils(3)

RESTRICTIONS
COPYRIGHT
     Copyright 1991, University of New Mexico.  All rights
     reserved.

Khoros                    Release: 1.0                          1

