#+
#  Name:
#     makefile
#
#  Version:
#     Library makefile Mk IVc
#
#  Purpose:
#     Build and install the HDS package.
#
#  Type of Module:
#     Description file for the make utility.
#
#  Description:
#     This description file is used by the make utility to build the
#     HDS 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.
#
#  External Dependencies:
#     The HDS 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).
#        chr
#           Character handling routines
#        cnf
#           C <-> Fortran interface macros and routines
#        ems
#           Error message service
#        htx
#           Hypertext cross-reference utilities.
#        sae_par
#           Global include files
#
#  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)
#     {enter_new_authors_here}
#
#  History:
#     25-JUN-1991 (RFWS):
#        Original version.
#     6-JAN-1992 (RFWS):
#        Combined into single version for all UNIX systems.
#     25-AUG-1992 (RFWS):
#        Adapted to use new makefile template.
#     7-SEP-1992 (RFWS):
#        Added dat1_init_ndr and dat1_show_ndr routines.
#     10-SEP-1992 (RFWS):
#        Added rules, etc. for building the BUILD.LOG file.
#     11-SEP-1992 (RFWS):
#        Added dat1_annul_lcp.c routine.
#     23-SEP-1992 (RFWS):
#        Added rec_mark_delete.c routine.
#     25-SEP-1992 (RFWS):
#        Added dat1_import_loc.c, dat_prmry.c and dat_refct.c routines.
#     14-OCT-1992 (RFWS):
#        Added dat1_check_mode.c and dat1_alloc_lcp.c routines.
#     30-OCT-1992 (RFWS):
#        Added hds_wild, hds_ewild, rec_wild_file and rec_end_wild routines.
#     23-NOV-1993 (RFWS):
#        Added rec1_getcwd routine.
#     26-NOV-1992 (RFWS:
#        Added rec1_get_path, rec1_shell and rec1_find_file routines.
#     2-DEC-1992 (RFWS):
#        Updated to conform with the latest makefile template.
#     17-DEC-1992 (RFWS):
#        Further developments aimed at enhancing portability and
#        robustness.
#     19-DEC-1992 (RFWS):
#        Merged the functions of the BUILD.LOG and datestamp files.
#     22-DEC-1992 (RFWS):
#     	 Added the dat1_decoy routine.
#     7-JUL-1993 (RFWS):
#     	 Updated for alpha_OSF1 version.
#     7-JUL-1993 (RFWS):
#     	 Added generation of dat_par and dat_par.h by running programs.
#     26-JUN-1995 (RFWS):
#        Brought up to makefile Mk IVc standard.
#     26-JUN-1995 (RFWS):
#        Added handling of hypertext documentation.
#     10-JUL-1995 (RFWS):
#        Changed to leave copies of installed Latex documents in the source
#        directory, rather than using links to the installed files.
#     {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 and whether it is recognised.

SYSTEM = unknown
KNOWN = 0

#  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)

#  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 = HDS

#  Prefix for the package in lowercase as used in filenames etc.
PKG_NAME = hds

#  Prefix for the package in uppercase as used in include file links.
PKG_LINK = HDS

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

PKG_NUM_1 = 200
PKG_NUM_2 = 230

#  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 = 4.3-4

#  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 = 1.2

#  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 $(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 = cmp_err dat_err dat_par dat_par.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 = cmp_cct cmp_const dat1_sys dat1.h dat_err.h hds1.h \
hds1_feature.h rec.h rec1.h str.h

#  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 = EMS_PAR SAE_PAR cnf.h ems.h ems_par.h f77.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 = \
cmp_activ.f cmp_deact.f cmp_erdsn.f cmp_get0x.f cmp_get1x.f \
cmp_getnx.f cmp_getvx.f cmp_len.f cmp_mapn.f cmp_mapv.f \
cmp_mod.f cmp_modc.f cmp_prim.f cmp_put0x.f cmp_put1x.f \
cmp_putnx.f cmp_putvx.f cmp_shape.f cmp_size.f cmp_struc.f \
cmp_type.f cmp_unmap.f dat_ccopy.f dat_cctyp.f dat_erdsc.f \
dat_erdsn.f dat_ertxt.f dat_get0x.f dat_get1x.f dat_getnx.f \
dat_getvx.f dat_mapn.f dat_mapv.f dat_msg.f dat_new0.f \
dat_new0c.f dat_new0x.f dat_new1.f dat_new1c.f dat_new1x.f \
dat_newc.f dat_prec.f dat_put0x.f dat_put1x.f dat_putnx.f \
dat_putvx.f dat_rcera.f dat_rcopy.f dat_ref.f dat_tune.f

#  List of Fortran BLOCK DATA routines.

BLOCK_DATA = cmp_blk.f

