#
# $Id: Makefile 3310 2006-04-23 16:41:32Z schmidt $
#

LATEX = latex
BIBTEX = bibtex

MAIN_DOCUMENT = JSS-2006

TEXFILES = \
  abstract.tex \
  intro.tex \
  mlrm.tex \
  eval.tex \
  related.tex \
  conclusion.tex \
  $(MAIN_DOCUMENT).tex

all: dvi

dvi: $(MAIN_DOCUMENT).dvi

$(MAIN_DOCUMENT).dvi: $(TEXFILES) 
#  Once to get things going
	$(LATEX) $(MAIN_DOCUMENT)
#  Generate the bibliography contents
#  Two more runs to get references, cross-references, ToC,
#  and other lists correct.
	$(LATEX) $(MAIN_DOCUMENT)
	$(BIBTEX) $(MAIN_DOCUMENT)
	$(LATEX) $(MAIN_DOCUMENT)
	$(LATEX) $(MAIN_DOCUMENT)
	dvipdf $(MAIN_DOCUMENT).dvi
#	cp $(MAIN_DOCUMENT).pdf /web/users/jai/JSS/

ps: $(MAIN_DOCUMENT).ps

$(MAIN_DOCUMENT).ps: $(MAIN_DOCUMENT).dvi
	dvips $(MAIN_DOCUMENT) -o

pdf: $(MAIN_DOCUMENT).pdf

$(MAIN_DOCUMENT).pdf: $(MAIN_DOCUMENT).dvi
	if (test -f $(DISTILL)) then \
	  dvips $(MAIN_DOCUMENT) -o; \
          $(DISTILL) $(MAIN_DOCUMENT).ps $(MAIN_DOCUMENT).pdf; \
	else \
	  dvipdf $(MAIN_DOCUMENT); \
	fi

clean:
	rm -f *~ *.{aux,bbl,blg,lof,log,lot,toc}

realclean: clean
	rm -f $(MAIN_DOCUMENT).{dvi,ps,pdf}

.PHONY: all dvi ps pdf clean realclean
