#
#       Makefile for etc
#

include ../../Mkinclude


LIBNAME		=  etc
L2HFLAGS	= auxin=etc.haux
TEXDIR		= gaiyou pslib texsty 
TEXDOC		= etc.tex 
HTML		= etc.html 

all: etc.ps

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

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

install: $(PSDIR)/etc.ps

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

