1#         $NetBSD: Makefile,v 1.6 2021/04/08 06:52:42 rillig Exp $
2#         $eterna: Makefile,v 1.1 2009/05/22 21:51:39 mrg Exp $
3
4# build a 100% lean bozohttpd-small.c
5PROG=     bozohttpd-small
6NOMAN=    # defined
7SRCS=     bozohttpd-small.c content-bozo-small.c ssl-bozo.c main.c
8
9LEAN_IFDEF_FLAGS=   -UDEBUG -DNO_USER_SUPPORT \
10                              -DNO_CGIBIN_SUPPORT -DNO_DIRINDEX_SUPPORT \
11                              -DNO_DAEMON_MODE -DNO_DYNAMIC_CONTENT \
12                              -DNO_SSL_SUPPORT -UDO_HTPASSWD \
13                              -DNO_LUA_SUPPORT -DNO_BLOCKLIST_SUPPORT
14
15CPPFLAGS= -I$(.CURDIR)/.. ${LEAN_IFDEF_FLAGS}
16
17bozohttpd-small.c: bozohttpd.c
18          unifdef $(LEAN_IFDEF_FLAGS) < $> > $@.tmp;                            \
19          status=$$?;                                                                     \
20          if [ $$status -ne 1 ]; then                                           \
21                    echo "unifdef returned $$status, expecting 1" 2>&1;         \
22                    false;                                                                \
23          fi
24          mv -f $@.tmp $@
25
26content-bozo-small.c: content-bozo.c
27          unifdef $(LEAN_IFDEF_FLAGS) < $> > $@.tmp;                            \
28          status=$$?;                                                                     \
29          if [ $$status -ne 1 ]; then                                           \
30                    echo "unifdef returned $$status, expecting 1" 2>&1;         \
31                    false;                                                                \
32          fi
33          mv -f $@.tmp $@
34
35CLEANFILES+=        content-bozo-small.c bozohttpd-small.c
36
37.PATH: $(.CURDIR)/..
38
39.include <bsd.prog.mk>
40