Makefile revision 1.28
1#	$NetBSD: Makefile,v 1.28 2019/01/17 07:39:00 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# other system specific defines:
19#	HAVE_NBUTIL_H		/* netbsd compat is in <nbutil.h>
20#				(don't forget to also enable -lnbutil)
21#
22# these are usually set via the "COPTS" variable, or some other method
23# for setting CFLAGS relevant to your make, eg
24#   % make COPTS="-DDO_HTPASSWD"
25
26COPTS+=	-DDO_HTPASSWD
27PROG=	bozohttpd
28LINKS=	${BINDIR}/bozohttpd ${BINDIR}/httpd
29MAN=	bozohttpd.8
30MLINKS+=bozohttpd.8 httpd.8
31SRCS=	bozohttpd.c ssl-bozo.c auth-bozo.c cgi-bozo.c daemon-bozo.c \
32	tilde-luzah-bozo.c dir-index-bozo.c content-bozo.c lua-bozo.c
33SRCS+=	main.c
34
35LDADD=	-lcrypt -llua -lm
36DPADD=	${LIBCRYPT} ${LIBLUA} ${LIBM}
37
38WARNS?=	4
39
40.if defined(.OS.MAKE)
41OPSYS=	${.OS.MAKE}
42.else
43OPSYS:=	${:!uname -s!:S/-//g:S/\///g}
44.endif
45
46.if ${OPSYS} == "QNX"
47CPPFLAGS+=	-DHAVE_NBUTIL_H
48LDADD+=		-lnbutil
49.endif
50
51LDADD+=	-lssl -lcrypto
52DPADD+=	${LIBSSL} ${LIBCRYPTO}
53
54#
55# Build release things.
56#
57NROFF?=		nroff
58
59PREHTMLFROB=	sed \
60		    -e 's/&/\&amp;/' \
61		    -e 's/</\&lt;/' \
62		    -e 's/>/\&gt;/'
63
64HTMLFROB=	sed \
65		    -e 's/\([MC] "[^"]*\)<dd>$$/\1<b>"<\/b><dd>/' \
66		    -e 's/'"''"'/\&rdquo;/' \
67		    -e 's/""/\&ldquo;/' \
68		    -e 's/<a href="\.\.\/html[^>]*>\(.*\)<\/a>/\1/'
69
70TXTFROB=	col -b
71
72bozohttpd.8.html: bozohttpd.8
73	$(PREHTMLFROB) $> | $(NROFF) -mdoc2html | $(HTMLFROB) > $@
74
75bozohttpd.8.txt: bozohttpd.8
76	$(NROFF) -mdoc -Tascii $> | $(TXTFROB) > $@
77
78CLEANFILES+=	bozohttpd.8.html bozohttpd.8.txt
79
80check:
81	cd ${.CURDIR}/testsuite && ${MAKE} check
82
83# Create a distfile: uses /tmp
84BASE=bozohttpd-${BOZOVER}
85TAR=${BASE}.tar
86export-distfile:
87	dir=`mktemp -d /tmp/bozo-export-XXXXXX`; \
88	cd "$${dir}" || exit; \
89	mkdir ${BASE}; \
90	( cd ${BASE} || exit; \
91	  cp -r "${.CURDIR}/." "."; \
92	  find . -name .CVS | xargs rm -r; \
93	); \
94	pax -wf ${TAR} ${BASE}; \
95	gzip -nc9 ${TAR} > ${TAR}.gz; \
96	bzip2 -9 ${TAR}; \
97	echo "Exported two files in $${dir}:"; \
98	echo ${TAR}.gz; \
99	echo ${TAR}.bz2
100
101.include <bsd.prog.mk>
102