# GNU Makefile for maf man page

NAME=maf

# define location of web source directory
PUB-DIR=${HOME}/www-src/hydrus/data/doc
# define install dir for man page
MAN-DIR=/usr/local/man/man1

.PHONY:	clean publish install deinstall

%.1:	%.in.1
	if [ "$$(command -v mandoc)" != "" ]; then \
		mandoc -Tlint $<; \
	fi
	cp $< $@

${NAME}.1: ${NAME}.in.1

publish:
	mandoc -O fragment -T html ${NAME}.1 >${NAME}.html
	cp ${NAME}.html ${PUB-DIR}

install:
	gzip -c ${NAME}.1 >${MAN-DIR}/${NAME}.1.gz

deinstall:
	rm -f ${MAN-DIR}/${NAME}.1.gz

clean:
	rm -f ${NAME}.1 ${NAME}.html
