# If latexmk is not available use the following definitions, and be
# prepared to handle recursion, and multiple latex runs yourself.
# LATEX=latex
# MAKEINDEX=makeindex

LATEXMK=latexmk -F -f
LATEX=$(LATEXMK)
MAKEINDEX=$(LATEXMK)

default:	lkort.dvi WWW/ltx-errata.html /users/ftp/TEX/DOC/ltxhandl.err

lkort.dvi:	lkort.tex lk0.tex lk1.tex lk2.tex lk3.tex lk4.tex lk5.tex \
		lk6.tex lk7.tex lkbib.tex lkcompat.tex lkind.tex lklocal.tex \
		lkpakket.tex lkps.tex lksym.tex  plot2.tex \
		bitmapsmile.ps conversie.ps ditherdemo.ps idrawobjs.ps \
		idrawpict1.ps plot1.ps xfigwin.ps lkort.ind
	$(LATEX) lkort

lkort.idx:	lkort.tex lk0.tex lk1.tex lk2.tex lk3.tex lk4.tex lk5.tex \
		lk6.tex lk7.tex lkbib.tex lkcompat.tex lkind.tex lklocal.tex \
		lkpakket.tex lkps.tex lksym.tex  plot2.tex \
		bitmapsmile.ps conversie.ps ditherdemo.ps idrawobjs.ps \
		idrawpict1.ps plot1.ps xfigwin.ps
	$(LATEX) lkort

lkort.ind:	lkort.idx
	$(MAKEINDEX) lkort

lkort.ps:	lkort.dvi
	dvips -a -o lkort.ps lkort.dvi

lktitle.ps:	lktitle.dvi
	dvips -o lktitle.ps lktitle.dvi

lktitle.dvi:	lktitle.tex
	latex lktitle

voorblad.dvi:	voorblad.tex
	latex voorblad

achterkant.dvi: achterkant.tex
	latex achterkant

print:	latexhnd.ps

latexhnd.ps:	latexhnd.dvi
	dvips -Pdocutech -o latexhnd.ps latexhnd.dvi

latexhnd.dvi:	voorblad.dvi lktitle.dvi lkort.dvi achterkant.dvi
	dviconcat -o latexhnd.dvi \
		voorblad.dvi lktitle.dvi lkort.dvi achterkant.dvi

ps:	lkort.ps lktitle.ps
	zip -9f /users/ftp/TEX/DOC/ltxhandl lkort.ps lktitle.ps
	cp lkort.ps WWW/ltxhandl.ps

/users/ftp/TEX/DOC/ltxhandl.err: errata
	cat ltx-errata.ptx errata >ltxhandl.err
	echo "------------------------------"  >>ltxhandl.err
	date >>ltxhandl.err
	mv ltxhandl.err /users/ftp/TEX/DOC/


WWW/ltx-errata.html: errata
	cat errata-pre.html >ltx-errata.html
	sed -e 's/&/\&amp;/g' -e 's/</\&lt;/g' -e 's/>/\&gt;/g' \
		errata >>ltx-errata.html
	sed "s/DATE/`date`/" ltx-errata.pos >>ltx-errata.html
	mv ltx-errata.html WWW/


source: 
	zip -9 ltxhsrc lkort.tex lk[0-7].tex lkbib.tex lkcompat.tex \
		lkind.tex lklocal.tex lkpakket.tex lkps.tex lksym.tex \
		lktitle.tex plot2.tex \
		bitmapsmile.ps conversie.ps ditherdemo.ps idrawobjs.ps \
		idrawpict1.ps plot1.ps xfigwin.ps \
		plot2.scr plot.data Makefile 
