USE_JAG = yes
include ${SEPINC}/SEP.top

# pstexpen.exp is like pstexpen but its bounding box has integer values
PSTEX = pstexpen.exp

RESULTSER = stretch
RESDIR    = ./Fig

data=.

default: 
	${MAKE} build
	${MAKE} paper_idvi

# Currently, ../Data/cmp.HH is hard-coded into Results.java
$(RESDIR)/stretch.v : Results.java
	${JAVAX} ${PACKAGE}.Results out=nmo.H
	< ${data}/cmp.HH Byte | Ta2vplot labelsz=12 title=" " out=dat.v > dat.V
	<         nmo.H  Byte | Ta2vplot labelsz=12 title=" " out=nmo.v > nmo.V
	vp_SideBySideAniso dat.v nmo.v >            ${RESDIR}/stretch.v

# The following is for latex2html
Gif/stretch.gif : ${RESDIR}/stretch.ps
	cd ${RESDIR}; pstogif stretch.ps stretch.gif
	mv ${RESDIR}/stretch.gif Gif/stretch.gif

clean     : jclean
distclean : jclean idviclean htmlclean

.PHONY : idviclean
idviclean :
	@-/bin/rm -rf *_idvi/* ${RESDIR}/*.gif

.PHONY : htmlclean
htmlclean :
	@-/bin/rm -rf *_html ${RESDIR}/*.gif

%_idvi : %.dvi #Calc.jc
	if ${OTEST} ! -d $*_idvi ; then mkdir $*_idvi ; fi
# WARNING: if RESDIR=../Fig, and there exists a ./Fig, there may be problems
	if ${OTEST} ! -d $*_idvi/Fig ; then cd $*_idvi ; ln -s ../${RESDIR} ${RESDIR} ; fi
	cd $*_idvi ; idvi ../$*.dvi -title "Get title somehow"
	chmod go+rx $*_idvi
	chmod go+r  $*_idvi/*

# MAKE SURE THE .ps FIGURES ARE MADE
# Do not do Latify
paper.dvi : build paper.tex
	cp paper.tex paper.ltx
	Actify paper.ltx
	/bin/touch junk.aux junk.bbl
	/bin/rm -f *.aux *.bbl
	latex2dvi -v paper.ltx

ready: 
	cp paper.idvi.tex paper.tex
	/bin/rm -rf paper.idvi 

include ${SEPINC}/SEP.bottom
