###########################################################################
#+
#  Name:
#     makefile
#
#  Version:
#     Library makefile Mk V
#
#  Purpose:
#     Build and install the SUBPAR package.
#
#  Type of Module:
#     Description file for the make utility.
#
#  Description:
#     This description file is used by the make utility to build the
#     SUBPAR package from the distributed source files, to install
#     the resulting system for use, and to perform other housekeeping
#     tasks.
#
#  Invocation:
#     This makefile is not intended to be used by make when invoked
#     directly (although this is possible), but instead to be used via
#     the accompanying mk script.  This script sets up a number of
#     environment variables which are used as macros within the
#     makefile and which accommodate differences between machines and
#     operating systems (it invokes make with the -e option).  Please
#     consult the mk script prologue for full details.
#
#  Targets:
#     The following make targets are defined in this script for
#     external use:
#
#        [help]
#           This is the default target.  It outputs a message describing
#           the mk script and lists the targets provided.
#
#        check
#           Performs a simple check that all necessary source files are
#           present, and displays the version number and current state
#           of the package (built/installed/tested, etc.).
#
#        build
#           Compiles the source files and creates all files needed
#           prior to installing the package for use.
#
#        install
#           Installs the package for use by putting the necessary files
#           into sub-directories of the $INSTALL directory (the $HOME
#           directory is used if the environment variable INSTALL is
#           not defined).  Links to the installed files are left in the
#           source directory.
#
#        deinstall
#           Reverses the action of the install target, removing files
#           from sub-directories of the $INSTALL directory and
#           restoring them to the source directory (the $HOME directory
#           is used by default if the environment variable INSTALL is
#           not defined).
#
#        test
#           Builds and runs a simple test program to check for correct
#           installation of the package.
#
#        export
#           Produces an export copy of the built package suitable for
#           passing to another user.  A compressed tar file is created
#           in the $EXPORT directory containing copies of the source
#           files and built files for the package (the current
#           directory is used by default if the environment variable
#           EXPORT is not defined).  The package should normally be
#           built, installed and tested (see above) before using this
#           target.  After unpacking the exported file on a similar
#           machine, the recipient may simply install it for use.
#
#        export_run
#           Produces an export copy of the built package suitable for
#           passing to another user.  A compressed tar file is created
#           in the $EXPORT directory containing copies of the built 
#           files for the package (the current directory is used by 
#           default if the environment variable EXPORT is not defined).
#           The package should normally be built, installed and tested 
#           (see above) before using this target.  After unpacking the
#           exported file on a similar machine, the recipient may simply
#           install it for use.
#
#        export_source
#           Produces an export copy of the source for the package
#           suitable for passing to another user to build (possibly on
#           a different type of machine).  A compressed tar file is
#           created in the $EXPORT directory containing copies of just
#           the source files for the package (the current directory is
#           used by default if the environment variable EXPORT is not
#           defined).  After unpacking the exported file, the recipient
#           must build the package before installing it for use.
#
#        clean
#           Cleans up after building the package, removing all
#           intermediate files created during the building process, but
#           leaving the built files themselves.
#
#        unbuild
#           Reverses the building process, removing all intermediate
#           files along with all the built files.
#
#        archive
#           Create the pkg_source tar file
#
#  External Dependencies:
#     The SUBPAR package depends on the following other Starlink packages
#     which must previously have been installed into the appropriate
#     sub-directories of the $STARLINK directory (/star is used if the
#     environment variable STARLINK is not defined).
#        sae_par*
#           Global include files
#        chr*
#           Character handling routines
#        ems (err)*
#           Error message service
#        hds*
#           Hierarchical data system
#        hlp
#           Portable help sytem
#        psx
#           Posix routines
#        cnf
#           C and Fortran mixed programming
#
#     The SUBPAR package depends on the following other PCS packages
#        adam*
#           ADAM message layer
#        lex*
#           lexical analysis
#        messys*
#           Message system
#        parsecon
#           Interface file parsing
#        string
#           String handling
#
#     * Indicates that the package is required for building as well as 
#       running DTASK. At build time, it is assumed that they have already 
#       been built in the hierarchy beneath the PCS source root directory,
#       $PCSSRC_DIR (which defaults to .. ).
#       The other packages listed will not normally be required until run time.
#
#  Notes:
#     This makefile uses the presence/absence of the hidden files
#     .BUILT, .INSTALLED_$(SYSTEM) and .TESTED_$(SYSTEM) to record the
#     current state of the system during housekeeping operations.
#
#  Implementation Deficiencies:
#     The method of generating the list of external libraries passed to
#     the $(BLD_SHR) command is still preliminary.
#
#  Copyright:
#     Copyright (C) 1995 Rutherford Appleton Laboratory
#
#  Authors:
#     RFWS: R.F.Warren-Smith (Starlink, RAL)
#     PMA: P.M.Allan (Starlink, RAL)
#     PTW: P.T.Wallace (Starlink, RAL)
#     BLY: M.J.Bly (Starlink, RAL)
#     AJC: A.J.Chipperfield (Starlink, RAL)
#     {enter_new_authors_here}
#
#  History:
#     4-JAN-1993 (RFWS):
#        Original version.
#     15-MAR-1993 (RFWS):
#        Adapted for use on sun4_Solaris.
#     11-JUN-1993 (PMA):
#        Added parts for handling platform specific files.
#     27-SEP-1993 (PMA):
#        Added the target "filler1" to prevent the list of platform
#        specific files being empty, thereby causing a make syntax error.
#     3-NOV-1993 (PMA):
#        Change the check target to print out for which system the
#        software has been built.
#     3-NOV-1993 (PMA):
#        Add a test to check that files really are extracted from the
#        tar file.
#     18-NOV-1993 (PTW):
#        Cosmetics.
#     26-NOV-1993 (PMA):
#        Remove the dummy file "filler1" and add a dummy target called
#        dummy_target1.
#        Add a file called " " to all of the for loops that install and
#        deinstall files to prevent syntax errors if any of the relevent
#        macros are null.
#        Add a macro STARTUP_SCRIPT that is the name of the startup
#        script.
#     4-JAN-1994 (PMA):
#        Add some missing semicolons to for loops. This seems not to
#        cause errors on our systems, but it is a syntax error.
#     7-FEB-1994 (PMA):
#        Move the block data files to the beginning of the definition of
#        OBJECT_FILES. This makes it possible to extract the block data
#        modules with the -u loader flag. This is needed when using f2c.
#     8-AUG-1994 (BLY):
#        Add dependency on source archive to extraction targets.
#     30-NOV-1994 (AJC):
#        Add facility error files
#        Add export_run target
#        Add where installed
#        Prevent installation if not built for this SYSTEM
#        Ensure deinstall is from where it is installed
#        Revise use of package name variables, adding PACK_NAME for
#         use in messages and PKG_LINK for use in INCLUDE FILE links.
#         Use variables in all references.
#        Use installed $(PKG_NAME)_dev to handle INCLUDE files for test
#     24-APR-1995 (AJC):
#        -p on install mkdir
#        Add else clause to catch failue of "elif $(MAKE)"
#        Add exit 1 to detected illegal install and deinstall cases.
#        Remove dependency of files on source archive.
#     2-MAY-1995 (BLY):
#        Shared libraries now in INSTALL_SHARE, also chmod 755.
#        INSTALL_SHARE added to INSTALL_DIRS.
#        RANLIB default changed to : (colon).
#        BLD_SHR default changed to : (colon).
#     5-JUN-1995 (RFWS):
#        Added -f flag to rm commands in clean and unbuild targets.
#     15-JUN-1995 (AJC):
#        Revised check target to cope with export_run versions.
#     16-JUN-1995 (BLY):
#        Designated Mk IVb.
#     26-JUN-1995 (BLY):
#        Modified export, export_run and export_source targets.
#        Cosmetics.
#        Designated Mk IVc.
#     29-JUN-1995 (BLY):
#        Added sections for manipulating Latex and Hypertest documentation.
#        Revised install and deinstall sequences.
#        Changed export* targets to make compressed tar files in one step.
#        Replacing of `rm' with `rm -f' in most cases.
#        Designated Mk V.
#     03-JUL-1995 (BLY):
#        Template makefile now generated automatically.
#     17-JUL-1995 (AJC):
#        Modified hypertext installation/deinstallation to avoid linking
#        if no hypertext documents defined.
#     11-SEP-1995 (AJC):
#        Modified for ADAMSYS internals
#        Move INSTALL_ definitions as they are used in the build
#        Nil docs
#        only link_adam script
#        only _adam libraries
#        Modify test: to inform there is no test.
#     13-SEP-1995 (AJC):
#        Modified for SUBPAR
#      5-FEB-1996 (AJC):
#        sup_write no longer uses EMS_PAR
#        version V1.5
#     29-NOV-1996 (AJC):
#        Add SUBPAR_ENQUOTE
#        LIB_VERS 2.4
#     30-OCT-1997 (AJC)
#        PKG_VERS 1.6
#        LIB_VERS 2.5
#        Add SUBPAR_UNQUOTE
#     22-MAY-1998 (AJC)
#        PKG_VERS 1.6-1
#     16-DEC-1998 (AJC)
#        Add archive target
#        Add SUBPAR_STORE0
#        Add subpar_err.h (not used)
#        PKG_VERS 1.7
#        LIB_VERS 2.6
#     14-APR-1999 (AJC):
#        Refer to PCS not ADAMSYS
#        Use PCS include files beneath $PCSSRC_DIR
#      7-FEB-2000 (AJC):
#        Add SUBPAR_PARGP
#        PKG_VERS 1.8
#        LIB_VERS 2.7
#     21-MAR-2000 (AJC):
#        Remove sup_dirfx
#        PKG_VERS 1.9
#        LIB_VERS 2.8
#     16-MAY-2001 (AJC):
#        Add sup_init
#        PKG_VERS 1.10
#        LIB_VERS 2.9
#     16-AUG-2001 (AJC):
#        PKG_VERS 2.0  Call AMS direct
#        LIB_VERS 3.0
#      1-SEP-2002 (AJC):
#        PKG_VERS 2.0-2
#        Make subpar_err.h public
#      3-DEC-2002 (AJC):
#        PKG_VERS 2.1
#        LIB_VERS 3.1
#        Add SUBPAR_GREF for MERS
#      3-DEC-2003 (AJC):
#        Add INSTALL_HELP to INSTALL_DIRS
#     {enter_further_changes_here}
#
#  Bugs:
#     {note_any_bugs_here}
#
#-------------------------------------------------------------------------------

#  Help target.
#  ===========
#
#  This is the default target, so it appears first.

#  Display information about the mk script and the make targets.

help:
	@ echo \
   '   The makefile provided is intended to be used by the make utility when';\
        echo \
   '   invoked via the associated mk script.  This script defines environment';\
        echo \
   '   variables which are used by make to accommodate differing machine and';\
        echo \
   '   operating system characteristics.  Please see the mk script prologue';\
        echo \
   '   for full details.';\
        echo;\
        echo \
   '   The following targets are provided:';\
        echo;\
        echo \
   '      help          - Display this message';\
        echo \
   '      check         - Check source file presence and show current state';\
        echo \
   '      build         - Build the package from source';\
        echo \
   '      install       - Install the built package for use';\
        echo \
   '      deinstall     - Deinstall the package';\
        echo \
   '      test          - Perform a quick test of the installation';\
        echo \
   '      export        - Make a compressed tar file for exporting the'\
   'built package';\
	echo \
   '                      complete with source and documentation';\
        echo \
   '      export_run    - Make a compressed tar file for exporting the'\
   'built package';\
        echo \
   '                      with documentation but no source';\
        echo \
   '      export_source - Make a compressed tar file for exporting the'\
   'source files';\
        echo \
   '      clean         - Tidy up after building the package';\
        echo \
   '      unbuild       - Remove all the built files';\
        echo;\
        echo \
   '   To build and install the $(PACK_NAME) package on a supported system:';\
        echo;\
        echo \
   '      mk build; mk install; mk test; mk clean';\
        echo

