#
#       Makefile for grph2
#

include ../../Mkinclude

EPSDIR		= uspack

LIBNAME		=  grph2
L2HFLAGS	= auxin=grph2.haux
TEXDIR		= gaiyou grpack ubpack ucpack udpack \
		  uepack ufpack ugpack ulpack umpack \
		  uspack uuvhpack uwpack uxyzpack 
TEXDOC		= grph2.tex 
HTML		= grph2.html 

all: epsfiles grph2.ps

epsfiles:
	@for i in $(EPSDIR) ; do \
	  cd $$i ; \
	  echo "Making $$i epsfiles" ; \
	  $(MAKE) ; \
	  cd .. ; \
	done

grph2.ps: grph2.dvi
	$(RM) grph2.ps
	$(DVI2JPS) grph2.dvi > grph2.ps

grph2.dvi: grph2.tex
	$(JLATEX) grph2.tex
	$(JLATEX) grph2.tex

install: $(PSDIR)/grph2.ps

$(PSDIR)/grph2.ps: grph2.ps
	@$(CP) grph2.ps $(PSDIR)/grph2.ps

clean: clean.local clean.dir

clean.local:
	$(RM) *~ *.aux *.dvi *.idx *.log *.toc *.ps

clean.dir:
	$(RM) */*~ */*.aux */*.eps

html.all:
	$(MAKE) clean.html
	@for i in *.tex */*.tex ; do \
	  $(LATEX2HIDX) aux=$(LIBNAME).haux idx=$(LIBNAME).hidx $$i ; \
	done
	$(SORT) $(LIBNAME).hidx | $(HIDX2HTML) $(L2HICONS) \
title=$(LIBNAME) backto=$(LIBNAME).html > $(LIBNAME)-idx.html
	$(MAKE) html.dir
	$(MAKE) html.local 

html: html.dir html.local 

html.local: $(HTML)

html.dir:
	@for i in $(TEXDIR) ; do \
	  cd $$i ; \
	  echo "Making $$i html" ; \
	  $(MAKE) html ; \
	  cd .. ; \
	done

clean.html:
	$(RM) *.html *.haux* *.hidx */*.html
