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