#-------------------------------------------------------------------------------

#  Defaults.
#  ========
#
#  This section defines default macros and should rarely need changing.
#  The values given here should be overridden externally to adapt to
#  the local system setup (either use the mk script or use environment
#  variables and invoke "make" with the "-e" option).

#  Name of computer hardware/OS combination.

SYSTEM = unknown

#  Name used to distinguish platform-specific source files.

SOURCE_VARIANT = $(SYSTEM)

#  Pathname of the root directory beneath which other Starlink software
#  is currently installed.

STARLINK = /star

#  Pathnames of Starlink sub-directories that may be referenced when
#  building this package.

STAR_BIN = $(STARLINK)/bin
STAR_DATES = $(STARLINK)/dates
STAR_DOCS = $(STARLINK)/docs
STAR_ETC = $(STARLINK)/etc
STAR_HELP = $(STARLINK)/help
STAR_INC = $(STARLINK)/include
STAR_LIB = $(STARLINK)/lib

#  Pathname of the root directory beneath which the built files for
#  this package should be installed for use.  This defaults to the
#  user's home directory.

INSTALL = $(HOME)

#  Pathnames of directories into which files may be placed when the
#  package is installed.

INSTALL_BIN = $(INSTALL)/bin
INSTALL_DATES = $(INSTALL)/dates
INSTALL_DOCS = $(INSTALL)/docs
INSTALL_ETC = $(INSTALL)/etc
INSTALL_HELP = $(INSTALL)/help
INSTALL_INC = $(INSTALL)/include
INSTALL_LIB = $(INSTALL)/lib
INSTALL_SHARE = $(INSTALL)/share

#  Pathname of the root directory of the PCS source hierarchy. Other PCS
#  package components reference by this one are assumed to have been already
#  built under PCSSRC_DIR (rather than assuming they have been installed
#  beneath INSTALL_DIR.

PCSSRC_DIR = ..

#  Pathname of the directory into which exported tar files will be
#  placed.  This defaults to the current working directory.

EXPORT = .

#  Default macros for compiling C and Fortran source code.

CC = c89
CFLAGS = -O
FC = fort77
FFLAGS = -O

#  Command for forming a link to a file.

LINK = ln

#  Command for "randomizing" an object library.  The default acts as a
#  null command.

RANLIB = :

#  Commands for adding to and extracting from an archive file (.tar).

TAR_IN = pax -w -v -x ustar -f
TAR_OUT = pax -r -f

#  Command for adding a file to an object archive (.a).

AR_IN = ar -r

#  Default file type extension for a shareable library and command for
#  building a shareable library (the default acts as a null command).

SHARE = .so
BLD_SHR = :

#-------------------------------------------------------------------------------
################################################################################
#
#  Define package source files.
#  ===========================
#
#  This section defines the set of source files for the package.

#  Name of the package as specified in documentation
#  The value is used in messages from make to the user.
PACK_NAME = SUBPAR

#  Prefix for the package in lower-case as used in filenames etc.
PKG_NAME = subpar

#  Prefix for the package in upper-case as used in include file links.
PKG_LINK = SUBPAR

#  Package number.
#  This is the number allocated to each package to enable unique
#  status values to be defined for the package.

PKG_NUM = 170

#  Version number (as in the documentation - i.e. not the same thing
#  as the shared library version number).
#
#  The major component of the version number (before the dot) should
#  normally only be incremented following major changes to the package.
#  The minor version number (after the dot) is the number normally
#  incremented following development which introduces new documented
#  functionality.  Any revision number (appended after a dash) should
#  be incremented for other minor changes (bug fixes, etc.) which do
#  not merit documentation changes.

PKG_VERS = 2.1

#  Library version number.
#
#  n.b. Care needed - may affect existing applications.
#
#  The minor component of this number (following the dot) should be
#  incremented whenever a new routine is added to a library or some
#  other change is made such that programs built with the latest
#  version would fail to run using an earlier version.  The major number
#  should be incremented if a change is made such that existing
#  programs would have to be re-built in order to work with the new
#  version.

LIB_VERS = 3.1

#  List of files comprising the distributed source-only system.  This
#  defines the minimum set of files required to rebuild completely the
#  package from source (including this makefile, the associated mk
#  script and any documentation files).

SOURCE_FILES = $(PKG_NAME)_source.tar makefile mk $(DOCUMENTATION)

#  List of public script files.  These are scripts which form part of
#  the package and will be required by users of it.  They will be
#  installed in the $(INSTALL_BIN) directory with execute permission
#  set.

PUBLIC_SCRIPTS = $(PKG_NAME)_link_adam

#  Startup script.  This is the file that must be executed by a
#  programmer using this package in order to define links to include
#  files.  It is listed separately from the public scripts as it is
#  edited by the installation procedure.

STARTUP_SCRIPT = $(PKG_NAME)_dev

#  List of public include files.  These are include files which form
#  part of the package and may be required by users of it.  They will be
#  installed in the $(INSTALL_INC) directory.

PUBLIC_INCLUDES = $(PKG_NAME)_err $(PKG_NAME)_par subpar_err.h

#  List of private include files.  These are additional include files
#  which form part of the package and are required in order to build
#  it, but which are not required by users of it.

PRIVATE_INCLUDES = subpar_cmn subpar_sys subpar_parerr 

#  List of external include files.  These are files which are required
#  in order to build the package but form part of other, externally
#  installed packages.  This list should contain the names used to
#  reference the files within the source code, not the actual names of
#  the files.

EXTERNAL_INCLUDES = SAE_PAR MESSYS_PAR MESSYS_ERR LEX_PAR LEX_ERR \
                    DAT_PAR DAT_ERR CHR_ERR ADAM_DEFNS EMS_PAR \
                    sae_par.h f77.h cnf.h ems.h ems_par.h

#  List of Fortran routines required for building the package.  This is
#  just a list of all the Fortran source files (excluding BLOCK DATA
#  routines, which are treated separately).

F_ROUTINES = sup_accpt.f \
             sup_accpt1.f \
             sup_actdcl.f \
             sup_activ.f \
             sup_actname.f \
             sup_array.f \
             sup_assoc.f \
             sup_bascopy.f \
             sup_cancl.f \
             sup_canloc.f \
             sup_checkname.f \
             sup_cmdline.f \
             sup_cmdpar.f \
             sup_convals.f \
             sup_creat.f \
             sup_credyn.f \
             sup_crint.f \
             sup_ctype.f \
             sup_curloc.f \
             sup_curname.f \
             sup_cursav.f \
             sup_curval.f \
             sup_deact.f \
             sup_def0c.f \
             sup_def0d.f \
             sup_def0i.f \
             sup_def0l.f \
             sup_def0r.f \
             sup_def1c.f \
             sup_def1d.f \
             sup_def1i.f \
             sup_def1l.f \
             sup_def1r.f \
             sup_defnc.f \
             sup_defnd.f \
             sup_defni.f \
             sup_defnl.f \
             sup_defnr.f \
             sup_datdef.f \
             sup_datfind.f \
             sup_delet.f \
             sup_eflsh.f \
             sup_enquote.f \
             sup_exhandler.f \
             sup_exist.f \
             sup_fetchc.f \
             sup_fetchd.f \
             sup_fetchi.f \
             sup_fetchl.f \
             sup_fetchr.f \
             sup_findact.f \
             sup_findhds.f \
             sup_findkey.f \
             sup_findpar.f \
             sup_fprompt.f \
             sup_get.f \
             sup_get0c.f \
             sup_get0d.f \
             sup_get0i.f \
             sup_get0l.f \
             sup_get0r.f \
             sup_get1c.f \
             sup_get1d.f \
             sup_get1i.f \
             sup_get1r.f \
             sup_get1l.f \
             sup_getfloc.f \
             sup_gethds.f \
             sup_getkey.f \
             sup_getloc.f \
             sup_getnc.f \
             sup_getnd.f \
             sup_getni.f \
             sup_getnr.f \
             sup_getnl.f \
             sup_getname.f \
             sup_getvc.f \
             sup_getvd.f \
             sup_getvi.f \
             sup_getvr.f \
             sup_getvl.f \
             sup_gref.f \
             sup_hdsarr.f \
             sup_hdsass.f \
             sup_hdsdef.f \
             sup_hdsdyn.f \
             sup_hdsin.f \
             sup_hdslocs.f \
             sup_hdsopen.f \
             sup_hlpex.f \
             sup_index.f \
             sup_init.f \
             sup_input.f \
             sup_intloc.f \
             sup_iput.f \
             sup_keyreq.f \
             sup_ldifc0.f \
             sup_ldifc1.f \
             sup_limitc.f \
             sup_limitd.f \
             sup_limiti.f \
             sup_limitr.f \
             sup_loadifc.f \
             sup_maxc.f \
             sup_maxd.f \
             sup_maxi.f \
             sup_maxr.f \
             sup_minc.f \
             sup_mind.f   \
             sup_mini.f \
             sup_minr.f \
             sup_mlith.f \
             sup_mnmx.f \
             sup_nameass.f \
             sup_nametr.f \
             sup_openifc.f \
             sup_oput.f \
             sup_pargp.f \
             sup_parname.f \
             sup_partype.f \
             sup_promptcl.f \
             sup_promt.f \
             sup_put.f \
             sup_put0c.f \
             sup_put0d.f \
             sup_put0i.f \
             sup_put0l.f \
             sup_put0r.f \
             sup_put1c.f \
             sup_put1d.f \
             sup_put1i.f \
             sup_put1r.f \
             sup_put1l.f \
             sup_putfloc.f \
             sup_putloc.f \
             sup_putnc.f \
             sup_putnd.f \
             sup_putni.f \
             sup_putnr.f \
             sup_putnl.f \
             sup_putname.f \
             sup_putpath.f \
             sup_putvc.f \
             sup_putvd.f \
             sup_putvi.f \
             sup_putvr.f \
             sup_putvl.f \
             sup_pwhlp.f \
             sup_rangec.f \
             sup_ranged.f \
             sup_rangei.f \
             sup_ranger.f \
             sup_rdif.f \
             sup_request.f \
             sup_reset.f \
             sup_scrnsz.f \
             sup_selhelp.f \
             sup_setcheck.f \
             sup_split.f \
             sup_splitval.f \
             sup_state.f \
             sup_store0.f \
             sup_sync.f \
             sup_termface.f \
             sup_unset.f \
             sup_updat.f \
             sup_valass.f \
             sup_vwhlp.f \
             sup_wrerr.f \
             sup_write.f \
             sup_wrmsg.f \
             sup_dexit.f \
             sup_fname.f \
             sup_gtcmd.f \
             sup_pfer.f \
             sup_prompt.f \
             sup_tsknm.f \
             sup_unquote.f \
             sup_wrhelp.f

#  List of Fortran BLOCK DATA routines.

BLOCK_DATA =

#  List of platform specific Fortran routines.  The source tar file will
#  contain a version of these files for each set of platforms.  The names
#  given here are the general version of the file, e.g. pkg_open.f.  The
#  names in the tar file will be pkg_open.f_sun4, pkg_open.f_mips, etc.

PLATFORM_F =

#  C routines required for building the package.  This is just a list of
#  all the C source files.

C_ROUTINES = sup_admus.c \
             sup_fifil.c \
             sup_mkdir.c \
             sup_trmsz.c

#  The facility error file.

FAC_ERRS = fac_$(PKG_NUM)_err

#  Lists of Latex and hypertext documents.

LATEX_DOCS = 
HYPERTEXT_DOCS = 

#  List of documentation files.

DOCUMENTATION = 

################################################################################
#-------------------------------------------------------------------------------

#  Define files required for building the package.
#  ==============================================
#
#  This section defines the set of files produced from the source files
#  when the package is built and installed.

