# gf2: Gaussfit version 2.56 in the Texas scheme (see McArthur at UT Austin astronomy dept)
#
#   Entry points recognized by this mkpkg file:
#
#       mkpkg update    linkonly (regenerate executable) and install
#       mkpkg linkonly  note: XFLAGS is modified
#       mkpkg install   move executable to stsdas$bin when installed officially

$call relink
$exit

update:
	$call relink
	$call install
	;

relink:
linkonly:
	$set XFLAGS = "-q -Inolibc $(XFLAGS)"
	$set LFLAGS = "-h -q -z $(LFLAGS)"
	$update gaussfit.a
	$omake gfitmain.c prototypes.p alloc.h defines.h
	$link -o xx_gaussfit.e gfitmain.o gaussfit.a


 
gaussfit.a:
	arithops.c 	array.h datum.h machine.h prototypes.p alloc.h
	array.c 	array.h prototypes.p alloc.h
	datum.c 	array.h symboltable.h datum.h prototypes.p \
				alloc.h
	declare.c 	array.h symboltable.h declare.h datum.h prototypes.p \
				alloc.h 
	errhandle.c 	defines.h
	export.c 	defines.h house.h files.h array.h datum.h \
				symboltable.h prototypes.p alloc.h
	files.c 	defines.h alloc.h files.h strings.h array.h \
				datum.h symboltable.h prototypes.p alloc.h
	functs.c 	array.h datum.h machine.h prototypes.p alloc.h
	logicops.c 	array.h datum.h machine.h prototypes.p alloc.h
	gauss.c 	array.h datum.h symboltable.h defines.h house.h \
				files.h prototypes.p alloc.h
	house.c 	alloc.h house.h files.h array.h datum.h symboltable.h \
				defines.h prototypes.p
	matrixman.c 	defines.h array.h datum.h symboltable.h house.h \
				files.h robust.h prototypes.p alloc.h
	opcodes.c 	array.h datum.h declare.h symboltable.h \
				machine.h prototypes.p alloc.h
	symboltable.c 	array.h datum.h symboltable.h prototypes.p alloc.h
	quicksort.c
	robust.c 	defines.h house.h files.h
	simplefits.c	defines.h prototypes.p simpledefs.h strings.h
	simplemidas2.c	defines.h strings.h prototypes.p alloc.h house.h
	compile.c	symtab.h def.h compile.h array.h \
				datum.h declare.h symboltable.h \
				machine.h prototypes.p alloc.h
	symtab.c 	symtab.h def.h prototypes.p alloc.h
	minsum.c		defines.h house.h
	ytab.c 		array.h alloc.h strings.h symtab.h def.h \
				compile.h defines.h lexyy.h datum.h \
				symboltable.h machine.h prototypes.p
	util.c
	machine.c 	array.h datum.h machine.h declare.h symboltable.h \
				compile.h prototypes.p alloc.h functs.h
	;

install:
	$move xx_gaussfit.e stsdasbin$x_gaussfit.e
	;
