# Make the FITSUTIL external package
#
# Author: N Zarate
#

$ifeq (hostid, unix)  !(clear;date)  $endif
$call update
$ifeq (hostid, unix)  !(date)  $endif
$exit

linkonly:
	$call pkg

	$ifeq (HOSTID, vms) $purge [...] $endif
	$purge mefbin$
	;


update:
	$call lib
	$call pkg

	$ifeq (HOSTID, vms) $purge [...] $endif
	$purge mefbin$
	;

lib:
	$echo "===================== LIB ========================="
	$echo ""
	$call update@lib
	;
pkg:
	$echo "===================== PKG ========================="
	$echo ""
	$call update@pkg
	;

# STRIP -- Strip the TABLES directories of all sources and other files not
# required to run the system, or for user programming.

strip:
	!rmfiles -f lib/strip.mef
	;

# SUMMARY -- [UNIX] mkpkg summary: output a summary of the spooled mkpkg
# output, omitting most of the mundane chatter.  Used to scan large spool
# files for errors.

summary:
	$ifeq (HOSTID, unix)
	    ! grep -v ':$$' spool | grep -v '^xc' | grep -v '^ar'\
	    | grep -v '^check file'
	$else
	    $echo "mkpkg summary only available on a UNIX system"
	$endif
	;


# SUN/IRAF multiple architecture support.
# ----------------------------------------

arch:					# show current float option
showfloat:
	$verbose off
	!$(hlib)/mkfloat.csh
	;
generic:				# generic installation (no bin)
	$ifnfile (bin.generic)
	    !mkdir bin.generic
	$endif
	$verbose off
	$set DIRS = "lib pkg"
	!$(hlib)/mkfloat.csh generic -d $(DIRS)
	;

alpha:                                  # install DEC Alpha binaries
	$ifnfile (bin.alpha)
	    !mkdir bin.alpha
	$endif
        $verbose off
        $set DIRS = "lib pkg"
        !$(hlib)/mkfloat.csh alpha -d $(DIRS)
        ;
freebsd:                                # install FreeBSD binaries
	$ifnfile (bin.freebsd)
	    !mkdir bin.freebsd
	$endif
        $verbose off
        $set DIRS = "lib pkg"
        !$(hlib)/mkfloat.csh freebsd -d $(DIRS)
        ;
hp700:					# install HPUX series 700 binaries
	$ifnfile (bin.hp700)
	    !mkdir bin.hp700
	$endif
	$verbose off
	$set DIRS = "lib pkg"
	!$(hlib)/mkfloat.csh hp700 -d $(DIRS)
	;
irix:					# install SGI IRIX binaries
	$ifnfile (bin.irix)
	    !mkdir bin.irix
	$endif
	$verbose off
	$set DIRS = "lib pkg"
	!$(hlib)/mkfloat.csh irix -d $(DIRS)
	;
linux:                                  # install Slackwkare Linux binaries
	$ifnfile (bin.linux)
	    !mkdir bin.linux
	$endif
        $verbose off
        $set DIRS = "lib pkg"
        !$(hlib)/mkfloat.csh linux -d $(DIRS)
        ;
macosx:                                 # install Mac OS X binaries
	$ifnfile (bin.macosx)
	    !mkdir bin.macosx
	$endif
        $verbose off
        $set DIRS = "lib pkg"
        !$(hlib)/mkfloat.csh macosx -d $(DIRS)
        ;
redhat:                                 # install Redhat Linux binaries
	$ifnfile (bin.redhat)
	    !mkdir bin.redhat
	$endif
        $verbose off
        $set DIRS = "lib pkg"
        !$(hlib)/mkfloat.csh redhat -d $(DIRS)
        ;
rs6000:					# install IBM AIX binaries
	$ifnfile (bin.rs6000)
	    !mkdir bin.rs6000
	$endif
	$verbose off
	$set DIRS = "lib pkg"
	!$(hlib)/mkfloat.csh rs6000 -d $(DIRS)
	;
sparc:					# install sparc binaries
	$ifnfile (bin.sparc)
	    !mkdir bin.sparc
	$endif
	$verbose off
	$set DIRS = "lib pkg"
	!$(hlib)/mkfloat.csh sparc -d $(DIRS)
	;
ssun:					# install Sun/Solaris binaries
	$ifnfile (bin.ssun)
	    !mkdir bin.ssun
	$endif
	$verbose off
	$set DIRS = "lib pkg"
	!$(hlib)/mkfloat.csh ssun -d $(DIRS)
	;
suse:                                   # install SuSE Linux binaries
	$ifnfile (bin.suse)
	    !mkdir bin.suse
	$endif
        $verbose off
        $set DIRS = "lib pkg"
        !$(hlib)/mkfloat.csh suse -d $(DIRS)
        ;
sunos:                                  # install SunOS (Solaris x86) binaries
	$ifnfile (bin.sunos)
	    !mkdir bin.sunos
	$endif
        $verbose off
        $set DIRS = "lib pkg"
        !$(hlib)/mkfloat.csh sunos -d $(DIRS)
        ;