#  Use only .o, .c and .f suffix rules.

.SUFFIXES:
.SUFFIXES: .o .c .f

#  List of files which must be built from the source files before the
#  package can be installed for use.  This should comprise all the files
#  that are required to use the package (but excluding the date stamp
#  file).

BUILT_FILES = $(PUBLIC_SCRIPTS) $(PUBLIC_INCLUDES) $(OBJECT_LIBRARIES) \
$(SHAREABLE_LIBRARIES) $(STARTUP_SCRIPT) $(FAC_ERRS)

#  List of links used to access include files during compilation.  This
#  should comprise all the external include files and any other include
#  files whose names do not exactly match the names used in the source
#  code.

INCLUDE_LINKS = $(EXTERNAL_INCLUDES) $(PKG_LINK)_ERR $(PKG_LINK)_PAR \
                SUBPAR_CMN SUBPAR_SYS SUBPAR_PARERR

#  Rules to set up links to locate each of the above include files.

$(PKG_LINK)_ERR:   $(PKG_NAME)_err;               $(LINK) $? $@
$(PKG_LINK)_PAR:   $(PKG_NAME)_par;               $(LINK) $? $@
SUBPAR_PARERR:    subpar_parerr;               $(LINK) $? $@
SUBPAR_CMN:       subpar_cmn;                  $(LINK) $? $@
SUBPAR_SYS:       subpar_sys;                  $(LINK) $? $@
SAE_PAR:   $(STAR_INC)/sae_par;   $(LINK) $? $@
EMS_PAR:          $(STAR_INC)/ems_par;         $(LINK) $? $@
DAT_PAR:          $(STAR_INC)/dat_par;         $(LINK) $? $@
DAT_ERR:          $(STAR_INC)/dat_err;         $(LINK) $? $@
CHR_ERR:          $(STAR_INC)/chr_err;         $(LINK) $? $@
sae_par.h:        $(STAR_INC)/sae_par.h;       $(LINK) $? $@
f77.h:            $(STAR_INC)/f77.h;           $(LINK) $? $@
cnf.h:            $(STAR_INC)/cnf.h;           $(LINK) $? $@
ems.h:            $(STAR_INC)/ems.h;           $(LINK) $? $@
ems_par.h:        $(STAR_INC)/ems_par.h;       $(LINK) $? $@
MESSYS_PAR:       $(PCSSRC_DIR)/messys/messys_par;      $(LINK) $? $@
MESSYS_ERR:       $(PCSSRC_DIR)/messys/messys_err;      $(LINK) $? $@
LEX_PAR:          $(PCSSRC_DIR)/lex/lex_par;         $(LINK) $? $@
LEX_ERR:          $(PCSSRC_DIR)/lex/lex_err;         $(LINK) $? $@
ADAM_DEFNS:       $(PCSSRC_DIR)/adam/adam_defns;      $(LINK) $? $@

#  Rules for extracting source files from the source archive.

$(PUBLIC_SCRIPTS) $(PUBLIC_INCLUDES) $(PRIVATE_INCLUDES) \
$(F_ROUTINES) $(BLOCK_DATA) $(C_ROUTINES) \
$(STARTUP_SCRIPT) $(FAC_ERRS):
	$(TAR_OUT) $(PKG_NAME)_source.tar $@
	@ if test -f $@; then :;\
           else echo $@ is not in the tar file; exit 1; fi

#  Rules for extracting platform specific source files from the source
#  archive.

#  It is quite likely that there are no platform-specific source files
#  and that the macro PLATFORM_F is empty. To prevent a syntax error in
#  make, a dummy target is present.

$(PLATFORM_F) dummy_target1:
	$(TAR_OUT) $(PKG_NAME)_source.tar $@_$(SOURCE_VARIANT)
	@ if test -f $@_$(SOURCE_VARIANT); then :;\
           else echo $@_$(SOURCE_VARIANT) is not in the tar file; exit 1; fi
	mv $@_$(SOURCE_VARIANT) $@

#  List of object files produced by compiling the source code and rules
#  for performing the compilations.

OBJECT_FILES = $(BLOCK_DATA:.f=.o) $(F_ROUTINES:.f=.o) \
               $(PLATFORM_F:.f=.o) $(C_ROUTINES:.c=.o)

.c.o:
	$(CC) $(CFLAGS) -c $<
.f.o:
	$(FC) $(FFLAGS) -c $<

#  List of object library files to be built and rules for building
#  them.

OBJECT_LIBRARIES = lib$(PKG_NAME)_adam.a

lib$(PKG_NAME)_adam.a: $(OBJECT_FILES)
	$(AR_IN) $@ $?
	$(RANLIB) $@

#  List of shareable library files to be built and rules for building
#  them. The third argument to $(BLD_SHR) should provide the information
#  necessary to link any libraries called by this package.

SHAREABLE_LIBRARIES = lib$(PKG_NAME)_adam$(SHARE)

lib$(PKG_NAME)_adam$(SHARE): $(OBJECT_FILES)
	touch $@
	$(BLD_SHR) $@ '$(OBJECT_FILES)' '-L$(STAR_LIB) -lems'

#  Name of the date stamp file.  This is used to record the time of the
#  most recent build for use in subsequent operations that require it.
#  There must be no rule for generating this file; it is updated only
#  as a side effect of building the package.

DATE_STAMP = $(PKG_NAME)_datestamp

#  List of directories actually used for installation (selected from
#  those above) and rules to create them.

INSTALL_DIRS = $(INSTALL_BIN) $(INSTALL_DATES) $(INSTALL_INC) $(INSTALL_LIB) \
               $(INSTALL_SHARE) $(INSTALL_HELP)

$(INSTALL_DIRS):
	mkdir -p $@

#-------------------------------------------------------------------------------

#  Primary targets.
#  ===============
#
#  These are the targets intended for normal external use (apart from
#  help, which appears at the start of the file).

#  check: Check source file presence and show current state.
#  --------------------------------------------------------

check:
	@ echo
	@ echo \
   '*** This is $(PACK_NAME) version V$(PKG_VERS) on system $(SYSTEM)'
	@ echo
	@ nosource='';\
          for f in $(SOURCE_FILES); do \
             if test ! -f $$f; then \
                nosource='1';\
                break;\
             else :; fi;\
          done;\
          if test -n "$$nosource"; then \
             echo '    Source files are NOT present';\
          else \
             echo '    All essential source files are present';\
          fi
	@ echo
#
#  Display the current state.
	@ if test -f .BUILT;\
          then echo '    The package is currently:  built for system'\
             `cat .BUILT`;\
          else echo '    The package is currently:  not built';fi
	@ if test -f .INSTALLED_$(SYSTEM);\
          then echo '                               installed in'\
             `cat .INSTALLED_$(SYSTEM)`;\
          else echo '                               not installed';fi
	@ if test -f .TESTED_$(SYSTEM);\
          then echo '                               tested';\
          else echo '                               not tested';fi
	@ echo
	@ if test -f .BUILT;\
          then if test "$(SYSTEM)" != "`cat .BUILT`";\
             then echo '***  WARNING  ***';\
                echo \
'    The package is built for a system other than the current one';\
                echo ;\
             else :;fi;\
          else :;fi

#  build: Build the system.
#  -----------------------
#
#  Compile the source and build the required files in the source
#  directory.

#  The build target first checks that the package is not installed.  If
#  not, it then causes the .BUILT target to be made which ensures that
#  the package has been built.

build:
	@ if test -f .INSTALLED_$(SYSTEM); then \
           echo;\
           echo \
   '*** The $(PACK_NAME) package is currently installed -- please use the';\
           echo '    "deinstall" target before re-building it';\
           echo;\
        elif $(MAKE) .BUILT; then \
           echo;\
           echo '*** The $(PACK_NAME) package has been built';\
           echo;\
        else \
           echo;\
           echo '*** "make" failed building the $(PACK_NAME) package';\
           echo;\
           exit 1;\
        fi

#  The .BUILT target records the time of the most recent build which
#  modified any of the built files.  It depends on all the built files
#  being up to date (which causes them to be built).

.BUILT: $(BUILT_FILES)
#
#  Enter information about the current machine and build environment
#  into the date stamp file.
	@ echo 'Package : $(PACK_NAME)'        >$(DATE_STAMP)
	@ echo 'Version : V$(PKG_VERS)'       >>$(DATE_STAMP)
	@ echo 'Library : V$(LIB_VERS)'       >>$(DATE_STAMP)
	@ echo ''                             >>$(DATE_STAMP)
	@ echo "Built by: $(USER) on node `uname -n`" \
                                              >>$(DATE_STAMP)
	@ echo "On      : `date`"             >>$(DATE_STAMP)
	@ echo ''                             >>$(DATE_STAMP)
	@ echo \
  "Machine : `uname -m` running `uname -s` `uname -v` (release `uname -r`)" \
                                              >>$(DATE_STAMP)
	@ echo ''                             >>$(DATE_STAMP)
	@ echo 'make macros:'                 >>$(DATE_STAMP)
	@ echo ''                             >>$(DATE_STAMP)
	@ echo '   SYSTEM  : $(SYSTEM)'       >>$(DATE_STAMP)
	@ echo ''                             >>$(DATE_STAMP)
	@ echo '   EXPORT  : $(EXPORT)'       >>$(DATE_STAMP)
	@ echo '   INSTALL : $(INSTALL)'      >>$(DATE_STAMP)
	@ echo '   STARLINK: $(STARLINK)'     >>$(DATE_STAMP)
	@ echo ''                             >>$(DATE_STAMP)
	@ echo '   AR_IN   : $(AR_IN)'        >>$(DATE_STAMP)
	@ echo '   BLD_SHR : $(BLD_SHR)'      >>$(DATE_STAMP)
	@ echo '   CC      : $(CC)'           >>$(DATE_STAMP)
	@ echo '   CFLAGS  : $(CFLAGS)'       >>$(DATE_STAMP)
	@ echo '   FC      : $(FC)'           >>$(DATE_STAMP)
	@ echo '   FFLAGS  : $(FFLAGS)'       >>$(DATE_STAMP)
	@ echo '   LINK    : $(LINK)'         >>$(DATE_STAMP)
	@ echo '   RANLIB  : $(RANLIB)'       >>$(DATE_STAMP)
	@ echo '   SHARE   : $(SHARE)'        >>$(DATE_STAMP)
	@ echo '   SOURCE_VARIANT: $(SOURCE_VARIANT)' \
                                              >>$(DATE_STAMP)
	@ echo '   TAR_IN  : $(TAR_IN)'       >>$(DATE_STAMP)
	@ echo '   TAR_OUT : $(TAR_OUT)'      >>$(DATE_STAMP)
	@ echo ''                             >>$(DATE_STAMP)
#
#  Record completion of the build.
	@ echo '$(SYSTEM)' > .BUILT

#  install: Install the package for use.
#  ------------------------------------
#
#  Copy the built files to their installation directories, from where
#  they may be accessed.

#  The install target first checks if any part of the package is
#  already installed.  If not, it checks that the system is built for this
#  SYSTEM and, if it is, causes the .INSTALLED_$(SYSTEM) target to be made
#  which performs the installation.

install:
	@ if test -f .INSTALLED_$(SYSTEM); then \
           echo;\
           echo \
   '*** The $(PACK_NAME) package has already been installed -- please use the';\
           echo \
   '    "deinstall" target first if you wish to reinstall it';\
           echo;\
        elif test -f .BUILT; then \
           if test "`cat .BUILT`" = "$(SYSTEM)"; then \
              if $(MAKE) .INSTALLED_$(SYSTEM); then \
                 echo;\
                 echo \
   '*** The $(PACK_NAME) package has been installed in directory $(INSTALL)';\
                 echo;\
              else \
                 echo;\
                 echo \
   '*** "make" failed installing the $(PACK_NAME) package in directory $(INSTALL)';\
                 echo;\
                 exit 1;\
              fi;\
           else \
              echo;\
              echo \
   "*** The $(PACK_NAME) package is built for system `cat .BUILT` -"\
   'so cannot be installed on system $(SYSTEM)';\
              echo;\
              exit 1;\
           fi;\
        else \
           echo;\
           echo \
   '*** The $(PACK_NAME) package is not built, so cannot be installed';\
           echo;\
           exit 1;\
        fi

