#	$eterna: Makefile,v 1.24 2004/08/28 10:37:41 mrg Exp $

# compile-time options are:
#	DEBUG			/* include debugging support */
#	NO_USER_SUPPORT		/* don't support /~user requests */
#	NO_CGIBIN_SUPPORT	/* don't support cgi-bin requests */
#	NO_DIRINDEX_SUPPORT	/* don't support directory indexing */
#	NO_DAEMON_MODE		/* don't support daemon mode */
#	NO_DYNAMIC_CONTENT	/* don't support dynamic content updates */
#	NO_SSL_SUPPORT		/* don't support ssl (https) */
#	DO_HTPASSWD		/* support .htpasswd files */

PROG=	bozohttpd
MAN=	bozohttpd.8
SRCS=	bozohttpd.c ssl-bozo.c auth-bozo.c cgi-bozo.c daemon-bozo.c \
	tilde-luzah-bozo.c dir-index-bozo.c content-bozo.c

WARNS=	3

check:
	cd $(.CURDIR)/testsuite; $(MAKE) check

clean:
	cd $(.CURDIR)/testsuite; $(MAKE) clean

CRYPTOLIBS=	-lcrypto -lssl
CRYPTODEPS=	$(LIBCRYPTO) $(LIBSSL)

NROFF?=		nroff

# if not defining -DNO_SSL_SUPPORT
LDADD=	$(CRYPTOLIBS)
DPADD=	$(CRYPTODEPS)

PREHTMLFROB=	sed \
		    -e 's/&/\&amp;/' \
		    -e 's/</\&lt;/' \
		    -e 's/>/\&gt;/'

HTMLFROB=	sed \
		    -e 's/\([MC] "[^"]*\)<dd>$$/\1<b>"<\/b><dd>/' \
		    -e 's/'"''"'/\&rdquo;/' \
		    -e 's/""/\&ldquo;/' \
		    -e 's/<a href="\.\.\/html[^>]*>\(.*\)<\/a>/\1/'

bozohttpd.8.html: bozohttpd.8
	$(PREHTMLFROB) $> | $(NROFF) -mdoc2html | $(HTMLFROB) > $@

CLEANFILES+=	bozohttpd.8.html

.include <bsd.prog.mk>
