include ../../nessus.tmpl

all: users-manual.pdf users-manual-de.pdf users-manual.html users-manual-de.html

LYX=lyx

%.pdf: %.lyx
	$(LYX) -e pdf $< && $(LYX) -e pdf $<

%.tex: %.lyx
	$(LYX) -e latex $<

%.dvi: %.tex
	latex $@

%.ps: %.dvi
	dvips $@ -o $<

%.html: %.tex
	latex2html -split 0 -nosubdir $<

%.rtf: %.tex
	latex2rtf -C latin1 -l $<

install: all
	test -d ${NESSUS_DOCDIR} || $(INSTALL_DIR) -m 755 ${NESSUS_DOCDIR}
	test -d ${NESSUS_DOCDIR}/html/ || $(INSTALL_DIR) -m 755 ${NESSUS_DOCDIR}/html
	$(INSTALL) -m 644 users-manual.pdf ${NESSUS_DOCDIR}/
	$(INSTALL) -m 644 users-manual-de.pdf ${NESSUS_DOCDIR}/
	# The following makes only sense if it is solved to have
	# the images there as well.
	# $(INSTALL) -m 644 users-manual.html ${NESSUS_DOCDIR}/html
	# $(INSTALL) -m 644 users-manual-de.html ${NESSUS_DOCDIR}/html

clean:
	rm -rf *.aux *.toc *.dvi *.ps *.log *.pdf *.html

distclean: clean
