# 
# Makefile for ffw docs
#

MANDIR = 
HTMLDIR =
C++ = g++
OPTIONS =

MAN_FILES = ffwindex.1 ffwcgi.1 ffwsearch.1 ffwstat.1 ffwmerge.1 ffwdateindex.1
HTML_FILES = $(MAN_FILES:.1=.html)

.SUFFIXES:
.SUFFIXES: .1 .html
SHELL=/bin/sh

.1.html:
	nroff -man $< | man2html -t "man `basename $< .1`" > $@	

all: htmlfiles

htmlfiles: $(HTML_FILES)

$(HTML_FILES): man2html

man2html: man2html.c
	$(C++) -o man2html $(OPTIONS) man2html.c

install: htmlfiles
	if [ x$(MANDIR) != x ]; then \
	    for file in $(MAN_FILES); do \
		install -m 444 $$file $(MANDIR); \
	    done ; \
	fi
	if [ x$(HTMLDIR) != x ]; then \
	    for file in $(HTML_FILES); do \
		install -m 444 $$file $(HTMLDIR); \
	    done ; \
	fi
	
	
depend:
	# empty

noinc:
	# empty

clean:
	/bin/rm -f core *~  *.bak \#* man2html *.html

