#
#       Makefile for math1
#

include ../../Mkinclude

LIBNAME		=  math1
L2HFLAGS	= auxin=math1.haux
TEXDIR		= blklib chrlib ctrlib fnclib gaiyou \
		  gnmlib ifalib indxlib intlib lrllib \
		  maplib oslib rfalib rfblib sublib \
		  syslib vialib viblib vralib vrblib \
		  xfclib 
TEXDOC		= math1.tex 
HTML		= math1.html 


all: math1.ps

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

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

install: $(PSDIR)/math1.ps

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