# This mkpkg file builds trxyeq, treqxy and ucrpix as native IRAF tasks.

$call	relink
$exit

update:
	$call	relink
	$call	install
	;

relink:
	$set XFLAGS = "-DNATIVE_IRAF -Inolibc \
		'-Istsdaslib$cvos/irafstdio' $(XFLAGS)"
	$update	trxyeq.a
	$call	linkonly2
	;

linkonly:
	$set XFLAGS = "-DNATIVE_IRAF -Inolibc \
		'-Istsdaslib$cvos/irafstdio' $(XFLAGS)"
linkonly2:
	$omake trxyeq.c <c_iraf.h> <xclio.h> <ximio.h> <xmwcs.h> trxyeq.h
	$omake treqxy.c <c_iraf.h> <xclio.h> <ximio.h> <xmwcs.h> trxyeq.h
	$omake ucrpix.c <c_iraf.h> <xclio.h> <ximio.h> <xmwcs.h> trxyeq.h

	$set LFLAGS = "-H -z $(LFLAGS)"
	$link trxyeq.o trxyeq.a \
		-lcvos -ltbtables -lc \
		-o xx_trxyeq.e
	$link treqxy.o trxyeq.a \
		-lcvos -ltbtables -lc \
		-o xx_treqxy.e
	$link ucrpix.o trxyeq.a \
		-lcvos -ltbtables -lc \
		-o xx_ucrpix.e
	;

install:
	$move xx_treqxy.e stsdasbin$x_treqxy.e
	$move xx_trxyeq.e stsdasbin$x_trxyeq.e
	$move xx_ucrpix.e stsdasbin$x_ucrpix.e
	;

trxyeq.a:
	geocorr.c	<c_iraf.h> <ximio.h> <xmwcs.h> trxyeq.h
	getidc.c	<c_iraf.h> <xtables.h> trxyeq.h
	util.c		<c_iraf.h> <ximio.h> trxyeq.h
	dms.c
