DESTDIR =
prefix  = /usr/local
MANDIR  = ${prefix}/share/man

MAN1S = sgml2x.1 runjade.1 rlatex.1

DB2XFLAGS = --catalog $(shell pwd)/../catalog --confdirs /etc/sgml/sgml2x --confdirs ../sgml2x-aliases

all: ${MAN1S}

%.1: %.sgml
	docbook-to-man $< > $@

%-html: %.sgml
	../bin/docbook-2-html --style nwalsh ${DB2XFLAGS} $<

clean:
	rm -f *.1
	rm -rf *-html

install: ${MAN1S}
	mkdir -p ${DESTDIR}${MANDIR}/man1
	install -m 644 $^ ${DESTDIR}${MANDIR}/man1

	for conv in ${CONVERTERS}; do \
		ln -s sgml2x.1 ${DESTDIR}${MANDIR}/man1/$$conv.1 ; \
	done