#  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 = \
dat1_alloc_lcp.c dat1_annul_lcp.c dat1_check_mode.c dat1_check_type.c \
dat1_cvt_format.c dat1_cvt_order.c dat1_decoy.c dat1_get_ncomp.c \
dat1_get_odl.c dat1_getenv.c dat1_import_loc.c dat1_init.c \
dat1_init_ndr.c dat1_intune.c dat1_locate_name.c dat1_pack_crv.c \
dat1_pack_odl.c dat1_pack_srv.c dat1_put_ncomp.c dat1_put_odl.c \
dat1_show_ndr.c dat1_unpack_crv.c dat1_unpack_odl.c dat1_unpack_srv.c \
dat1_unpack_type.c dat_clen.c dat_copy.c dat_drep.c dat_ermsg.c \
dat_paren.c dat_prmry.c dat_refct.c dat_where.c datalter.c datannul.c \
daterase.c datfinind.c datget.c datinq.c datlocops.c datmap.c datmove.c \
datnew.c datput.c dattemp.c daucheck.c daucnv.c daucopy.c dauflush.c \
dauloc.c daumove.c dauscatgath.c daushape.c dautypes.c hds1_exit.c \
hds_copy.c hds_ewild.c hds_globals.c hds_gtune.c hds_run.c hds_start.c \
hds_state.c hds_stop.c hds_tune.c hds_wild.c hdserase.c hdsgroup.c \
hdslock.c hdsnew.c hdsnull.c hdsopclos.c hdstools.c rec1_alloc_frame.c \
rec1_clear_cbm.c rec1_close_file.c rec1_close_slot.c rec1_create_file.c \
rec1_deall_frame.c rec1_extend_file.c rec1_extend_frame.c rec1_find_file.c \
rec1_flush_block.c rec1_fmsg.c rec1_get_fid.c rec1_get_path.c \
rec1_getcwd.c rec1_locate_hcb.c rec1_lock_slot.c rec1_map_frame.c \
rec1_open_file.c rec1_pack_chain.c rec1_pack_hcb.c rec1_pack_ncomp.c \
rec1_pack_rcl.c rec1_read_file.c rec1_save_addr.c rec1_scan_cbm.c \
rec1_set_cbm.c rec1_shell.c rec1_test_cbm.c rec1_unlock_slot.c \
rec1_unmap_frame.c rec1_unpack_chain.c rec1_unpack_hcb.c rec1_unpack_ncomp.c \
rec1_unpack_rcl.c rec1_update_free.c rec1_write_file.c rec_adopt_record.c \
rec_alloc_mem.c rec_alloc_xmem.c rec_attach_file.c rec_close_file.c \
rec_create_record.c rec_deall_mem.c rec_deall_xmem.c rec_delete_record.c \
rec_end_wild.c rec_extend_record.c rec_get_handle.c rec_get_rcl.c \
rec_get_rid.c rec_list_files.c rec_locate_block.c rec_locate_data.c \
rec_locate_fns.c rec_lock.c rec_mark_delete.c rec_reall_mem.c \
rec_refcnt.c rec_release_block.c rec_release_data.c rec_reset_record.c \
rec_same_file.c rec_shrink_record.c rec_start.c rec_stop.c \
rec_unlock.c rec_where.c rec_wild_file.c rtl_fixups.c

#  The facility error file

FAC_ERRS = fac_$(PKG_NUM_1)_err fac_$(PKG_NUM_2)_err

#  Lists of Latex and hypertext documents.

LATEX_DOCS = sun92.tex
HYPERTEXT_DOCS = sun92.htx

#  List of documentation files.

DOCUMENTATION = $(LATEX_DOCS) $(HYPERTEXT_DOCS:.htx=.htx_tar) $(PKG_NAME).news

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

#  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) CMP_CCT CMP_CONST CMP_ERR DAT_ERR \
DAT_PAR DAT1_SYS

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

CMP_CCT:   cmp_cct;               $(LINK) $? $@
CMP_CONST: cmp_const;             $(LINK) $? $@
CMP_ERR:   cmp_err;               $(LINK) $? $@
DAT1_SYS:  dat1_sys;              $(LINK) $? $@
DAT_ERR:   dat_err;               $(LINK) $? $@
DAT_PAR:   dat_par;               $(LINK) $? $@
EMS_PAR:   $(STAR_INC)/ems_par;   $(LINK) $? $@
SAE_PAR:   $(STAR_INC)/sae_par;   $(LINK) $? $@
cnf.h:     $(STAR_INC)/cnf.h;     $(LINK) $? $@
ems.h:     $(STAR_INC)/ems.h;     $(LINK) $? $@
ems_par.h: $(STAR_INC)/ems_par.h; $(LINK) $? $@
f77.h:     $(STAR_INC)/f77.h;     $(LINK) $? $@

#  Rules for extracting source files from the source archive.
#  (Note that some include files are generated by running programs, so we
#  extract the source of these programs rather than the include files
#  themselves).

$(PUBLIC_SCRIPTS) cmp_err dat_err dat_par_f.c dat_par_h.c $(PRIVATE_INCLUDES) \
$(PKG_NAME)_machine.f \
$(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) $@