#  The .INSTALLED_$(SYSTEM) target copies each file from the source
#  directory using "cp -p" to preserve its date, and replaces each
#  original file by a link to the installed copy.

.INSTALLED_$(SYSTEM): $(INSTALL_DIRS)
#
#  Create .INSTALLED_$(SYSTEM), containing $INSTALL, to record that the 
#  package is installed (at least in part).
	@ echo $(INSTALL) > .INSTALLED_$(SYSTEM)
#
#  Install the public scripts, giving them world execute permission.
	for f in $(PUBLIC_SCRIPTS) ""; do \
           if test -n "$$f"; then \
              cp -p $$f $(INSTALL_BIN);\
              chmod 755 $(INSTALL_BIN)/$$f;\
              rm -f $$f;\
              $(LINK) $(INSTALL_BIN)/$$f $$f;\
           else :; fi;\
        done
#
#  Install the public include files, giving them world read permission.
	for f in $(PUBLIC_INCLUDES) ""; do \
           if test -n "$$f"; then \
              cp -p $$f $(INSTALL_INC);\
              chmod 644 $(INSTALL_INC)/$$f;\
              rm -f $$f;\
              $(LINK) $(INSTALL_INC)/$$f $$f;\
           else :; fi;\
        done
#
#  Install the object libraries, giving them world read permission.
	for f in $(OBJECT_LIBRARIES) ""; do \
           if test -n "$$f"; then \
              cp -p $$f $(INSTALL_LIB);\
              chmod 644 $(INSTALL_LIB)/$$f;\
              rm -f $$f;\
              $(LINK) $(INSTALL_LIB)/$$f $$f;\
           else :; fi;\
        done
#
#  Install shareable libraries, giving them read permission (unless
#  they are dummy, zero size, files in which case they are left in
#  place).
	for f in $(SHAREABLE_LIBRARIES) ""; do \
           if test -n "$$f" -a -s "$$f"; then \
              cp -p $$f $(INSTALL_SHARE);\
              chmod 755 $(INSTALL_SHARE)/$$f;\
              rm -f $$f;\
              $(LINK) $(INSTALL_SHARE)/$$f $$f;\
           else :; fi;\
        done
#
#  Install the package startup script.  The name of the directory
#  containing the installed public include files must be edited into
#  this, and execute permission given.  Leave the original file in
#  place.
	if test -n "$(STARTUP_SCRIPT)"; then \
           sed -e 's#LINK#$(LINK)#' -e s#INSTALL_INC#$(INSTALL_INC)# \
              $(STARTUP_SCRIPT) >$(INSTALL_BIN)/$(STARTUP_SCRIPT) ;\
           chmod 755 $(INSTALL_BIN)/$(STARTUP_SCRIPT) ;\
        else :; fi
#
#  Install the facility error file, giving it world read permission.
	if test -n "$(FAC_ERRS)"; then \
           cp -p $(FAC_ERRS) $(INSTALL_HELP);\
           chmod 644 $(INSTALL_HELP)/$(FAC_ERRS);\
           rm -f $(FAC_ERRS);\
           $(LINK) $(INSTALL_HELP)/$(FAC_ERRS) $(FAC_ERRS);\
        else :; fi
#
#  Install the Latex documentation, giving it world read permission,
#  leaving the source copy in place.
	for f in $(LATEX_DOCS) ""; do \
           if test -n "$$f"; then \
              cp -p $$f $(INSTALL_DOCS);\
              chmod 644 $(INSTALL_DOCS)/$$f;\
           else :; fi;\
        done
#
#  Install any hypertext documents, giving world read access to all the files
#  they contain and linking with other documents.
	if test -n "$(HYPERTEXT_DOCS)"; then \
           pwd=`pwd`;\
           (cd $(INSTALL_DOCS);\
           for f in $(HYPERTEXT_DOCS) ""; do \
              if test -n "$$f"; then\
                 $(TAR_OUT) $$pwd/$${f}_tar;\
                 chmod 755 `find $$f -type d -print`;\
                 chmod 644 `find $$f ! -type d -print`;\
                 touch $$f;\
              else :; fi;\
           done);\
           HTX_PATH='$(STAR_DOCS):$(STAR_HELP)';\
           export HTX_PATH;\
           $(STAR_BIN)/hlink $(INSTALL_DOCS) $(INSTALL_HELP);\
        fi;
#
#  Install the date stamp file and make it read-only to prevent its
#  date being changed.
	cp -p $(DATE_STAMP) $(INSTALL_DATES)
	chmod 444 $(INSTALL_DATES)/$(DATE_STAMP)
	chmod 644 $(DATE_STAMP)
	rm $(DATE_STAMP)
	$(LINK) $(INSTALL_DATES)/$(DATE_STAMP) $(DATE_STAMP)

#  deinstall: Deinstall the package.
#  --------------------------------
#
#  Reverse the action of the install target, removing the installed
#  files and returning them to the source directory.

#  The deinstall target checks that the package is installed in the INSTALL
#  directory.  If so, it causes the do_deinstall target to be made which 
#  performs the deinstallation.

deinstall:
	@ if test ! -f .INSTALLED_$(SYSTEM); then \
           echo;\
           echo '*** The $(PACK_NAME) package is not currently installed';\
           echo;\
        else \
           if test "`cat .INSTALLED_$(SYSTEM)`" = "$(INSTALL)"; then \
              if $(MAKE) do_deinstall; then \
                 echo;\
                 echo \
'*** The $(PACK_NAME) package has been deinstalled from directory $(INSTALL)';\
                 echo;\
              else \
                 echo;\
                 echo \
'*** "make" failed deinstalling the $(PACK_NAME) package from directory $(INSTALL)';\
                 echo;\
                 exit 1;\
              fi;\
           else \
              echo;\
              echo \
"*** The $(PACK_NAME) package is installed in `cat .INSTALLED_$(SYSTEM)`";\
              echo \
"*** and not in your INSTALL directory ($(INSTALL))";\
              echo '*** Not deinstalled';\
              exit 1;\
           fi;\
        fi

#  The do_deinstall target (which should never exist) checks that an
#  installed version of each file exists (in case an install failed
#  part of the way through) and returns it to the source directory,
#  using "cp -p" to preserve file dates.  Links are removed from the
#  source directory before copying.

do_deinstall:
#
#  Note the package will need to be tested again.
	@- if test -f .TESTED_$(SYSTEM); then rm -f .TESTED_$(SYSTEM); else :; fi
#
#  Deinstall the public script files, if installed versions exist.
	- for f in $(PUBLIC_SCRIPTS) ""; do \
           if test -n "$$f" -a -f $(INSTALL_BIN)/$$f; then \
              rm -f $$f;\
              cp -p $(INSTALL_BIN)/$$f .;\
              rm -f $(INSTALL_BIN)/$$f;\
           else :; fi;\
        done
#
#  Deinstall the public include files, if installed versions exist.
	- for f in $(PUBLIC_INCLUDES) ""; do \
           if test -n "$$f" -a -f $(INSTALL_INC)/$$f; then \
              rm -f $$f;\
              cp -p $(INSTALL_INC)/$$f .;\
              rm -f $(INSTALL_INC)/$$f;\
           else :; fi;\
        done
#
#  Deinstall the object libraries, if installed versions exist.
	- for f in $(OBJECT_LIBRARIES) ""; do \
           if test -n "$$f" -a -f $(INSTALL_LIB)/$$f; then \
              rm -f $$f;\
              cp -p $(INSTALL_LIB)/$$f .;\
              rm -f $(INSTALL_LIB)/$$f;\
           else :; fi;\
        done
#
#  Deinstall the shareable libraries, if installed versions exist.
	- for f in $(SHAREABLE_LIBRARIES) ""; do \
           if test -n "$$f" -a -f $(INSTALL_SHARE)/$$f; then \
              rm -f $$f;\
              cp -p $(INSTALL_SHARE)/$$f .;\
              rm -f $(INSTALL_SHARE)/$$f;\
           else :; fi;\
        done
#
#  Deinstall the package startup file.  Since it will have been edited
#  during installation, we remove the installed copy, if present, and
#  then ensure that the original exists.
	- if test -n "$(STARTUP_SCRIPT)"; then \
           if test -f $(INSTALL_BIN)/$(STARTUP_SCRIPT); then\
              rm -f $(INSTALL_BIN)/$(STARTUP_SCRIPT);\
           else :; fi ;\
           $(MAKE) $(STARTUP_SCRIPT);\
        else :; fi
#
#  Deinstall the facility error file, if installed version exists.
	- if test -n "$(FAC_ERRS)"; then \
           if test -f $(INSTALL_HELP)/$(FAC_ERRS); then\
              rm -f $(FAC_ERRS);\
              cp -p $(INSTALL_HELP)/$(FAC_ERRS) .;\
              rm -f $(INSTALL_HELP)/$(FAC_ERRS);\
           else :; fi ;\
        else :; fi
#
#  Deinstall the Latex documentation, if installed versions exist.
	- for f in $(LATEX_DOCS) ""; do \
           if test -n "$$f" -a -f $(INSTALL_DOCS)/$$f; then \
              rm -f $(INSTALL_DOCS)/$$f;\
           else :; fi;\
        done
#
#  Deinstall any hypertext documents,  and relink the hypertext if required.
	- if test -n "$(HYPERTEXT_DOCS)"; then \
           for f in $(HYPERTEXT_DOCS) ""; do \
              if test -n "$$f" -a -d $(INSTALL_DOCS)/$$f; then \
                 rm -f -r $(INSTALL_DOCS)/$$f;\
              else :; fi;\
           done;\
           HTX_PATH='$(STAR_DOCS):$(STAR_HELP)';\
           export HTX_PATH;\
           $(STAR_BIN)/hlink $(INSTALL_DOCS) $(INSTALL_HELP);\
        fi
#
#  Deinstall the date stamp file after setting its protection so it may
#  be removed.
	- if test -f $(INSTALL_DATES)/$(DATE_STAMP); then \
           chmod 644 $(DATE_STAMP); rm $(DATE_STAMP);\
           chmod 644 $(INSTALL_DATES)/$(DATE_STAMP);\
           cp -p $(INSTALL_DATES)/$(DATE_STAMP) .;\
           rm $(INSTALL_DATES)/$(DATE_STAMP);\
        else :; fi
#
#  Note the system is no longer installed.  Re-create .BUILT, since we have
#  returned the built files to the source directory but an unbuild may have
#  been done.
	@- rm -f .INSTALLED_$(SYSTEM) 1>/dev/null 2>/dev/null
	@ echo '$(SYSTEM)' > .BUILT

#  test: Perform an installation test.
#  ----------------------------------
#
#  Check that installed files are in their correct places and that a
#  simple test program will run correctly.

#  The test target checks that the package is currently installed.  If
#  so, it causes the do_test target to be made, which performs the
#  installation test.

test:
	@ if test ! -f .INSTALLED_$(SYSTEM); then \
           echo;\
           echo '*** The $(PACK_NAME) package is not currently installed';\
           echo;\
        else \
           echo;\
           echo \
           '*** There is no installation test for the $(PACK_NAME) package.';\
           echo \
           '*** Test PCS as a whole with the PCS test.';\
           echo;\
        fi

#  export: Export the installed system.
#  -----------------------------------
#
#  Export the source plus all the built files to a new user.

#  The export target depends on the resulting compressed tar file being
#  up to date.

export: $(EXPORT)/$(PKG_NAME)_$(SYSTEM).tar.Z
	@ echo
	@ echo \
