#
#       Makefile for grph1
#

include ../../Mkinclude

EPSDIR		= append

LIBNAME		=  grph1
L2HFLAGS	= auxin=grph1.haux
TEXDIR		= append gaiyou scpack sgpack slpack \
		  stpack supack swpack szpack 
TEXDOC		= grph1.tex 
HTML		= grph1.html 

all: epsfiles grph1.ps

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

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

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

install: $(PSDIR)/grph1.ps

$(PSDIR)/grph1.ps: grph1.ps
	@$(CP) grph1.ps $(PSDIR)/grph1.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
