# Make the KPNO package.

$call	relink
$exit

update:
	@longplot
	@calcomp
	$call	relink
	$call	install
	$call	fortran
	;

relink:
	$set	LIBS = "-lxtools -liminterp -lcurfit"

	$update	libpkg.a
	$omake	x_nlocal.x
	$link	x_nlocal.o libpkg.a $(LIBS) -o xx_nlocal.e
	;

install:
	$move	xx_nlocal.e pkgbin$x_nlocal.e
	$purge	pkgbin$
	;

fortran:
	$set    LFLAGS = "-h"
	$set    LIBS   = "-limfort -lsys -lvops -los"

	$omake  splist.f
	$link   splist.o $(LIBS)
	$move   splist.e pkgbin$splist.e
	$purge	pkgbin$
	;

libpkg.a:
	@specfocus
	@asttools
	@pairmass
	@rccd

	t_bitcount.x	<error.h> <imhdr.h> <mach.h>
	t_bswap.x	<mach.h>
	t_getpds.x
	t_lcode.x	<error.h> <ctotok.h>
	t_linenum.x
	t_lutreplace.x
	t_paste.x	<chars.h> <ctype.h> <error.h> <fset.h> <lexnum.h> \
			<pattern.h> <printf.h>
	t_pavg.x	<imhdr.h>
	t_pixutil.x	<imhdr.h> <error.h> <time.h> <fset.h> <oif.h>
	t_radlist.x	<imhdr.h> <error.h> <mach.h> <gset.h>
	t_ranges.x	<mach.h>
	t_signfix.x	<imhdr.h> <error.h>
	t_sun2iraf.x	<imhdr.h> <error.h> <mach.h>
	t_suntoiraf.x	<imhdr.h> <error.h> <mach.h>
	t_surfview.x	<error.h> <imhdr.h> <mach.h> <fset.h>
	;
