FILENAME=ecryptfs_design_doc_v0_2

$(FILENAME).tar.gz: $(FILENAME).pdf $(FILENAME).html
	-tar czf $(FILENAME).tar.gz $(FILENAME).pdf \
	$(FILENAME).html \

$(FILENAME).pdf: $(FILENAME).ps
	ps2pdf $(FILENAME).ps $(FILENAME).pdf

$(FILENAME).ps: $(FILENAME).dvi
	dvips -f $(FILENAME).dvi -t letter > $(FILENAME).ps

$(FILENAME).html: $(FILENAME).tex
	latex2html -split 0 -nonavigation -notop_navigation -noinfo \
	$(FILENAME).tex
	cp $(FILENAME)/$(FILENAME).html .
	-cp $(FILENAME)/*png .

$(FILENAME).dvi: $(FILENAME).tex
	latex $(FILENAME).tex
	latex $(FILENAME).tex

distclean: clean
	-rm -f *~

clean:
	-rm -rf $(FILENAME)/
	-rm -rf $(FILENAME)_html/
	-rm -f *.pdf *.ps *.html *.css *.png *.log *.aux *.dvi *.asc *.tar.gz *.bbl *.blg

install: $(FILENAME).tar.gz $(FILENAME).pdf \
	$(FILENAME).pdf.asc $(FILENAME).html \
	$(FILENAME).html.asc
	-mv $(FILENAME) $(FILENAME)_html
	-mkdir $(FILENAME)
	-cp $(FILENAME)_html/*png $(FILENAME)/
	cp $(FILENAME)_html/*html $(FILENAME)/
	cp $(FILENAME)_html/*css $(FILENAME)/
	cp $(FILENAME).html.asc $(FILENAME)/
	cp $(FILENAME).pdf $(FILENAME)/
	cp $(FILENAME).pdf.asc $(FILENAME)/
	cp $(FILENAME).tar.gz $(FILENAME)/