#  Rules for building include files from the programs used to generate them
#  (and the include files used by these programs).

dat_par: dat_par_f.c hds1_feature.h hds1.h rec.h dat1.h f77.h 
	$(CC) $(CFLAGS) dat_par_f.c -o dat_par_f
	./dat_par_f >dat_par
	rm -f dat_par_f

dat_par.h: dat_par_h.c hds1_feature.h hds1.h rec.h dat1.h f77.h 
	$(CC) $(CFLAGS) dat_par_h.c -o dat_par_h
	./dat_par_h >dat_par.h
	rm -f dat_par_h

#  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).a

lib$(PKG_NAME).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)$(SHARE)

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

#  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

#  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

#  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_DOCS) $(INSTALL_HELP) $(INSTALL_SHARE)

$(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) and also on any
#  software which generates information for the date stamp file.

.BUILT: $(BUILT_FILES) $(PKG_NAME)_machine.f
#
#  Build the program that produces machine specific information about
#  internal settings.
	$(FC) $(FFLAGS) $(PKG_NAME)_machine.f -L$(STAR_LIB) lib$(PKG_NAME).a \
              `$(STAR_BIN)/ems_link` `$(STAR_BIN)/chr_link` \
              `$(STAR_BIN)/cnf_link` -o $(PKG_NAME)_machine
#
#  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 '   KNOWN   : $(KNOWN)'        >>$(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)
#
#  Run the program to append information about HDS internal settings.
#  Then remove the program that generates this information and output a
#  warning message if building on an unknown platform.
	./$(PKG_NAME)_machine                 >>$(DATE_STAMP)
	rm -f $(PKG_NAME)_machine
	@ if test "$(KNOWN)" != "1"; then \
   echo '***************************************************************';\
   echo '';\
   echo '   If you are porting HDS to a new machine or compiler, please';\
   echo '   check the contents of the $(DATE_STAMP) file to ensure that';\
   echo '   the correct machine dependent settings have been used.';\
   echo '';\
   echo '   WARNING: Failure to ensure that these settings are correct';\
   echo '   could result in data files that cannot be read on other';\
   echo '   machines.';\
   echo '';\
   echo '***************************************************************';\
        else :; fi
#
#  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 facilty error files, giving them world read permission.
	for f in $(FAC_ERRS) ""; do \
           if test -n "$$f"; then \
              cp -p $$f $(INSTALL_HELP);\
              chmod 644 $(INSTALL_HELP)/$$f;\
              rm -f $$f;\
              $(LINK) $(INSTALL_HELP)/$$f $$f;\
           else :; fi;\
        done
#
#  Install the Latex documentation, giving it world read permission.
	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 the hypertext documents, giving world read access to all the files
#  they contain.
	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)
#
#  Link the hypertext.
	HTX_PATH='$(STAR_DOCS):$(STAR_HELP)';\
        export HTX_PATH;\
        $(STAR_BIN)/hlink $(INSTALL_DOCS) $(INSTALL_HELP)
#
#  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 files, if installed versions exist.
	- for f in $(FAC_ERRS) ""; do \
           if test -n "$$f" -a -f $(INSTALL_HELP)/$$f; then \
              rm -f $$f;\
              cp -p $(INSTALL_HELP)/$$f .;\
              rm -f $(INSTALL_HELP)/$$f;\
           else :; fi;\
        done
#
#  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 the hypertext documents.
	- 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
#
#  Relink the hypertext.
	HTX_PATH='$(STAR_DOCS):$(STAR_HELP)';\
        export HTX_PATH;\
        $(STAR_BIN)/hlink $(INSTALL_DOCS) $(INSTALL_HELP)
#
#  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;\
        elif $(MAKE) do_test; then\
           echo;\
           echo \
           '*** Installation test for the $(PACK_NAME) package has been run';\
           echo;\
        else \
           echo;\
           echo \
           '*** Installation test for the $(PACK_NAME) package failed';\
           echo;\
           exit 1;\
        fi

#  The do_test target performs the installation test. A file named do_test
#  should never exist.

do_test: $(EXTERNAL_INCLUDES)
#
#  Note the test has not yet succeeded.
	@- if test -f .TESTED_$(SYSTEM); then rm -f .TESTED_$(SYSTEM); else :; fi
#
#  Extract the test program from the archive and set up new links for
#  the include files which point at the installed versions.  Remove any
#  pre-existing links first if necessary.
	$(TAR_OUT) $(PKG_NAME)_source.tar $(PKG_NAME)_test.f
	@ if test -f $(PKG_NAME)_test.f; then :;\
           else echo $(PKG_NAME)_test.f is not in the tar file; exit 1; fi
	-$(INSTALL_BIN)/$(PKG_NAME)_dev remove
	$(INSTALL_BIN)/$(PKG_NAME)_dev
