Makefile revision 1.20
1#	$NetBSD: Makefile,v 1.20 2014/02/02 03:20:10 mrg Exp $
2#
3#	$eterna: Makefile,v 1.30 2010/07/11 00:34:27 mrg Exp $
4#
5# berkeley (netbsd) makefile.  see Makefile.boot for other systems.
6
7# compile-time options are:
8#	NO_DEBUG		/* don't include debugging support */
9#	NO_USER_SUPPORT		/* don't support /~user requests */
10#	NO_CGIBIN_SUPPORT	/* don't support cgi-bin requests */
11#	NO_DIRINDEX_SUPPORT	/* don't support directory indexing */
12#	NO_DAEMON_MODE		/* don't support daemon mode */
13#	NO_DYNAMIC_CONTENT	/* don't support dynamic content updates */
14#	NO_SSL_SUPPORT		/* don't support ssl (https) */
15#	DO_HTPASSWD		/* support .htpasswd files */
16#	NO_LUA_SUPPORT		/* don't support Lua for dynamic content */
17#
18# these are usually set via the "COPTS" variable, or some other method
19# for setting CFLAGS relevant to your make, eg
20#   % make COPTS="-DDO_HTPASSWD"
21
22COPTS+=	-DDO_HTPASSWD
23PROG=	httpd
24MAN=	httpd.8
25BUILDSYMLINKS+=bozohttpd.8 httpd.8
26SRCS=	bozohttpd.c ssl-bozo.c auth-bozo.c cgi-bozo.c daemon-bozo.c \
27	tilde-luzah-bozo.c dir-index-bozo.c content-bozo.c lua-bozo.c
28SRCS+=	main.c
29
30LDADD=	-lcrypt -llua -lm
31DPADD=	${LIBCRYPT} ${LIBLUA} ${LIBM}
32
33WARNS?=	4
34
35.include <bsd.own.mk>
36
37.if ${MKCRYPTO} != "no"
38
39LDADD+=	-lssl -lcrypto
40DPADD+=	${LIBSSL} ${LIBCRYPTO}
41
42.else
43
44COPTS+=	-DNO_SSL_SUPPORT
45
46.endif
47
48#
49# Build release things.
50#
51NROFF?=		nroff
52
53PREHTMLFROB=	sed \
54		    -e 's/&/\&amp;/' \
55		    -e 's/</\&lt;/' \
56		    -e 's/>/\&gt;/'
57
58HTMLFROB=	sed \
59		    -e 's/\([MC] "[^"]*\)<dd>$$/\1<b>"<\/b><dd>/' \
60		    -e 's/'"''"'/\&rdquo;/' \
61		    -e 's/""/\&ldquo;/' \
62		    -e 's/<a href="\.\.\/html[^>]*>\(.*\)<\/a>/\1/'
63
64TXTFROB=	col -b
65
66bozohttpd.8.html: bozohttpd.8
67	$(PREHTMLFROB) $> | $(NROFF) -mdoc2html | $(HTMLFROB) > $@
68
69bozohttpd.8.txt: bozohttpd.8
70	$(NROFF) -mdoc -Tascii $> | $(TXTFROB) > $@
71
72CLEANFILES+=	bozohttpd.8.html bozohttpd.8.txt
73
74# Create a distfile: uses /tmp
75BASE=bozohttpd-${BOZOVER}
76TAR=${BASE}.tar
77export-distfile:
78	dir=`mktemp -d /tmp/bozo-export-XXXXXX`; \
79	cd "$${dir}" || exit; \
80	mkdir ${BASE}; \
81	( cd ${BASE} || exit; \
82	  cp -r "${.CURDIR}/." "."; \
83	  find . -name .CVS | xargs rm -r; \
84	); \
85	pax -wf ${TAR} ${BASE}; \
86	gzip -nc9 ${TAR} > ${TAR}.gz; \
87	bzip2 -9 ${TAR}
88	@echo "Exported two files:"
89	@echo ${TAR}.gz
90	@echo ${TAR}.bz2
91
92.include <bsd.prog.mk>
93