'*** Export copy of the built $(PACK_NAME) package is in the compressed'
	@ echo \
'    tar file $(EXPORT)/$(PKG_NAME)_$(SYSTEM).tar.Z'
	@ echo

#  The compressed tar file is up to date if it exists and is more
#  recent than all the source files and the date stamp file (which
#  records the time of the last build which modified any files).

$(EXPORT)/$(PKG_NAME)_$(SYSTEM).tar.Z: $(SOURCE_FILES) $(DATE_STAMP)
#
#  Issue a warning if the package has not been tested.
	@ if test ! -f .TESTED_$(SYSTEM); then \
           echo;\
           echo '*** Warning: the $(PACK_NAME) package has not been tested';\
           echo;\
        else :; fi
#
#  Remove any pre-existing tar files before creating new ones.
	if test -f $(EXPORT)/$(PKG_NAME)_$(SYSTEM).tar.Z; then \
           rm -f $(EXPORT)/$(PKG_NAME)_$(SYSTEM).tar.Z; else :; fi
	$(TAR_IN) - $(SOURCE_FILES) $(BUILT_FILES) $(DATE_STAMP) .BUILT \
           | compress -v > $(EXPORT)/$(PKG_NAME)_$(SYSTEM).tar.Z

#  export_run: Export the built system (without source).
#  -----------------------------------------------------
#
#  Export all the built files to a new user.

#  The export_run target depends on the resulting compressed tar file being
#  up to date.

export_run: $(EXPORT)/$(PKG_NAME)_$(SYSTEM)_run.tar.Z
	@ echo
	@ echo \
'*** Export copy of the "runtime" $(PACK_NAME) package is in the compressed'
	@ echo \
'    tar file $(EXPORT)/$(PKG_NAME)_$(SYSTEM)_run.tar.Z'
	@ echo

#  The compressed tar file is up to date if it exists and is more
#  recent than all the source files and the date stamp file (which
#  records the time of the last build which modified any files).

$(EXPORT)/$(PKG_NAME)_$(SYSTEM)_run.tar.Z: $(SOURCE_FILES) $(DATE_STAMP)
#
#  Issue a warning if the package has not been tested.
	@ if test ! -f .TESTED_$(SYSTEM); then \
           echo;\
           echo '*** Warning: the $(PACK_NAME) package has not been tested';\
           echo;\
        else :; fi
#
#  Remove any pre-existing tar files before creating new ones.
	if test -f $(EXPORT)/$(PKG_NAME)_$(SYSTEM)_run.tar.Z; then \
           rm -f $(EXPORT)/$(PKG_NAME)_$(SYSTEM)_run.tar.Z; else :; fi
	$(TAR_IN) - mk makefile $(DOCUMENTATION) $(BUILT_FILES) \
           $(DATE_STAMP) .BUILT \
           | compress -v > $(EXPORT)/$(PKG_NAME)_$(SYSTEM)_run.tar.Z

#  export_source: Export the source.
#  --------------------------------
#
#  Export the source files only to a new user.

#  This target depends on the resulting compressed tar file being up to
#  date.

export_source: $(EXPORT)/$(PKG_NAME).tar.Z
	@ echo
	@ echo \
'*** Export copy of the $(PACK_NAME) package source is in the compressed'
	@ echo \
'    tar file $(EXPORT)/$(PKG_NAME).tar.Z'
	@ echo

#  The compressed tar file is up to date if it exists and is more
#  recent than all the source files.

$(EXPORT)/$(PKG_NAME).tar.Z: $(SOURCE_FILES)
#
#  Remove any pre-existing tar files before creating new ones.
	if test -f $(EXPORT)/$(PKG_NAME).tar.Z; then \
           rm -f $(EXPORT)/$(PKG_NAME).tar.Z; else :; fi
	$(TAR_IN) - $(SOURCE_FILES) \
           | compress -v > $(EXPORT)/$(PKG_NAME).tar.Z

#  clean: Clean up the source directory.
#  ------------------------------------
#
#  Remove all intermediate files.  Do not remove built files.

clean:
	@- rm -f $(INCLUDE_LINKS) $(PRIVATE_INCLUDES) $(F_ROUTINES) \
              $(PLATFORM_F) $(BLOCK_DATA) \
              $(C_ROUTINES) $(OBJECT_FILES) 1>/dev/null 2>/dev/null
	@ echo
	@ echo '*** Intermediate files removed'
	@ echo

#  unbuild: Reverse the build process.
#  ----------------------------------

#  Remove all intermediate files and all built files, and note that the
#  package is no longer built or tested.

unbuild: clean
	@- rm -f $(BUILT_FILES) $(DATE_STAMP) .BUILT 1>/dev/null 2>/dev/null
	@ echo '*** Built files removed'
	@ echo

#  archive: Create the source tar file
#  -----------------------------------

archive: $(PUBLIC_SCRIPTS) $(PUBLIC_INCLUDES) $(PRIVATE_INCLUDES) \
         $(F_ROUTINES) $(BLOCK_DATA) $(C_ROUTINES) \
         $(STARTUP_SCRIPT) $(FAC_ERRS)
	rm -f $(PKG_NAME)_source.tar
	$(TAR_IN) $(PKG_NAME)_source.tar \
         $(PUBLIC_SCRIPTS) $(PUBLIC_INCLUDES) $(PRIVATE_INCLUDES) \
         $(F_ROUTINES) $(BLOCK_DATA) $(C_ROUTINES) \
         $(STARTUP_SCRIPT) $(FAC_ERRS)

#-------------------------------------------------------------------------------

#  Include file dependencies.
#  =========================

#  Object file dependencies on include files (or links to those include
#  files).  These are normally generated automatically from the source
#  files.

sup_accpt.o : SAE_PAR
sup_accpt.o : DAT_PAR
sup_accpt.o : SUBPAR_CMN
sup_accpt.o : SUBPAR_SYS

sup_accpt1.o : SAE_PAR
sup_accpt1.o : DAT_PAR
sup_accpt1.o : SUBPAR_PAR
sup_accpt1.o : SUBPAR_CMN
sup_accpt1.o : SUBPAR_SYS

sup_actdcl.o : SAE_PAR
sup_actdcl.o : DAT_ERR
sup_actdcl.o : DAT_PAR
sup_actdcl.o : SUBPAR_CMN
sup_actdcl.o : SUBPAR_SYS

sup_activ.o : SAE_PAR
sup_activ.o : DAT_ERR
sup_activ.o : DAT_PAR
sup_activ.o : SUBPAR_CMN
sup_activ.o : SUBPAR_SYS

sup_actname.o : SAE_PAR
sup_actname.o : SUBPAR_ERR
sup_actname.o : DAT_PAR
sup_actname.o : SUBPAR_CMN
sup_actname.o : SUBPAR_SYS

sup_admus.o : sae_par.h
sup_admus.o : f77.h
sup_admus.o : cnf.h
sup_admus.o : ems.h
sup_admus.o : ems_par.h

sup_array.o : SAE_PAR
sup_array.o : SUBPAR_PAR
sup_array.o : SUBPAR_ERR
sup_array.o : DAT_PAR
sup_array.o : LEX_PAR
sup_array.o : LEX_ERR
sup_array.o : SUBPAR_CMN
sup_array.o : SUBPAR_SYS

sup_assoc.o : SAE_PAR
sup_assoc.o : SUBPAR_PAR
sup_assoc.o :SUBPAR_PARERR
sup_assoc.o : DAT_PAR
sup_assoc.o : SUBPAR_CMN
sup_assoc.o : SUBPAR_SYS

sup_bascopy.o : SAE_PAR

sup_cancl.o : SAE_PAR
sup_cancl.o : SUBPAR_PAR
sup_cancl.o : SUBPAR_ERR
sup_cancl.o : DAT_PAR
sup_cancl.o : SUBPAR_CMN
sup_cancl.o : SUBPAR_SYS

sup_canloc.o : SAE_PAR
sup_canloc.o : SUBPAR_ERR
sup_canloc.o : DAT_PAR
sup_canloc.o : SUBPAR_CMN
sup_canloc.o : SUBPAR_SYS

sup_checkname.o : SAE_PAR

sup_cmdline.o : SAE_PAR
sup_cmdline.o : DAT_PAR
sup_cmdline.o : SUBPAR_ERR
sup_cmdline.o : SUBPAR_PAR
sup_cmdline.o : ADAM_DEFNS
sup_cmdline.o : LEX_ERR
sup_cmdline.o : LEX_PAR
sup_cmdline.o : SUBPAR_CMN
sup_cmdline.o : SUBPAR_SYS

sup_cmdpar.o : SAE_PAR
sup_cmdpar.o : SUBPAR_ERR
sup_cmdpar.o : SUBPAR_PAR
sup_cmdpar.o : LEX_ERR
sup_cmdpar.o : LEX_PAR
sup_cmdpar.o : DAT_PAR
sup_cmdpar.o : SUBPAR_CMN
sup_cmdpar.o : SUBPAR_SYS

sup_convals.o : SAE_PAR
sup_convals.o : SUBPAR_PAR
sup_convals.o : DAT_PAR
sup_convals.o : SUBPAR_CMN
sup_convals.o : SUBPAR_SYS

sup_creat.o : SAE_PAR
sup_creat.o : DAT_ERR
sup_creat.o : DAT_PAR
sup_creat.o : SUBPAR_CMN
sup_creat.o : SUBPAR_SYS

sup_credyn.o : SAE_PAR
sup_credyn.o : SUBPAR_PAR
sup_credyn.o : DAT_ERR
sup_credyn.o : DAT_PAR
sup_credyn.o : SUBPAR_CMN
sup_credyn.o : SUBPAR_SYS

sup_crint.o : SAE_PAR
sup_crint.o : SUBPAR_PAR
sup_crint.o : DAT_ERR
sup_crint.o : DAT_PAR
sup_crint.o : SUBPAR_CMN
sup_crint.o : SUBPAR_SYS

sup_ctype.o : SAE_PAR
sup_ctype.o : SUBPAR_PAR

sup_curloc.o : SAE_PAR
sup_curloc.o : SUBPAR_PAR
sup_curloc.o : DAT_PAR
sup_curloc.o : SUBPAR_CMN
sup_curloc.o : SUBPAR_SYS

sup_curname.o : SAE_PAR
sup_curname.o : DAT_PAR
sup_curname.o : SUBPAR_CMN
sup_curname.o : SUBPAR_SYS

sup_cursav.o : SAE_PAR
sup_cursav.o : SUBPAR_PAR
sup_cursav.o : DAT_PAR
sup_cursav.o : SUBPAR_CMN
sup_cursav.o : SUBPAR_SYS

sup_curval.o : SAE_PAR
sup_curval.o : DAT_PAR
sup_curval.o : SUBPAR_CMN
sup_curval.o : SUBPAR_SYS

sup_datdef.o : SAE_PAR
sup_datdef.o : SUBPAR_ERR
sup_datdef.o : DAT_PAR
sup_datdef.o : SUBPAR_CMN
sup_datdef.o : SUBPAR_SYS

sup_datfind.o : SAE_PAR

sup_deact.o : SAE_PAR
sup_deact.o : SUBPAR_PAR
sup_deact.o : DAT_ERR
sup_deact.o : DAT_PAR
sup_deact.o : SUBPAR_CMN
sup_deact.o : SUBPAR_SYS

sup_def0c.o : SAE_PAR

sup_def0d.o : SAE_PAR

sup_def0i.o : SAE_PAR

sup_def0l.o : SAE_PAR

sup_def0r.o : SAE_PAR

sup_def1c.o : SAE_PAR
sup_def1c.o : SUBPAR_PAR
sup_def1c.o : SUBPAR_ERR
sup_def1c.o : DAT_PAR
sup_def1c.o : SUBPAR_CMN
sup_def1c.o : SUBPAR_SYS