#
#  Build the test program, ensuring that the installed version of the library
#  and link files are used.
	$(FC) $(FFLAGS) $(PKG_NAME)_test.f -L$(INSTALL_LIB) -L$(STAR_LIB) \
              `$(INSTALL_BIN)/$(PKG_NAME)_link` -o $(PKG_NAME)_test
#
#  Remove the test program source and the include file links used to
#  build it.
	rm -f $(PKG_NAME)_test.f $(EXTERNAL_INCLUDES)
	$(INSTALL_BIN)/$(PKG_NAME)_dev remove
#
#  Execute the test program and remove the binary file when done.  Note
#  that any external mechanism for locating shareable libraries (e.g. a
#  search path) must previously have been set up.
	./$(PKG_NAME)_test
	rm -f $(PKG_NAME)_test
#
#  Note the test has been run.
	@ touch .TESTED_$(SYSTEM)

#  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) \
              $(PKG_NAME)_machine.f dat_par_h.c dat_par_f.c \
              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

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

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

#  Object file dependencies on include files (or links to those include
#  files).  These are normally generated automatically from the source
#  files.
  
dat1_alloc_lcp.o: dat1_alloc_lcp.c hds1_feature.h ems.h hds1.h rec.h \
 dat1.h f77.h dat_err.h
dat1_annul_lcp.o: dat1_annul_lcp.c hds1_feature.h ems.h hds1.h rec1.h \
 rec.h dat1.h f77.h dat_err.h
dat1_check_mode.o: dat1_check_mode.c hds1_feature.h ems.h hds1.h rec.h \
 dat1.h f77.h dat_err.h
dat1_check_type.o: dat1_check_type.c hds1_feature.h ems.h hds1.h rec.h \
 dat1.h f77.h dat_err.h
dat1_cvt_format.o: dat1_cvt_format.c hds1_feature.h ems.h hds1.h rec.h \
 dat1.h f77.h dat_err.h
dat1_cvt_order.o: dat1_cvt_order.c hds1_feature.h ems.h hds1.h rec.h \
 str.h dat1.h f77.h dat_err.h
dat1_decoy.o: dat1_decoy.c hds1_feature.h
dat1_get_ncomp.o: dat1_get_ncomp.c hds1_feature.h hds1.h rec.h rec1.h \
 dat_err.h
dat1_get_odl.o: dat1_get_odl.c hds1_feature.h hds1.h rec.h rec1.h \
 dat1.h f77.h dat_err.h
dat1_getenv.o: dat1_getenv.c hds1_feature.h
dat1_import_loc.o: dat1_import_loc.c hds1_feature.h ems.h hds1.h rec.h \
 dat1.h f77.h dat_err.h
dat1_init.o: dat1_init.c hds1_feature.h ems.h ems_par.h hds1.h rec.h \
 dat1.h f77.h dat_err.h
dat1_init_ndr.o: dat1_init_ndr.c hds1_feature.h hds1.h rec1.h rec.h \
 dat1.h f77.h dat_err.h ems.h ems_par.h
dat1_intune.o: dat1_intune.c hds1_feature.h hds1.h rec.h dat1.h f77.h \
 dat_err.h
dat1_locate_name.o: dat1_locate_name.c hds1_feature.h hds1.h rec.h \
 dat1.h f77.h dat_err.h
dat1_pack_crv.o: dat1_pack_crv.c hds1_feature.h hds1.h rec.h dat1.h \
 f77.h dat_err.h
dat1_pack_odl.o: dat1_pack_odl.c hds1_feature.h hds1.h rec.h dat1.h \
 f77.h dat_err.h
dat1_pack_srv.o: dat1_pack_srv.c hds1_feature.h hds1.h rec.h dat_err.h
dat1_put_ncomp.o: dat1_put_ncomp.c hds1_feature.h hds1.h rec.h rec1.h \
 dat_err.h
dat1_put_odl.o: dat1_put_odl.c hds1_feature.h hds1.h rec.h rec1.h \
 dat1.h f77.h dat_err.h
dat1_show_ndr.o: dat1_show_ndr.c hds1_feature.h hds1.h rec1.h rec.h \
 dat1.h f77.h dat_err.h
dat1_unpack_crv.o: dat1_unpack_crv.c hds1_feature.h hds1.h rec.h \
 dat1.h f77.h dat_err.h
dat1_unpack_odl.o: dat1_unpack_odl.c hds1_feature.h hds1.h rec.h \
 dat1.h f77.h dat_err.h
dat1_unpack_srv.o: dat1_unpack_srv.c hds1_feature.h hds1.h rec.h \
 dat_err.h
dat1_unpack_type.o: dat1_unpack_type.c hds1_feature.h ems.h hds1.h \
 rec.h dat1.h f77.h dat_err.h
dat_clen.o: dat_clen.c hds1_feature.h f77.h ems.h hds1.h rec.h str.h \
 dat1.h dat_err.h
