1 # $NetBSD: Makefile,v 1.25 2015/10/30 18:53:26 tron 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 26 COPTS+= -DDO_HTPASSWD 27 PROG= bozohttpd 28 LINKS= ${BINDIR}/bozohttpd ${BINDIR}/httpd 29 MAN= bozohttpd.8 30 MLINKS+=bozohttpd.8 httpd.8 31 SRCS= 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 33 SRCS+= main.c 34 35 LDADD= -lcrypt -llua -lm 36 DPADD= ${LIBCRYPT} ${LIBLUA} ${LIBM} 37 38 WARNS?= 4 39 40 .if defined(.OS.MAKE) 41 OPSYS= ${.OS.MAKE} 42 .else 43 OPSYS:= ${:!uname -s!:S/-//g:S/\///g} 44 .endif 45 46 .if ${OPSYS} == "QNX" 47 CPPFLAGS+= -DHAVE_NBUTIL_H 48 LDADD+= -lnbutil 49 .endif 50 51 COPTS.bozohttpd.c= -Wno-stack-protector 52 53 54 .include <bsd.own.mk> 55 56 .if ${MKCRYPTO} != "no" 57 58 LDADD+= -lssl -lcrypto 59 DPADD+= ${LIBSSL} ${LIBCRYPTO} 60 61 .else 62 63 COPTS+= -DNO_SSL_SUPPORT 64 65 .endif 66 67 # 68 # Build release things. 69 # 70 NROFF?= nroff 71 72 PREHTMLFROB= sed \ 73 -e 's/&/\&/' \ 74 -e 's/</\</' \ 75 -e 's/>/\>/' 76 77 HTMLFROB= sed \ 78 -e 's/\([MC] "[^"]*\)<dd>$$/\1<b>"<\/b><dd>/' \ 79 -e 's/'"''"'/\”/' \ 80 -e 's/""/\“/' \ 81 -e 's/<a href="\.\.\/html[^>]*>\(.*\)<\/a>/\1/' 82 83 TXTFROB= col -b 84 85 bozohttpd.8.html: bozohttpd.8 86 $(PREHTMLFROB) $> | $(NROFF) -mdoc2html | $(HTMLFROB) > $@ 87 88 bozohttpd.8.txt: bozohttpd.8 89 $(NROFF) -mdoc -Tascii $> | $(TXTFROB) > $@ 90 91 CLEANFILES+= bozohttpd.8.html bozohttpd.8.txt 92 93 # Create a distfile: uses /tmp 94 BASE=bozohttpd-${BOZOVER} 95 TAR=${BASE}.tar 96 export-distfile: 97 dir=`mktemp -d /tmp/bozo-export-XXXXXX`; \ 98 cd "$${dir}" || exit; \ 99 mkdir ${BASE}; \ 100 ( cd ${BASE} || exit; \ 101 cp -r "${.CURDIR}/." "."; \ 102 find . -name .CVS | xargs rm -r; \ 103 ); \ 104 pax -wf ${TAR} ${BASE}; \ 105 gzip -nc9 ${TAR} > ${TAR}.gz; \ 106 bzip2 -9 ${TAR}; \ 107 echo "Exported two files in $${dir}:"; \ 108 echo ${TAR}.gz; \ 109 echo ${TAR}.bz2 110 111 .include <bsd.prog.mk> 112