sup_def1d.o : SAE_PAR
sup_def1d.o : SUBPAR_PAR
sup_def1d.o : SUBPAR_ERR
sup_def1d.o : DAT_PAR
sup_def1d.o : SUBPAR_CMN
sup_def1d.o : SUBPAR_SYS

sup_def1i.o : SAE_PAR
sup_def1i.o : SUBPAR_PAR
sup_def1i.o : SUBPAR_ERR
sup_def1i.o : DAT_PAR
sup_def1i.o : SUBPAR_CMN
sup_def1i.o : SUBPAR_SYS

sup_def1l.o : SAE_PAR
sup_def1l.o : SUBPAR_PAR
sup_def1l.o : SUBPAR_ERR
sup_def1l.o : DAT_PAR
sup_def1l.o : SUBPAR_CMN
sup_def1l.o : SUBPAR_SYS

sup_def1r.o : SAE_PAR
sup_def1r.o : SUBPAR_PAR
sup_def1r.o : SUBPAR_ERR
sup_def1r.o : DAT_PAR
sup_def1r.o : SUBPAR_CMN
sup_def1r.o : SUBPAR_SYS

sup_defnc.o : SAE_PAR
sup_defnc.o : SUBPAR_PAR
sup_defnc.o : DAT_PAR
sup_defnc.o : SUBPAR_CMN
sup_defnc.o : SUBPAR_SYS

sup_defnd.o : SAE_PAR
sup_defnd.o : SUBPAR_PAR
sup_defnd.o : DAT_PAR
sup_defnd.o : SUBPAR_CMN
sup_defnd.o : SUBPAR_SYS

sup_defni.o : SAE_PAR
sup_defni.o : SUBPAR_PAR
sup_defni.o : DAT_PAR
sup_defni.o : SUBPAR_CMN
sup_defni.o : SUBPAR_SYS

sup_defnl.o : SAE_PAR
sup_defnl.o : SUBPAR_PAR
sup_defnl.o : DAT_PAR
sup_defnl.o : SUBPAR_CMN
sup_defnl.o : SUBPAR_SYS

sup_defnr.o : SAE_PAR
sup_defnr.o : SUBPAR_PAR
sup_defnr.o : DAT_PAR
sup_defnr.o : SUBPAR_CMN
sup_defnr.o : SUBPAR_SYS

sup_delet.o : SAE_PAR
sup_delet.o : DAT_ERR
sup_delet.o : DAT_PAR
sup_delet.o : SUBPAR_CMN
sup_delet.o : SUBPAR_SYS

sup_eflsh.o : SAE_PAR
sup_eflsh.o : EMS_PAR

sup_enquote.o : SAE_PAR
sup_enquote.o : SUBPAR_ERR

sup_exhandler.o : SAE_PAR

sup_exist.o : SAE_PAR
sup_exist.o : SUBPAR_PARERR
sup_exist.o : DAT_ERR
sup_exist.o : DAT_PAR
sup_exist.o : SUBPAR_CMN
sup_exist.o : SUBPAR_SYS

sup_fetchc.o : SAE_PAR
sup_fetchc.o : SUBPAR_PARERR
sup_fetchc.o : SUBPAR_PAR
sup_fetchc.o : DAT_PAR
sup_fetchc.o : SUBPAR_CMN
sup_fetchc.o : SUBPAR_SYS

sup_fetchd.o : SAE_PAR
sup_fetchd.o : SUBPAR_PARERR
sup_fetchd.o : SUBPAR_PAR
sup_fetchd.o : DAT_PAR
sup_fetchd.o : SUBPAR_CMN
sup_fetchd.o : SUBPAR_SYS

sup_fetchi.o : SAE_PAR
sup_fetchi.o : SUBPAR_PARERR
sup_fetchi.o : SUBPAR_PAR
sup_fetchi.o : DAT_PAR
sup_fetchi.o : SUBPAR_CMN
sup_fetchi.o : SUBPAR_SYS

sup_fetchl.o : SAE_PAR
sup_fetchl.o : SUBPAR_PARERR
sup_fetchl.o : SUBPAR_PAR
sup_fetchl.o : DAT_PAR
sup_fetchl.o : SUBPAR_CMN
sup_fetchl.o : SUBPAR_SYS

sup_fetchr.o : SAE_PAR
sup_fetchr.o : SUBPAR_PARERR
sup_fetchr.o : SUBPAR_PAR
sup_fetchr.o : DAT_PAR
sup_fetchr.o : SUBPAR_CMN
sup_fetchr.o : SUBPAR_SYS

sup_findact.o : SAE_PAR
sup_findact.o : SUBPAR_ERR
sup_findact.o : DAT_PAR
sup_findact.o : SUBPAR_CMN
sup_findact.o : SUBPAR_SYS

sup_findhds.o : SAE_PAR
sup_findhds.o : SUBPAR_PARERR
sup_findhds.o : SUBPAR_ERR
sup_findhds.o : SUBPAR_PAR
sup_findhds.o : DAT_PAR
sup_findhds.o : SUBPAR_CMN
sup_findhds.o : SUBPAR_SYS

sup_findkey.o : SAE_PAR
sup_findkey.o : DAT_PAR
sup_findkey.o : SUBPAR_PAR
sup_findkey.o : SUBPAR_ERR
sup_findkey.o : SUBPAR_CMN
sup_findkey.o : SUBPAR_SYS

sup_findpar.o : SAE_PAR
sup_findpar.o : SUBPAR_ERR
sup_findpar.o : DAT_PAR
sup_findpar.o : SUBPAR_CMN
sup_findpar.o : SUBPAR_SYS

sup_fprompt.o : SAE_PAR
sup_fprompt.o : SUBPAR_PAR
sup_fprompt.o : DAT_PAR
sup_fprompt.o : SUBPAR_CMN
sup_fprompt.o : SUBPAR_SYS

sup_get.o : SAE_PAR
sup_get.o : SUBPAR_PAR
sup_get.o : SUBPAR_PARERR
sup_get.o : DAT_PAR
sup_get.o : SUBPAR_CMN
sup_get.o : SUBPAR_SYS

sup_get0c.o : SAE_PAR
sup_get0c.o : DAT_PAR
sup_get0c.o : SUBPAR_PAR
sup_get0c.o : SUBPAR_ERR
sup_get0c.o : SUBPAR_PARERR
sup_get0c.o : SUBPAR_CMN
sup_get0c.o : SUBPAR_SYS

sup_get0d.o : SAE_PAR
sup_get0d.o : DAT_PAR
sup_get0d.o : SUBPAR_PAR
sup_get0d.o : SUBPAR_ERR
sup_get0d.o : SUBPAR_PARERR
sup_get0d.o : EMS_PAR
sup_get0d.o : SUBPAR_CMN
sup_get0d.o : SUBPAR_SYS

sup_get0i.o : SAE_PAR
sup_get0i.o : DAT_PAR
sup_get0i.o : SUBPAR_PAR
sup_get0i.o : SUBPAR_ERR
sup_get0i.o : SUBPAR_PARERR
sup_get0i.o : SUBPAR_CMN
sup_get0i.o : SUBPAR_SYS

sup_get0l.o : SAE_PAR
sup_get0l.o : DAT_PAR
sup_get0l.o : SUBPAR_PAR
sup_get0l.o : SUBPAR_ERR
sup_get0l.o : SUBPAR_PARERR
sup_get0l.o : SUBPAR_CMN
sup_get0l.o : SUBPAR_SYS

sup_get0r.o : SAE_PAR
sup_get0r.o : DAT_PAR
sup_get0r.o : SUBPAR_PAR
sup_get0r.o : SUBPAR_ERR
sup_get0r.o : SUBPAR_PARERR
sup_get0r.o : SUBPAR_CMN
sup_get0r.o : SUBPAR_SYS

sup_get1c.o : SAE_PAR
sup_get1c.o : DAT_PAR
sup_get1c.o : SUBPAR_PAR
sup_get1c.o : SUBPAR_ERR
sup_get1c.o : SUBPAR_PARERR
sup_get1c.o : SUBPAR_CMN
sup_get1c.o : SUBPAR_SYS

sup_get1d.o : SAE_PAR
sup_get1d.o : DAT_PAR
sup_get1d.o : SUBPAR_PAR
sup_get1d.o : SUBPAR_ERR
sup_get1d.o : SUBPAR_PARERR
sup_get1d.o : SUBPAR_CMN
sup_get1d.o : SUBPAR_SYS

sup_get1i.o : SAE_PAR
sup_get1i.o : DAT_PAR
sup_get1i.o : SUBPAR_PAR
sup_get1i.o : SUBPAR_ERR
sup_get1i.o : SUBPAR_PARERR
sup_get1i.o : SUBPAR_CMN
sup_get1i.o : SUBPAR_SYS

sup_get1l.o : SAE_PAR
sup_get1l.o : DAT_PAR
sup_get1l.o : SUBPAR_PAR
sup_get1l.o : SUBPAR_ERR
sup_get1l.o : SUBPAR_PARERR
sup_get1l.o : SUBPAR_CMN
sup_get1l.o : SUBPAR_SYS

sup_get1r.o : SAE_PAR
sup_get1r.o : DAT_PAR
sup_get1r.o : SUBPAR_PAR
sup_get1r.o : SUBPAR_ERR
sup_get1r.o : SUBPAR_PARERR
sup_get1r.o : SUBPAR_CMN
sup_get1r.o : SUBPAR_SYS

sup_getfloc.o : SAE_PAR
sup_getfloc.o : SUBPAR_ERR
sup_getfloc.o : DAT_PAR
sup_getfloc.o : SUBPAR_CMN
sup_getfloc.o : SUBPAR_SYS

sup_gethds.o : SAE_PAR
sup_gethds.o : SUBPAR_PAR
sup_gethds.o : DAT_PAR
sup_gethds.o : SUBPAR_CMN
sup_gethds.o : SUBPAR_SYS

sup_getkey.o : SAE_PAR
sup_getkey.o : DAT_PAR
sup_getkey.o : SUBPAR_CMN
sup_getkey.o : SUBPAR_SYS

sup_getloc.o : SAE_PAR
sup_getloc.o : SUBPAR_ERR
sup_getloc.o : DAT_PAR
sup_getloc.o : SUBPAR_CMN
sup_getloc.o : SUBPAR_SYS

sup_getnc.o : SAE_PAR
sup_getnc.o : DAT_PAR
sup_getnc.o : SUBPAR_PAR
sup_getnc.o : SUBPAR_ERR
sup_getnc.o : SUBPAR_PARERR
sup_getnc.o : SUBPAR_CMN
sup_getnc.o : SUBPAR_SYS

sup_getnd.o : SAE_PAR
sup_getnd.o : DAT_PAR
sup_getnd.o : SUBPAR_PAR
sup_getnd.o : SUBPAR_ERR
sup_getnd.o : SUBPAR_PARERR
sup_getnd.o : SUBPAR_CMN
sup_getnd.o : SUBPAR_SYS

sup_getni.o : SAE_PAR
sup_getni.o : DAT_PAR
sup_getni.o : SUBPAR_PAR
sup_getni.o : SUBPAR_ERR
sup_getni.o : SUBPAR_PARERR
sup_getni.o : SUBPAR_CMN
sup_getni.o : SUBPAR_SYS

sup_getnl.o : SAE_PAR
sup_getnl.o : DAT_PAR
sup_getnl.o : SUBPAR_PAR
sup_getnl.o : SUBPAR_ERR
sup_getnl.o : SUBPAR_PARERR
sup_getnl.o : SUBPAR_CMN
sup_getnl.o : SUBPAR_SYS

sup_getnr.o : SAE_PAR
sup_getnr.o : DAT_PAR
sup_getnr.o : SUBPAR_PAR
sup_getnr.o : SUBPAR_ERR
sup_getnr.o : SUBPAR_PARERR
sup_getnr.o : SUBPAR_CMN
sup_getnr.o : SUBPAR_SYS

