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