dat_copy.o: dat_copy.c hds1_feature.h f77.h ems.h hds1.h rec.h str.h \
 dat1.h dat_err.h
dat_drep.o: dat_drep.c hds1_feature.h f77.h ems.h hds1.h rec.h str.h \
 dat1.h dat_err.h
dat_ermsg.o: dat_ermsg.c hds1_feature.h f77.h ems.h ems_par.h hds1.h \
 rec.h str.h dat1.h dat_err.h
dat_paren.o: dat_paren.c hds1_feature.h f77.h cnf.h ems.h hds1.h rec.h \
 str.h dat1.h dat_err.h
dat_prmry.o: dat_prmry.c hds1_feature.h f77.h cnf.h ems.h ems_par.h \
 hds1.h rec.h dat1.h dat_err.h
dat_refct.o: dat_refct.c hds1_feature.h f77.h cnf.h ems.h ems_par.h \
 hds1.h rec.h dat1.h dat_err.h
dat_where.o: dat_where.c hds1_feature.h f77.h ems.h hds1.h rec.h str.h \
 dat1.h dat_err.h
datalter.o: datalter.c hds1_feature.h f77.h ems.h hds1.h rec.h str.h \
 dat1.h dat_err.h
datannul.o: datannul.c hds1_feature.h f77.h cnf.h ems.h hds1.h rec.h \
 str.h dat1.h dat_err.h
daterase.o: daterase.c hds1_feature.h f77.h ems.h hds1.h rec.h str.h \
 dat1.h dat_err.h
datfinind.o: datfinind.c hds1_feature.h f77.h cnf.h ems.h hds1.h rec.h \
 str.h dat1.h dat_err.h
datget.o: datget.c hds1_feature.h f77.h ems.h hds1.h rec.h str.h \
 dat1.h dat_err.h
datinq.o: datinq.c hds1_feature.h f77.h ems.h hds1.h rec.h str.h \
 dat1.h dat_err.h
datlocops.o: datlocops.c hds1_feature.h f77.h ems.h hds1.h rec.h str.h \
 dat1.h dat_err.h
datmap.o: datmap.c hds1_feature.h f77.h ems.h hds1.h rec.h str.h \
 dat1.h dat_err.h
datmove.o: datmove.c hds1_feature.h f77.h cnf.h ems.h hds1.h rec.h \
 str.h dat1.h dat_err.h
datnew.o: datnew.c hds1_feature.h f77.h ems.h hds1.h rec.h str.h \
 dat1.h dat_err.h
datput.o: datput.c hds1_feature.h f77.h ems.h hds1.h rec.h str.h \
 dat1.h dat_err.h
dattemp.o: dattemp.c hds1_feature.h f77.h ems.h hds1.h rec.h str.h \
 dat1.h dat_err.h
daucheck.o: daucheck.c hds1_feature.h ems.h hds1.h rec.h str.h dat1.h \
 f77.h dat_err.h
daucnv.o: daucnv.c hds1_feature.h f77.h ems.h hds1.h rec.h str.h \
 dat1.h dat_err.h
daucopy.o: daucopy.c hds1_feature.h ems.h hds1.h rec.h str.h dat1.h \
 f77.h dat_err.h
dauflush.o: dauflush.c hds1_feature.h ems.h hds1.h rec.h str.h dat1.h \
 f77.h dat_err.h
dauloc.o: dauloc.c hds1_feature.h ems.h hds1.h rec.h str.h dat1.h \
 f77.h dat_err.h
daumove.o: daumove.c hds1_feature.h ems.h hds1.h rec.h str.h dat1.h \
 f77.h dat_err.h
dauscatgath.o: dauscatgath.c hds1_feature.h ems.h hds1.h rec.h str.h \
 dat1.h f77.h dat_err.h
daushape.o: daushape.c hds1_feature.h ems.h hds1.h rec.h str.h dat1.h \
 f77.h dat_err.h
dautypes.o: dautypes.c hds1_feature.h ems.h hds1.h rec.h str.h dat1.h \
 f77.h dat_err.h
hds1_exit.o: hds1_exit.c hds1_feature.h ems.h hds1.h rec.h str.h \
 dat1.h f77.h dat_err.h
hds_copy.o: hds_copy.c hds1_feature.h f77.h ems.h hds1.h rec.h rec1.h \
 str.h dat1.h dat_err.h
hds_ewild.o: hds_ewild.c hds1_feature.h f77.h ems.h hds1.h rec.h \
 dat1.h dat_err.h
hds_globals.o: hds_globals.c hds1_feature.h hds1.h rec1.h rec.h dat1.h \
 f77.h
hds_gtune.o: hds_gtune.c hds1_feature.h f77.h ems.h hds1.h rec.h str.h \
 dat1.h dat_err.h
hds_run.o: hds_run.c hds1_feature.h f77.h ems.h hds1.h str.h dat_err.h
hds_start.o: hds_start.c hds1_feature.h f77.h ems.h hds1.h rec.h \
 dat1.h dat_err.h
