# wf3ir

$call update
$exit

devdebug:
	$set XFLAGS = "-Inolibc -g -q $(XFLAGS)"
	$set LFLAGS = "-H -z -x -p tables -p stsdas"
	$call updatedir
	$call installdev
	$exit
	;	
	
dev:
	$set XFLAGS = "-Inolibc  $(XFLAGS)"
# Next line contains flag for creating code that contains profile info
#	$set XFLAGS = "-Inolibc -/p $(XFLAGS)"
	$set LFLAGS = "-H -z -p tables -p stsdas $(LFLAGS)"
	$call updatedir
	$call installdev
	;

debug:
	$set XFLAGS = "-Inolibc -g -q $(XFLAGS)"
	$set LFLAGS = "-H -z -x -p tables -p stsdas"
	$call updatedir
	$call install
	$exit
	;		

update:
	$set XFLAGS = "-Inolibc  $(XFLAGS)"
	$set LFLAGS = "-H -z -p tables -p stsdas $(LFLAGS)"
	$call updatedir
	$call install
	;

updatedir:
	$checkout calwf3.a ../
	$update calwf3.a
	$checkin calwf3.a ../

	$call relink
	;

linkonly:
	$set XFLAGS = "-Inolibc $(XFLAGS)"
# Next line contains flag for creating code that contains profile info
#	$set XFLAGS = "-Inolibc -/p $(XFLAGS)"
	$set LFLAGS = "-H -z -p tables -p stsdas $(LFLAGS)"
	
relink:

	$omake mainir.c <c_iraf.h> <ximio.h> <hstio.h> ../wf3.h ../wf3info.h \
			../wf3err.h ../wf3corr.h

	$link mainir.o ../calwf3.a\
		-lhstio -lcvos -lsynphot -lstxtools -ltbtables \
		-o wf3ir.e
	;

install:
	$move wf3ir.e stsdasbin$
	;
    
installdev:
	$move wf3ir.e  /user/sosey/wfc3/pipeline/bin/
	;

calwf3.a:
        blevcorr.c    ../wf3.h ../wf3info.h ../trl.h <hstio.h>
        cridcalc.c    ../wf3.h ../wf3info.h ../wf3dq.h ../trl.h <hstio.h>
        darkcorr.c    ../wf3.h ../wf3info.h ../trl.h <hstio.h>
        doir.c        ../wf3.h ../wf3info.h ../wf3err.h ../trl.h <hstio.h>
        dqicorr.c     ../wf3.h ../wf3info.h ../wf3err.h ../wf3dq.h <hstio.h>
        flatcorr.c    ../wf3.h ../wf3info.h <hstio.h>
	getirflags.c  ../wf3.h ../wf3info.h ../wf3err.h <hstio.h>
	getirsw.c     ../wf3.h ../wf3info.h <hstio.h>
        groupinfo.c   ../wf3.h ../wf3info.h ../trl.h <hstio.h>
        imageio.c     ../wf3.h ../wf3info.h ../trl.h <hstio.h> <ximio.h>
	irhist.c      ../wf3.h ../wf3info.h ../wf3err.h ../trl.h <hstio.h>
        math.c        ../wf3.h ../wf3info.h <hstio.h>
        nlincorr.c    ../wf3.h ../wf3info.h ../wf3dq.h ../trl.h <hstio.h>
        noiscalc.c    ../wf3.h ../wf3info.h ../trl.h <hstio.h>
        numrec.c      ../wf3.h ../trl.h  <c_iraf.h>
        photcalc.c    ../wf3.h ../wf3info.h ../wf3err.h <hstio.h> <xsynphot.h>
        pixcheck.c    ../wf3.h <hstio.h>
        refdata.c     ../wf3.h ../wf3info.h ../wf3err.h ../trl.h <hstio.h> <xtables.h>
	resistmean.c  ../msg.h ../trl.h
        satcheck.c    ../wf3.h ../wf3dq.h <hstio.h>
        statcalc.c    ../wf3.h ../wf3info.h <hstio.h>
        stats.c       ../wf3.h ../trl.h <hstio.h>
        unitcorr.c    ../wf3.h ../wf3info.h ../trl.h <hstio.h>
        updatehdr.c   ../wf3.h <hstio.h>
	wf3ir.c	      ../wf3.h ../wf3info.h ../wf3err.h ../wf3corr.h ../trl.h <hstio.h>
        zoffcorr.c    ../wf3.h ../wf3info.h ../trl.h <hstio.h>
        zsigcorr.c    ../wf3.h ../wf3info.h ../wf3dq.h ../trl.h <hstio.h>
	;
