# Make MSCTOOLS.

$call	relink
$exit

update:
	$update	libpkg.a
	$call	update@mscdisplay
	$call	update@mscfinder
	$call	relink
	$call	install
	;

relink:
	$update	libpkg.a
	$omake	x_msctools.x
	$link  x_msctools.o libpkg.a -lnfe -lxtools -lcurfit \
	    -lgsurfit -lslalib -lsurfit -liminterp -o xx_msctools.e
	;

install:
	$move	xx_msctools.e nfebin$x_msctools.e
	;

generic:
	$set	GEN = "$$generic -k"

	$ifolder (liststr.x, liststr.gx)
	    $(GEN) liststr.gx -o liststr.x $endif
	$ifolder (rgstr.x, rgstr.gx)
	    $(GEN) rgstr.gx -o rgstr.x $endif
	$ifolder (patblk.x, patblk.gx)
	    $(GEN) patblk.gx -o patblk.x $endif
	;

libpkg.a:
	@curfit
	@imsurfit

	$ifeq (USE_GENERIC, yes) $call generic $endif

	ccsetwcs.x	<imhdr.h> <math/gsurfit.h> <math.h> <mwset.h> skywcs.h
	liststr.x	<ctype.h>
	mapio.x		<error.h> <imhdr.h>
	mgs.x		<error.h> <imhdr.h> <imio.h> <math/gsurfit.h>
	mim.x		<error.h> <imhdr.h> <imset.h> <math/iminterp.h>
	mscwcs.x	<error.h>
	patblk.x
	rgstr.x		<ctype.h>
	skywcs.x	<imhdr.h> <imio.h> <math.h> <mwset.h> skywcsdef.h\
			skywcs.h
	t_addkey.x	<fset.h> <imhdr.h> <imio.h>
	t_fitscopy.x	<ctype.h> <error.h> <fset.h> <mach.h>
	t_getcatalog.x	<fio.h> <fset.h> <imhdr.h> <mach.h> <math.h>
	t_imext.x	<ctype.h> <error.h> <imhdr.h> <imset.h> <mach.h>
	t_imstat.x	<imhdr.h> imstat.h <mach.h>
	t_jlists.x	
	t_mkmsc.x	<error.h> <imhdr.h>
	t_msccmatch.x	<error.h> <fset.h> <imhdr.h> <imset.h> <math.h>
	t_mscctran.x	<ctotok.h> <ctype.h> <error.h> <fset.h> <imhdr.h>\
			<imio.h> <mwset.h>
	t_mscext.x	<error.h> <imhdr.h> <imset.h>
	t_mscgmask.x	<error.h> <imhdr.h>
	t_mscimatch.x	<fset.h> <gset.h> <imhdr.h> <imset.h> <math/curfit.h>\
			<pkg/gtools.h>
	t_mscpmask.x	<imhdr.h>
	t_msctmplt.x	<error.h> <imhdr.h> <imset.h> <mach.h> <math.h>
	t_mscuniq.x	<error.h>
	t_mscwcs.x	<error.h> <imhdr.h> <imset.h> <math.h>
	t_patfit.x	<error.h> <imhdr.h>
	t_pixarea.x	<error.h> <imhdr.h> <mach.h> <math/iminterp.h>
	t_pixscale.x	<error.h> <imhdr.h> <mach.h> <math/iminterp.h>
	t_toshort.x	<error.h> <imhdr.h> <mach.h>
	t_xlog.x	<error.h> <time.h>
	;