hds_state.o: hds_state.c hds1_feature.h f77.h hds1.h str.h dat_err.h
hds_stop.o: hds_stop.c hds1_feature.h f77.h ems.h hds1.h rec.h str.h \
 dat1.h dat_err.h
hds_tune.o: hds_tune.c hds1_feature.h f77.h ems.h hds1.h rec.h str.h \
 dat1.h dat_err.h
hds_wild.o: hds_wild.c hds1_feature.h f77.h cnf.h ems.h ems_par.h \
 hds1.h rec.h dat1.h dat_err.h
hdserase.o: hdserase.c hds1_feature.h f77.h cnf.h ems.h hds1.h rec.h \
 str.h dat1.h dat_err.h
hdsgroup.o: hdsgroup.c hds1_feature.h f77.h ems.h hds1.h rec.h str.h \
 dat1.h dat_err.h
hdslock.o: hdslock.c hds1_feature.h f77.h ems.h hds1.h rec.h str.h \
 dat1.h dat_err.h
hdsnew.o: hdsnew.c hds1_feature.h f77.h ems.h hds1.h rec.h str.h \
 dat1.h dat_err.h
hdsnull.o: hdsnull.c hds1_feature.h
hdsopclos.o: hdsopclos.c hds1_feature.h f77.h cnf.h ems.h hds1.h rec.h \
 str.h dat1.h dat_err.h
hdstools.o: hdstools.c hds1_feature.h f77.h ems.h hds1.h rec.h str.h \
 dat1.h dat_err.h
rec1_alloc_frame.o: rec1_alloc_frame.c hds1_feature.h ems.h hds1.h \
 rec1.h rec.h dat_err.h
rec1_clear_cbm.o: rec1_clear_cbm.c hds1_feature.h hds1.h rec1.h rec.h \
 dat_err.h
rec1_close_file.o: rec1_close_file.c hds1_feature.h ems.h ems_par.h \
 hds1.h rec.h rec1.h dat_err.h
rec1_close_slot.o: rec1_close_slot.c hds1_feature.h ems.h ems_par.h \
 hds1.h rec.h rec1.h dat_err.h
rec1_create_file.o: rec1_create_file.c hds1_feature.h ems.h ems_par.h \
 hds1.h rec.h rec1.h dat_err.h
rec1_deall_frame.o: rec1_deall_frame.c hds1_feature.h ems.h hds1.h \
 rec1.h rec.h dat_err.h
rec1_extend_file.o: rec1_extend_file.c hds1_feature.h ems.h ems_par.h \
 hds1.h rec.h rec1.h dat_err.h
rec1_extend_frame.o: rec1_extend_frame.c hds1_feature.h ems.h hds1.h \
 rec1.h rec.h dat_err.h
rec1_find_file.o: rec1_find_file.c hds1_feature.h ems.h ems_par.h \
 hds1.h rec.h rec1.h dat_err.h
rec1_flush_block.o: rec1_flush_block.c hds1_feature.h ems.h hds1.h \
 rec.h rec1.h dat_err.h
rec1_fmsg.o: rec1_fmsg.c hds1_feature.h ems.h ems_par.h hds1.h rec.h \
 rec1.h
rec1_get_fid.o: rec1_get_fid.c hds1_feature.h ems.h ems_par.h hds1.h \
 rec.h rec1.h dat_err.h
rec1_get_path.o: rec1_get_path.c hds1_feature.h ems.h ems_par.h hds1.h \
 rec.h rec1.h dat_err.h
rec1_getcwd.o: rec1_getcwd.c hds1_feature.h ems.h ems_par.h hds1.h \
 rec.h rec1.h dat_err.h
rec1_locate_hcb.o: rec1_locate_hcb.c hds1_feature.h hds1.h rec1.h \
 rec.h dat_err.h
rec1_lock_slot.o: rec1_lock_slot.c hds1_feature.h ems.h ems_par.h \
 hds1.h rec.h rec1.h dat_err.h
rec1_map_frame.o: rec1_map_frame.c hds1_feature.h ems.h ems_par.h \
 hds1.h rec.h rec1.h dat_err.h f77.h
rec1_open_file.o: rec1_open_file.c hds1_feature.h ems.h ems_par.h \
 hds1.h rec.h rec1.h dat_err.h
rec1_pack_chain.o: rec1_pack_chain.c hds1_feature.h dat_err.h hds1.h
rec1_pack_hcb.o: rec1_pack_hcb.c hds1_feature.h hds1.h rec1.h rec.h \
 dat_err.h
rec1_pack_ncomp.o: rec1_pack_ncomp.c hds1_feature.h dat_err.h hds1.h
rec1_pack_rcl.o: rec1_pack_rcl.c hds1_feature.h hds1.h rec.h dat_err.h
rec1_read_file.o: rec1_read_file.c hds1_feature.h ems.h ems_par.h \
 hds1.h rec.h rec1.h dat_err.h
