#
#       Makefile for gokuraku
#

include ../../Mkinclude

EPSDIR          = append hop jump layout step u1d u2d

LIBNAME		=  gokuraku
L2HFLAGS	= auxin=gokuraku.haux
TEXDIR		= append hop intro jump layout \
		  step u1d u2d 
TEXDOC		= gokuraku.tex 
HTML		= gokuraku.html 

all: epsfiles gokuraku.ps

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

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

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

install: $(PSDIR)/gokuraku.ps

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