#
# Makefile for Theodore Ts'o's thesis!
# 

BACKUPDIR = /afs/sipb/user/tytso/thesis
BACKUPDIR2 = /thor/site/thesis
PICTURES = satchel.ps proxy-prot.ps
THESISFILES = introduction.tex concepts.tex applications.tex \
		extensions.tex conclusion.tex

.SUFFIXES:	.PS .dvi .latex .tex .sty .doc
.tex.dvi: ;	-tex $*.tex
.latex.dvi: ;	-latex $*.latex
		if grep "
		while grep "Rerun to get cross-references right" $*.log \; do \
			-latex $*.tex ; \
			done
.doc.sty: ;	docsty $*
.dvi.PS: ;	dvi2ps $*.dvi > $*.PS

all: thesis.dvi

/thor/site:
	attach -e thor:/site
	aklog -cell sipb.mit.edu

backup: /thor/site
	/afs/athena/service/@sys/reconcile -s . -d $(BACKUPDIR)
	/afs/athena/service/@sys/reconcile -s . -d $(BACKUPDIR2)

thesis.dvi: thesis.tex thesis.sty thesis.bbl $(PICTURES) mitthesis.tex \
		thesis-draft.tex $(THESISFILES)
	latex thesis.tex
	while grep "Rerun to get cross-references right" thesis.log ; do \
  		latex thesis.tex ; \
	done ; exit 0

thesis.bbl: thesis.bib thesis.aux
	bibtex thesis

thesis.aux:
	latex thesis.tex

test: thesis.sty
	latex test.tex

clean:
	rm -f *.aux *.bbl *.toc *.tof *.log *.dvi *~ thesis.PS