rec1_save_addr.o: rec1_save_addr.c hds1_feature.h hds1.h dat_err.h \
 rec.h rec1.h
rec1_scan_cbm.o: rec1_scan_cbm.c hds1_feature.h hds1.h rec1.h rec.h
rec1_set_cbm.o: rec1_set_cbm.c hds1_feature.h
rec1_shell.o: rec1_shell.c hds1_feature.h ems.h ems_par.h hds1.h rec.h \
 rec1.h dat_err.h
rec1_test_cbm.o: rec1_test_cbm.c hds1_feature.h
rec1_unlock_slot.o: rec1_unlock_slot.c hds1_feature.h ems.h ems_par.h \
 hds1.h rec1.h rec.h dat_err.h
rec1_unmap_frame.o: rec1_unmap_frame.c hds1_feature.h ems.h ems_par.h \
 hds1.h rec.h rec1.h dat_err.h f77.h
rec1_unpack_chain.o: rec1_unpack_chain.c hds1_feature.h dat_err.h \
 hds1.h
rec1_unpack_hcb.o: rec1_unpack_hcb.c hds1_feature.h hds1.h rec1.h \
 rec.h dat_err.h
rec1_unpack_ncomp.o: rec1_unpack_ncomp.c hds1_feature.h dat_err.h \
 hds1.h
rec1_unpack_rcl.o: rec1_unpack_rcl.c hds1_feature.h hds1.h rec.h \
 dat_err.h
rec1_update_free.o: rec1_update_free.c hds1_feature.h ems.h hds1.h \
 rec1.h rec.h dat_err.h
rec1_write_file.o: rec1_write_file.c hds1_feature.h ems.h ems_par.h \
 hds1.h rec.h rec1.h dat_err.h
rec_adopt_record.o: rec_adopt_record.c hds1_feature.h hds1.h rec.h \
 rec1.h dat_err.h
rec_alloc_mem.o: rec_alloc_mem.c hds1_feature.h ems.h ems_par.h hds1.h \
 rec.h rec1.h dat_err.h
rec_alloc_xmem.o: rec_alloc_xmem.c hds1_feature.h ems.h ems_par.h \
 hds1.h rec.h rec1.h dat_err.h f77.h
rec_attach_file.o: rec_attach_file.c hds1_feature.h ems.h ems_par.h \
 hds1.h rec.h rec1.h dat_err.h
rec_close_file.o: rec_close_file.c hds1_feature.h ems.h hds1.h rec.h \
 rec1.h dat_err.h
rec_create_record.o: rec_create_record.c hds1_feature.h ems.h hds1.h \
 rec.h rec1.h dat_err.h
rec_deall_mem.o: rec_deall_mem.c hds1_feature.h ems.h hds1.h rec.h \
 rec1.h dat_err.h
rec_deall_xmem.o: rec_deall_xmem.c hds1_feature.h ems.h hds1.h rec.h \
 rec1.h dat_err.h f77.h
rec_delete_record.o: rec_delete_record.c hds1_feature.h hds1.h rec.h \
 rec1.h dat_err.h
rec_end_wild.o: rec_end_wild.c hds1_feature.h ems.h ems_par.h hds1.h \
 rec.h rec1.h dat_err.h
rec_extend_record.o: rec_extend_record.c hds1_feature.h hds1.h rec.h \
 rec1.h dat_err.h
rec_get_handle.o: rec_get_handle.c hds1_feature.h hds1.h rec.h rec1.h \
 dat_err.h
rec_get_rcl.o: rec_get_rcl.c hds1_feature.h hds1.h rec.h rec1.h \
 dat_err.h
rec_get_rid.o: rec_get_rid.c hds1_feature.h hds1.h rec.h rec1.h \
 dat_err.h
rec_list_files.o: rec_list_files.c hds1_feature.h hds1.h rec.h rec1.h \
 dat_err.h
rec_locate_block.o: rec_locate_block.c hds1_feature.h ems.h hds1.h \
 rec.h rec1.h dat_err.h
rec_locate_data.o: rec_locate_data.c hds1_feature.h ems.h hds1.h rec.h \
 rec1.h dat_err.h
rec_locate_fns.o: rec_locate_fns.c hds1_feature.h hds1.h rec.h rec1.h \
 dat_err.h
rec_lock.o: rec_lock.c hds1_feature.h hds1.h rec.h rec1.h dat_err.h
rec_mark_delete.o: rec_mark_delete.c hds1_feature.h hds1.h rec.h \
 rec1.h dat_err.h
rec_reall_mem.o: rec_reall_mem.c hds1_feature.h ems.h ems_par.h hds1.h \
 dat_err.h
rec_refcnt.o: rec_refcnt.c hds1_feature.h hds1.h rec.h rec1.h \
 dat_err.h
