#
#       Makefile for sample
#

include ../../Mkinclude

EPSDIR		= sgpack slpack grpack uxyzpk uspack udegpk umpack

LIBNAME		=  sample
L2HFLAGS	= auxin=sample.haux
TEXDIR		= grpack sgpack slpack udegpk umpack \
		  uspack uxyzpk 
TEXDOC		= sample.tex 
HTML		= sample.html 

all: epsfiles sample.ps

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

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

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

install: $(PSDIR)/sample.ps

$(PSDIR)/sample.ps: sample.ps
	@$(CP) sample.ps $(PSDIR)/sample.ps

clean: clean.local clean.dir

clean.local:
	$(RM) *~ *.aux *.dvi *.idx *.log *.toc *.ps

clean.dir:
	$(RM) */*~ */*.aux */*.eps

html.all:

html.all-not.yet:  ########!!!!
	$(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

