#!/usr/bin/make -f
# Very small script to byte-compile hyperlatex1.el
# Erick Branderhorst <branderhorst@heel.fgg.eur.nl>

	
BIN	=	$(prefix)/bin
LIB	=	$(prefix)/lib
DOC	=	$(prefix)/doc
HTML	=	$(prefix)/doc/html
INST_BIN=	install -g root -o root -m 755
INST_DIR=	install -g root -o root -d -m 755
INST_DAT=	install -g root -o root -m 644

%.elc: %.el
	emacs -batch -q -no-site-file -l $< -f hyperlatex-compile &>/dev/null

all: hyperlatex-1.4.elc html

html: html/hyperlatex.html

html/hyperlatex.html: hyperlatex.tex hyperlatex-1.4.elc
	touch hyperlatex.ind
	latex hyperlatex.tex
	makeindex hyperlatex.idx
	-mkdir html
	./hyperlatex -gif hyperlatex.tex
	./hyperlatex hyperlatex.tex

install:
	$(INST_DIR)			$(BIN)
	$(INST_BIN) hyperlatex		$(BIN)
	$(INST_BIN) ps2gif		$(BIN)
	$(INST_DIR)			$(LIB)/emacs/site-lisp/hyperlatex
	$(INST_DAT) *.el*		$(LIB)/emacs/site-lisp/hyperlatex
	$(INST_DIR) 			$(DOC)/hyperlatex
	$(INST_DAT) README		$(DOC)/hyperlatex/README
	$(INST_DAT) hyperlatex.tex	$(DOC)/hyperlatex
	$(INST_DAT) hyperlatex.ind	$(DOC)/hyperlatex
	$(INST_DIR) 			$(HTML)/hyperlatex
	$(INST_DAT) html/* *.xbm	$(HTML)/hyperlatex
	$(INST_DIR)			$(LIB)/texmf/tex/latex/misc
	$(INST_DAT) hyperlatex.sty	$(LIB)/texmf/tex/latex/misc

clean:
	rm -rf *.elc *~ ./#* *.log *.dvi *.bak *.ps *.makegif *.aux html *.blg *.bbl *.ilg *.idx *.ind