sup_getname.o : SAE_PAR
sup_getname.o : SUBPAR_PARERR
sup_getname.o : SUBPAR_ERR
sup_getname.o : DAT_ERR
sup_getname.o : SUBPAR_PAR
sup_getname.o : DAT_PAR
sup_getname.o : SUBPAR_CMN
sup_getname.o : SUBPAR_SYS

sup_getvc.o : SAE_PAR
sup_getvc.o : DAT_PAR
sup_getvc.o : SUBPAR_PAR
sup_getvc.o : SUBPAR_ERR
sup_getvc.o : SUBPAR_PARERR
sup_getvc.o : SUBPAR_CMN
sup_getvc.o : SUBPAR_SYS

sup_getvd.o : SAE_PAR
sup_getvd.o : DAT_PAR
sup_getvd.o : SUBPAR_PAR
sup_getvd.o : SUBPAR_ERR
sup_getvd.o : SUBPAR_PARERR
sup_getvd.o : SUBPAR_CMN
sup_getvd.o : SUBPAR_SYS

sup_getvi.o : SAE_PAR
sup_getvi.o : DAT_PAR
sup_getvi.o : SUBPAR_PAR
sup_getvi.o : SUBPAR_ERR
sup_getvi.o : SUBPAR_PARERR
sup_getvi.o : SUBPAR_CMN
sup_getvi.o : SUBPAR_SYS

sup_getvl.o : SAE_PAR
sup_getvl.o : DAT_PAR
sup_getvl.o : SUBPAR_PAR
sup_getvl.o : SUBPAR_ERR
sup_getvl.o : SUBPAR_PARERR
sup_getvl.o : SUBPAR_CMN
sup_getvl.o : SUBPAR_SYS

sup_getvr.o : SAE_PAR
sup_getvr.o : DAT_PAR
sup_getvr.o : SUBPAR_PAR
sup_getvr.o : SUBPAR_ERR
sup_getvr.o : SUBPAR_PARERR
sup_getvr.o : SUBPAR_CMN
sup_getvr.o : SUBPAR_SYS

sup_hdsarr.o : SAE_PAR
sup_hdsarr.o : SUBPAR_ERR

sup_hdsass.o : SAE_PAR
sup_hdsass.o : SUBPAR_PAR
sup_hdsass.o : DAT_PAR
sup_hdsass.o : SUBPAR_CMN
sup_hdsass.o : SUBPAR_SYS

sup_hdsdef.o : SAE_PAR
sup_hdsdef.o : SUBPAR_ERR
sup_hdsdef.o : SUBPAR_PAR
sup_hdsdef.o : SUBPAR_PARERR
sup_hdsdef.o : DAT_PAR
sup_hdsdef.o : SUBPAR_CMN
sup_hdsdef.o : SUBPAR_SYS

sup_hdsdyn.o : SAE_PAR
sup_hdsdyn.o : SUBPAR_ERR
sup_hdsdyn.o : SUBPAR_PAR
sup_hdsdyn.o : DAT_PAR
sup_hdsdyn.o : SUBPAR_CMN
sup_hdsdyn.o : SUBPAR_SYS

sup_hdsin.o : SAE_PAR
sup_hdsin.o : SUBPAR_ERR
sup_hdsin.o : SUBPAR_PAR
sup_hdsin.o : LEX_ERR
sup_hdsin.o : LEX_PAR
sup_hdsin.o : DAT_PAR
sup_hdsin.o : SUBPAR_CMN
sup_hdsin.o : SUBPAR_SYS

sup_gref.o : SAE_PAR
sup_gref.o : DAT_PAR
sup_gref.o : SUBPAR_PAR

sup_hdslocs.o : SAE_PAR

sup_hdsopen.o : SAE_PAR
sup_hdsopen.o : EMS_PAR

sup_hlpex.o : SAE_PAR

sup_index.o : SAE_PAR
sup_index.o : DAT_PAR
sup_index.o : SUBPAR_CMN
sup_index.o : SUBPAR_SYS

sup_init.o : SAE_PAR
sup_init.o : DAT_PAR
sup_init.o : SUBPAR_CMN
sup_init.o : SUBPAR_SYS
sup_init.o : SUBPAR_PAR

sup_input.o : SAE_PAR
sup_input.o : SUBPAR_PAR
sup_input.o : SUBPAR_PARERR
sup_input.o : DAT_PAR
sup_input.o : SUBPAR_CMN
sup_input.o : SUBPAR_SYS

sup_intloc.o : SAE_PAR
sup_intloc.o : SUBPAR_PAR
sup_intloc.o : DAT_PAR
sup_intloc.o : SUBPAR_CMN
sup_intloc.o : SUBPAR_SYS

sup_iput.o : SAE_PAR
sup_iput.o : DAT_PAR
sup_iput.o : SUBPAR_CMN
sup_iput.o : SUBPAR_SYS

sup_keyreq.o : SAE_PAR
sup_keyreq.o : DAT_PAR
sup_keyreq.o : SUBPAR_PARERR
sup_keyreq.o : MESSYS_PAR
sup_keyreq.o : MESSYS_ERR
sup_keyreq.o : SUBPAR_CMN

sup_ldifc0.o : SAE_PAR
sup_ldifc0.o : SUBPAR_ERR
sup_ldifc0.o : DAT_PAR
sup_ldifc0.o : SUBPAR_CMN
sup_ldifc0.o : SUBPAR_SYS

sup_ldifc1.o : SAE_PAR
sup_ldifc1.o : SUBPAR_ERR
sup_ldifc1.o : DAT_PAR
sup_ldifc1.o : SUBPAR_CMN
sup_ldifc1.o : SUBPAR_SYS

sup_limitc.o : SAE_PAR
sup_limitc.o : SUBPAR_PAR
sup_limitc.o : SUBPAR_ERR
sup_limitc.o : DAT_PAR
sup_limitc.o : SUBPAR_CMN
sup_limitc.o : SUBPAR_SYS

sup_limitd.o : SAE_PAR
sup_limitd.o : SUBPAR_PAR
sup_limitd.o : SUBPAR_ERR
sup_limitd.o : DAT_PAR
sup_limitd.o : SUBPAR_CMN
sup_limitd.o : SUBPAR_SYS

sup_limiti.o : SAE_PAR
sup_limiti.o : SUBPAR_PAR
sup_limiti.o : SUBPAR_ERR
sup_limiti.o : DAT_PAR
sup_limiti.o : SUBPAR_CMN
sup_limiti.o : SUBPAR_SYS

sup_limitr.o : SAE_PAR
sup_limitr.o : SUBPAR_PAR
sup_limitr.o : SUBPAR_ERR
sup_limitr.o : DAT_PAR
sup_limitr.o : SUBPAR_CMN
sup_limitr.o : SUBPAR_SYS

sup_loadifc.o : SAE_PAR
sup_loadifc.o : SUBPAR_ERR
sup_loadifc.o : DAT_PAR
sup_loadifc.o : SUBPAR_CMN
sup_loadifc.o : SUBPAR_SYS

sup_maxc.o : SAE_PAR
sup_maxc.o : DAT_PAR
sup_maxc.o : SUBPAR_PAR
sup_maxc.o : SUBPAR_ERR
sup_maxc.o : SUBPAR_CMN
sup_maxc.o : SUBPAR_SYS

sup_maxd.o : SAE_PAR
sup_maxd.o : DAT_PAR
sup_maxd.o : SUBPAR_PAR
sup_maxd.o : SUBPAR_ERR
sup_maxd.o : SUBPAR_CMN
sup_maxd.o : SUBPAR_SYS

sup_maxi.o : SAE_PAR
sup_maxi.o : DAT_PAR
sup_maxi.o : SUBPAR_PAR
sup_maxi.o : SUBPAR_ERR
sup_maxi.o : SUBPAR_CMN
sup_maxi.o : SUBPAR_SYS

sup_maxr.o : SAE_PAR
sup_maxr.o : DAT_PAR
sup_maxr.o : SUBPAR_PAR
sup_maxr.o : SUBPAR_ERR
sup_maxr.o : SUBPAR_CMN
sup_maxr.o : SUBPAR_SYS

sup_minc.o : SAE_PAR
sup_minc.o : DAT_PAR
sup_minc.o : SUBPAR_PAR
sup_minc.o : SUBPAR_ERR
sup_minc.o : SUBPAR_CMN
sup_minc.o : SUBPAR_SYS

sup_mind.o : SAE_PAR
sup_mind.o : DAT_PAR
sup_mind.o : SUBPAR_PAR
sup_mind.o : SUBPAR_ERR
sup_mind.o : SUBPAR_CMN
sup_mind.o : SUBPAR_SYS

sup_mini.o : SAE_PAR
sup_mini.o : DAT_PAR
sup_mini.o : SUBPAR_PAR
sup_mini.o : SUBPAR_ERR
sup_mini.o : SUBPAR_CMN
sup_mini.o : SUBPAR_SYS

sup_minr.o : SAE_PAR
sup_minr.o : DAT_PAR
sup_minr.o : SUBPAR_PAR
sup_minr.o : SUBPAR_ERR
sup_minr.o : SUBPAR_CMN
sup_minr.o : SUBPAR_SYS

sup_mkdir.o : sae_par.h
sup_mkdir.o : ems.h
sup_mkdir.o : ems_par.h

sup_mlith.o : SAE_PAR
sup_mlith.o : DAT_PAR
sup_mlith.o : SUBPAR_CMN
sup_mlith.o : SUBPAR_SYS

sup_mnmx.o : SAE_PAR
sup_mnmx.o : DAT_PAR
sup_mnmx.o : SUBPAR_PAR
sup_mnmx.o : SUBPAR_ERR
sup_mnmx.o : SUBPAR_CMN
sup_mnmx.o : SUBPAR_SYS

sup_nameass.o : SAE_PAR
sup_nameass.o : DAT_PAR
sup_nameass.o : SUBPAR_CMN
sup_nameass.o : SUBPAR_SYS

sup_nametr.o : SAE_PAR

sup_openifc.o : SAE_PAR
sup_openifc.o : SUBPAR_ERR
sup_openifc.o : sup_openifc.f
	$(TAR_OUT) $(PKG_NAME)_source.tar $<
	case $(SYSTEM) in\
        alpha_OSF1 | mips);;\
        *) mv $< tmp;\
           sed s/READONLY,// tmp > $<;\
           rm tmp;;\
        esac
	$(FC) $(FFLAGS) -c $<

sup_oput.o : SAE_PAR
sup_oput.o : SUBPAR_PAR

sup_pargp.o : SAE_PAR
sup_pargp.o : DAT_PAR

sup_parname.o : SAE_PAR
sup_parname.o : SUBPAR_ERR
sup_parname.o : DAT_PAR
sup_parname.o : SUBPAR_CMN
sup_parname.o : SUBPAR_SYS

sup_partype.o : SAE_PAR
sup_partype.o : SUBPAR_ERR
sup_partype.o : SUBPAR_PAR
sup_partype.o : DAT_PAR
sup_partype.o : SUBPAR_CMN
sup_partype.o : SUBPAR_SYS

sup_promptcl.o : SAE_PAR
sup_promptcl.o : SUBPAR_PARERR
sup_promptcl.o : MESSYS_PAR
sup_promptcl.o : MESSYS_ERR
sup_promptcl.o : DAT_PAR
sup_promptcl.o : SUBPAR_CMN
sup_promptcl.o : SUBPAR_SYS

sup_promt.o : SAE_PAR
sup_promt.o : DAT_PAR
sup_promt.o : SUBPAR_CMN
sup_promt.o : SUBPAR_SYS

sup_put.o : SAE_PAR

sup_put0c.o : SAE_PAR
sup_put0c.o : SUBPAR_PAR
sup_put0c.o : SUBPAR_ERR
sup_put0c.o : DAT_PAR
sup_put0c.o : SUBPAR_CMN
sup_put0c.o : SUBPAR_SYS

