#
#       Makefile for math2
#

include ../../Mkinclude

LIBNAME		=  math2
L2HFLAGS	= auxin=math2.haux
TEXDIR		= fftlib gaiyou intrlib odelib rnmlib \
		  shtlib vstlib 
TEXDOC		= math2.tex 
HTML		= math2.html 

all: math2.ps

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

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

install: $(PSDIR)/math2.ps

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