# FITSIO -- Update the FITSIO library.
#  this is a sample IRAF mkfile which builds a local version of the FITSIO lib.

$call update
$exit

update:
	$update   libfitsio.a
	;

fitsio:
	# Update fitsio subdirectory if new version of fitsio.for installed.
	$ifolder (fitsio/ftopen.f, fitsio.for)
	    $echo "update fitsio subdirectory"
	    !cat version
	    !mkfort fitsio.for fitsio
	$endif
	;

fitssppb:
	# Update fitssppb subdirectory if new version of fitssppb.x installed.
	$ifolder (fitssppb/fsvers.f, fitssppb.x)
	    $echo "update fitssppb subdirectory"
	    !cat version
	    $xc -f fitssppb.x
	    !mkfort fitssppb.f fitssppb
	    $delete fitssppb.f
	$endif
	;

libfitsio.a:
	# Split the fitsio.for file into many small .f files for unix.
	$ifeq (hostid, unix)
	    $call fitsio
	    @fitsio
	    $call fitssppb
	    @fitssppb
	$else
	    fitsio.for
	    fitssppb.x
	$endif

	fitsspp.x	fitsspp.com
	libf77.x
	;