sup_put0d.o : SAE_PAR
sup_put0d.o : SUBPAR_PAR
sup_put0d.o : SUBPAR_ERR
sup_put0d.o : DAT_PAR
sup_put0d.o : SUBPAR_CMN
sup_put0d.o : SUBPAR_SYS

sup_put0i.o : SAE_PAR
sup_put0i.o : SUBPAR_PAR
sup_put0i.o : SUBPAR_ERR
sup_put0i.o : DAT_PAR
sup_put0i.o : SUBPAR_CMN
sup_put0i.o : SUBPAR_SYS

sup_put0l.o : SAE_PAR
sup_put0l.o : SUBPAR_PAR
sup_put0l.o : SUBPAR_ERR
sup_put0l.o : DAT_PAR
sup_put0l.o : SUBPAR_CMN
sup_put0l.o : SUBPAR_SYS

sup_put0r.o : SAE_PAR
sup_put0r.o : SUBPAR_PAR
sup_put0r.o : SUBPAR_ERR
sup_put0r.o : DAT_PAR
sup_put0r.o : SUBPAR_CMN
sup_put0r.o : SUBPAR_SYS

sup_put1.o : SAE_PAR
sup_put1.o : SUBPAR_PAR
sup_put1.o : SUBPAR_ERR
sup_put1.o : DAT_PAR
sup_put1.o : SUBPAR_CMN
sup_put1.o : SUBPAR_SYS

sup_put1.o : SAE_PAR
sup_put1.o : SUBPAR_PAR
sup_put1.o : SUBPAR_ERR
sup_put1.o : DAT_PAR
sup_put1.o : SUBPAR_CMN
sup_put1.o : SUBPAR_SYS

sup_put1c.o : SAE_PAR
sup_put1c.o : SUBPAR_PAR
sup_put1c.o : SUBPAR_ERR
sup_put1c.o : DAT_PAR
sup_put1c.o : SUBPAR_CMN
sup_put1c.o : SUBPAR_SYS

sup_put1d.o : SAE_PAR
sup_put1d.o : SUBPAR_PAR
sup_put1d.o : SUBPAR_ERR
sup_put1d.o : DAT_PAR
sup_put1d.o : SUBPAR_CMN
sup_put1d.o : SUBPAR_SYS

sup_put1i.o : SAE_PAR
sup_put1i.o : SUBPAR_PAR
sup_put1i.o : SUBPAR_ERR
sup_put1i.o : DAT_PAR
sup_put1i.o : SUBPAR_CMN
sup_put1i.o : SUBPAR_SYS

sup_put1l.o : SAE_PAR
sup_put1l.o : SUBPAR_PAR
sup_put1l.o : SUBPAR_ERR
sup_put1l.o : DAT_PAR
sup_put1l.o : SUBPAR_CMN
sup_put1l.o : SUBPAR_SYS

sup_put1r.o : SAE_PAR
sup_put1r.o : SUBPAR_PAR
sup_put1r.o : SUBPAR_ERR
sup_put1r.o : DAT_PAR
sup_put1r.o : SUBPAR_CMN
sup_put1r.o : SUBPAR_SYS

sup_putfloc.o : SAE_PAR
sup_putfloc.o : SUBPAR_ERR
sup_putfloc.o : DAT_PAR
sup_putfloc.o : SUBPAR_CMN
sup_putfloc.o : SUBPAR_SYS

sup_putloc.o : SAE_PAR
sup_putloc.o : SUBPAR_ERR
sup_putloc.o : DAT_PAR
sup_putloc.o : SUBPAR_CMN
sup_putloc.o : SUBPAR_SYS

sup_putnc.o : SAE_PAR
sup_putnc.o : SUBPAR_PAR
sup_putnc.o : SUBPAR_ERR
sup_putnc.o : DAT_PAR
sup_putnc.o : SUBPAR_CMN
sup_putnc.o : SUBPAR_SYS

sup_putnd.o : SAE_PAR
sup_putnd.o : SUBPAR_PAR
sup_putnd.o : SUBPAR_ERR
sup_putnd.o : DAT_PAR
sup_putnd.o : SUBPAR_CMN
sup_putnd.o : SUBPAR_SYS

sup_putni.o : SAE_PAR
sup_putni.o : SUBPAR_PAR
sup_putni.o : SUBPAR_ERR
sup_putni.o : DAT_PAR
sup_putni.o : SUBPAR_CMN
sup_putni.o : SUBPAR_SYS

sup_putnl.o : SAE_PAR
sup_putnl.o : SUBPAR_PAR
sup_putnl.o : SUBPAR_ERR
sup_putnl.o : DAT_PAR
sup_putnl.o : SUBPAR_CMN
sup_putnl.o : SUBPAR_SYS

sup_putnr.o : SAE_PAR
sup_putnr.o : SUBPAR_PAR
sup_putnr.o : SUBPAR_ERR
sup_putnr.o : DAT_PAR
sup_putnr.o : SUBPAR_CMN
sup_putnr.o : SUBPAR_SYS

sup_putname.o : SAE_PAR
sup_putname.o : SUBPAR_PAR
sup_putname.o : DAT_PAR
sup_putname.o : SUBPAR_CMN
sup_putname.o : SUBPAR_SYS

sup_putpath.o : SAE_PAR
sup_putpath.o : DAT_PAR
sup_putpath.o : SUBPAR_CMN
sup_putpath.o : SUBPAR_SYS

sup_putvc.o : SAE_PAR
sup_putvc.o : SUBPAR_PAR
sup_putvc.o : SUBPAR_ERR
sup_putvc.o : DAT_PAR
sup_putvc.o : SUBPAR_CMN
sup_putvc.o : SUBPAR_SYS

sup_putvd.o : SAE_PAR
sup_putvd.o : SUBPAR_PAR
sup_putvd.o : SUBPAR_ERR
sup_putvd.o : DAT_PAR
sup_putvd.o : SUBPAR_CMN
sup_putvd.o : SUBPAR_SYS

sup_putvi.o : SAE_PAR
sup_putvi.o : SUBPAR_PAR
sup_putvi.o : SUBPAR_ERR
sup_putvi.o : DAT_PAR
sup_putvi.o : SUBPAR_CMN
sup_putvi.o : SUBPAR_SYS

sup_putvl.o : SAE_PAR
sup_putvl.o : SUBPAR_PAR
sup_putvl.o : SUBPAR_ERR
sup_putvl.o : DAT_PAR
sup_putvl.o : SUBPAR_CMN
sup_putvl.o : SUBPAR_SYS

sup_putvr.o : SAE_PAR
sup_putvr.o : SUBPAR_PAR
sup_putvr.o : SUBPAR_ERR
sup_putvr.o : DAT_PAR
sup_putvr.o : SUBPAR_CMN
sup_putvr.o : SUBPAR_SYS

sup_pwhlp.o : SAE_PAR
sup_pwhlp.o : SUBPAR_ERR
sup_pwhlp.o : DAT_PAR
sup_pwhlp.o : SUBPAR_CMN
sup_pwhlp.o : SUBPAR_SYS

sup_rangec.o : SAE_PAR
sup_rangec.o : DAT_PAR
sup_rangec.o : SUBPAR_PAR
sup_rangec.o : SUBPAR_ERR
sup_rangec.o : SUBPAR_CMN
sup_rangec.o : SUBPAR_SYS

sup_ranged.o : SAE_PAR
sup_ranged.o : DAT_PAR
sup_ranged.o : SUBPAR_PAR
sup_ranged.o : SUBPAR_ERR
sup_ranged.o : SUBPAR_CMN
sup_ranged.o : SUBPAR_SYS

sup_rangei.o : SAE_PAR
sup_rangei.o : DAT_PAR
sup_rangei.o : SUBPAR_PAR
sup_rangei.o : SUBPAR_ERR
sup_rangei.o : SUBPAR_CMN
sup_rangei.o : SUBPAR_SYS

sup_ranger.o : SAE_PAR
sup_ranger.o : DAT_PAR
sup_ranger.o : SUBPAR_PAR
sup_ranger.o : SUBPAR_ERR
sup_ranger.o : SUBPAR_CMN
sup_ranger.o : SUBPAR_SYS

sup_rdif.o : SAE_PAR
sup_rdif.o : SUBPAR_ERR

sup_request.o : SAE_PAR
sup_request.o : SUBPAR_PARERR
sup_request.o : DAT_PAR
sup_request.o : SUBPAR_CMN
sup_request.o : SUBPAR_SYS

sup_reset.o : SAE_PAR
sup_reset.o : SUBPAR_PAR
sup_reset.o : DAT_PAR
sup_reset.o : SUBPAR_CMN
sup_reset.o : SUBPAR_SYS

sup_selhelp.o : SAE_PAR

sup_setcheck.o : SAE_PAR
sup_setcheck.o : DAT_PAR
sup_setcheck.o : SUBPAR_CMN
sup_setcheck.o : SUBPAR_SYS

sup_split.o : SAE_PAR
sup_split.o : DAT_ERR

sup_splitval.o : SAE_PAR

sup_state.o : SAE_PAR
sup_state.o : DAT_PAR
sup_state.o : SUBPAR_CMN
sup_state.o : SUBPAR_SYS

sup_store0.o : SAE_PAR
sup_store0.o : DAT_PAR
sup_store0.o : SUBPAR_ERR
sup_store0.o : SUBPAR_PAR
sup_store0.o : LEX_PAR
sup_store0.o : SUBPAR_CMN
sup_store0.o : SUBPAR_SYS

sup_sync.o : SAE_PAR
sup_sync.o : MESSYS_PAR
sup_sync.o : MESSYS_ERR
sup_sync.o : SUBPAR_PARERR
sup_sync.o : DAT_PAR
sup_sync.o : SUBPAR_CMN
sup_sync.o : SUBPAR_SYS

sup_termface.o : SAE_PAR
sup_termface.o : DAT_PAR
sup_termface.o : SUBPAR_CMN
sup_termface.o : SUBPAR_SYS

sup_unset.o : SAE_PAR
sup_unset.o : DAT_PAR
sup_unset.o : CHR_ERR
sup_unset.o : SUBPAR_ERR
sup_unset.o : SUBPAR_CMN
sup_unset.o : SUBPAR_SYS

sup_updat.o : SAE_PAR
sup_updat.o : SUBPAR_ERR
sup_updat.o : DAT_PAR
sup_updat.o : SUBPAR_CMN
sup_updat.o : SUBPAR_SYS

sup_valass.o : SAE_PAR
sup_valass.o : DAT_PAR
sup_valass.o : SUBPAR_CMN
sup_valass.o : SUBPAR_SYS

sup_wrhelp.o : SAE_PAR
sup_wrhelp.o : SUBPAR_ERR

sup_wrerr.o : SAE_PAR

sup_write.o : SAE_PAR
sup_write.o : SUBPAR_ERR
sup_write.o : SUBPAR_PARERR
sup_write.o : DAT_PAR
sup_write.o : SUBPAR_CMN
sup_write.o : SUBPAR_SYS
sup_write.o : MESSYS_PAR
sup_write.o : MESSYS_ERR

sup_wrmsg.o : SAE_PAR

sup_dexit.o : SAE_PAR


sup_fifil.o : sae_par.h
sup_fifil.o : f77.h
sup_fifil.o : cnf.h
sup_fifil.o : ems.h
sup_fifil.o : ems_par.h

sup_fname.o : SAE_PAR

sup_gtcmd.o : SAE_PAR

sup_pfer.o : SAE_PAR

sup_prompt.o : SAE_PAR
sup_prompt.o : SUBPAR_PARERR

sup_scrnsz.o : SAE_PAR

sup_trmsz.o : f77.h

sup_tsknm.o : SAE_PAR
sup_tsknm.o : SUBPAR_ERR

sup_vwhlp.o : SAE_PAR
sup_vwhlp.o : SUBPAR_ERR

#-------------------------------------------------------------------------------
#
#  End of makefile.
#.
