MAKEINFO=makeinfo
TEXI2DVI=texi2dvi
TEXI2HTML=./texi2html
DVI2PS=dvips

AM=asn1-mode
AD=asn1-diff

%.html: %.texinfo
	$(TEXI2HTML) $<
	mv $*.html $*.html.tmp
	awk '/<BASE HREF/ { t=1 } t==1 {print}' $*.html.tmp |\
	  sed -e '/<\/HTML>/ q' > $*.html

%.ps: %.dvi
	$(DVI2PS) -o $*.ps $<

%.info: %.texi
	$(MAKEINFO) -o $*.info $*.texi

%.dvi: %.texi
	$(TEXI2DVI) $*.texi

%.texinfo: %.texi
	sed -f elibel $< > $*.texinfo

%.pdf: %.ps
	distill $<

all: ps html

help:
	@echo "Options : all info dvi ps html pdf clean distclean"

info: $(AM).info 
dvi: $(AM).dvi 
ps: $(AM).ps 
html: $(AM).html 
pdf: $(AM).pdf 

clean :
	rm -f *~ \#*\# *.cp *.cps *.aux *.fn *.ky *.log *.pg *.toc *.tp\
              *.vr *.bak *.tmp *_toc.html

distclean : clean
	rm -f *.ps *.html *.dvi *.info *.elc *.pdf