rec_release_block.o: rec_release_block.c hds1_feature.h ems.h hds1.h \
 rec.h rec1.h dat_err.h
rec_release_data.o: rec_release_data.c hds1_feature.h ems.h hds1.h \
 rec.h rec1.h dat_err.h
rec_reset_record.o: rec_reset_record.c hds1_feature.h hds1.h rec.h \
 rec1.h dat_err.h
rec_same_file.o: rec_same_file.c hds1_feature.h hds1.h rec.h rec1.h
rec_shrink_record.o: rec_shrink_record.c hds1_feature.h hds1.h rec.h \
 rec1.h dat_err.h
rec_start.o: rec_start.c hds1_feature.h hds1.h rec1.h rec.h dat_err.h
rec_stop.o: rec_stop.c hds1_feature.h ems.h hds1.h rec.h rec1.h \
 dat_err.h
rec_unlock.o: rec_unlock.c hds1_feature.h ems.h hds1.h rec.h rec1.h \
 dat_err.h
rec_where.o: rec_where.c hds1_feature.h ems.h hds1.h rec.h rec1.h \
 dat_err.h
rec_wild_file.o: rec_wild_file.c hds1_feature.h ems.h ems_par.h hds1.h \
 rec.h rec1.h dat_err.h
rtl_fixups.o: rtl_fixups.c hds1_feature.h
cmp_activ.o: CMP_CCT CMP_CONST DAT_PAR SAE_PAR
cmp_blk.o: CMP_CCT CMP_CONST DAT_PAR SAE_PAR
cmp_deact.o: CMP_CCT CMP_CONST DAT_PAR SAE_PAR
cmp_get0x.o: DAT_PAR SAE_PAR
cmp_get1x.o: DAT_PAR SAE_PAR
cmp_getnx.o: DAT_PAR SAE_PAR
cmp_getvx.o: DAT_PAR SAE_PAR
cmp_len.o: DAT_PAR SAE_PAR
cmp_mapn.o: CMP_CCT CMP_CONST CMP_ERR DAT_PAR SAE_PAR
cmp_mapv.o: CMP_CCT CMP_CONST CMP_ERR DAT_PAR SAE_PAR
cmp_mod.o: CMP_CONST CMP_ERR DAT_ERR DAT_PAR SAE_PAR
cmp_modc.o: CMP_CONST CMP_ERR DAT_ERR DAT_PAR SAE_PAR
cmp_prim.o: DAT_PAR SAE_PAR
cmp_put0x.o: DAT_PAR SAE_PAR
cmp_put1x.o: DAT_PAR SAE_PAR
cmp_putnx.o: DAT_PAR SAE_PAR
cmp_putvx.o: DAT_PAR SAE_PAR
cmp_shape.o: DAT_PAR SAE_PAR
cmp_size.o: DAT_PAR SAE_PAR
cmp_struc.o: DAT_PAR SAE_PAR
cmp_type.o: DAT_PAR SAE_PAR
cmp_unmap.o: CMP_CCT CMP_CONST CMP_ERR DAT_PAR SAE_PAR
dat_ccopy.o: DAT_ERR DAT_PAR SAE_PAR
dat_cctyp.o: DAT_PAR SAE_PAR
dat_erdsc.o: DAT_PAR EMS_PAR SAE_PAR
dat_erdsn.o: DAT_PAR EMS_PAR SAE_PAR
dat_ertxt.o: EMS_PAR
dat_get0x.o: DAT_PAR SAE_PAR
dat_get1x.o: DAT_ERR DAT_PAR SAE_PAR
dat_getnx.o: DAT_ERR DAT_PAR SAE_PAR
dat_getvx.o: DAT_ERR DAT_PAR SAE_PAR
dat_mapn.o: DAT_ERR DAT_PAR SAE_PAR
dat_mapv.o: DAT_PAR SAE_PAR
dat_msg.o: DAT1_SYS EMS_PAR SAE_PAR
dat_new0.o: DAT_PAR SAE_PAR
dat_new0c.o: DAT_PAR SAE_PAR
dat_new0x.o: DAT_PAR SAE_PAR
dat_new1.o: DAT_PAR SAE_PAR
dat_new1c.o: DAT_PAR SAE_PAR
dat_new1x.o: DAT_PAR SAE_PAR
dat_newc.o: DAT_PAR SAE_PAR
dat_prec.o: DAT_PAR SAE_PAR
dat_put0x.o: DAT_PAR SAE_PAR
dat_put1x.o: DAT_ERR DAT_PAR SAE_PAR
dat_putnx.o: DAT_ERR DAT_PAR SAE_PAR
dat_putvx.o: DAT_ERR DAT_PAR SAE_PAR
dat_rcera.o: DAT_PAR SAE_PAR
dat_rcopy.o: DAT_PAR SAE_PAR
dat_ref.o: DAT1_SYS DAT_ERR EMS_PAR SAE_PAR
dat_tune.o: DAT_PAR SAE_PAR

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