# Makefile for ~lp/html/proof

DIR = proof

.SUFFIXES: .html .tex

.tex.html: 
	sed -f ../tex2html $*.tex | sed -f ../tex2html > $*.html

all: files

again:
	make clean Makefile 
	make all

Makefile: clean 
	mv Makefile Makefile.bak
	/bin/rm -f Index.html *.tex
	ln -s ../../help/${DIR}/*.tex .
	grep -v '^files:' Makefile.bak > Makefile
	echo '<pre>' > Index.html
	for i in `ls *.tex | sed "s/.tex/.html/"`;		\
	    do echo files: $$i >> Makefile;			\
	       echo "<a href=\"$$i\">$$i</a>" >> Index.html;	\
	    done
	echo '</pre>' >> Index.html

xref:
	cat *.html						\
	  | tr '>' '\012' 					\
          | sed -n '/.*<a href="\([^"]*\)"/s//\1/p' 		\
          | sort -u						\
	  > tmp
	for j in `grep -v \# tmp`;				\
	    do if test -s $$j;					\
	       then true;					\
	       else echo $$j; 					\
	       fi;						\
	    done
	sed -n '/\(.*\)\#\(.*\)/s//if ( ! { grep -s name=\\"\2\\" \1 } ) echo \1	\2/p' tmp > tmp1
	csh -f tmp1

tidy:
	@/bin/rm -f *~ *.bak *.tex tmp tmp1

clean: tidy
	@/bin/rm -f *.html *.tex

files: backward.html
files: by-cases.html
files: by-consistency.html
files: by-contradiction.html
files: by-generalization.html
files: by-induction.html
files: by-normalization.html
files: by-specialization.html
files: explicit.html
files: forward.html
files: methods.html
files: multilevel-induction.html
files: of-biconditional.html
files: of-conditional.html
files: of-conjunction.html
files: of-dr.html
files: of-implication.html
files: of-ir.html
files: of-ot.html
files: structural.html
files: well-founded.html
